[csswg-drafts] [css-text-4] Rethinking 'text-space-collapse' and 'text-space-trim'

SebastianZ has just created a new issue for 
https://github.com/w3c/csswg-drafts:

== [css-text-4] Rethinking 'text-space-collapse' and 'text-space-trim'
 ==
As far as I understand, 
[`text-space-collapse`](https://drafts.csswg.org/css-text-4/#white-space-collapsing)
 is meant to control the white space processing **inside** an element 
while `text-space-trim` is used to control the white space processing 
**around** (the edges of) an element.

Furthermore, it looks like `text-space-trim: trim-inner` overlaps with
 `text-space-collapse: discard`, because `text-space-collapse: 
discard` discards all white space within an element and 
`text-space-trim: trim-inner` discards all white space at the 
beginning and end within an element.

With the above in mind and also in regard of their shorthand 
`white-space`, I think it would be better to:

1. rename them to something like 
`white-space-inner`/`white-space-inside`/`white-space-within` and 
`white-space-outer`/`white-space-outside`/`white-space-around` (name 
bikeshedding welcome).

2. change `text-space-trim` to only affect white space outside of the 
element and use the same values as `text-space-collapse`.

So the syntaxes for them would then look something like this:

    white-space-inside: collapse | discard | preserve | 
preserve-breaks | preserve-spaces
    white-space-around: collapse | discard | preserve | 
preserve-breaks | preserve-spaces |
        [
            [ collapse-before | discard-before | preserve-before | 
preserve-breaks-before | preserve-spaces-before ] ||
            [ collapse-after | discard-after | preserve-after | 
preserve-breaks-after | preserve-spaces-after ]
        ]

To avoid the long keywords and the complicated syntax on 
`white-space-around` a two-value syntax could be used instead, where 
the first value applies to the white space before the element and the 
second to the white space after the element, and if only one value is 
given, it applies to both. The syntax would then look like this:

    white-space-around: [ collapse | discard | preserve | 
preserve-breaks | preserve-spaces ]{1,2}

Sebastian

Please view or discuss this issue at 
https://github.com/w3c/csswg-drafts/issues/448 using your GitHub 
account

Received on Tuesday, 6 September 2016 09:17:09 UTC