Description
As far as I understand, text-space-collapse
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:
- rename them to something like
white-space-inner
/white-space-inside
/white-space-within
andwhite-space-outer
/white-space-outside
/white-space-around
(name bikeshedding welcome). - change
text-space-trim
to only affect white space outside of the element and use the same values astext-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