-
Notifications
You must be signed in to change notification settings - Fork 672
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[css-text-4] Rethinking 'text-space-collapse' and 'text-space-trim' #448
Comments
Hi @SebastianZ , I don't mind bikeshedding the syntax of each property, but we can't move values around. The only reason there are two properties here rather than just one is that one set of values needs to inherit while the other one must not. :) Let me know if you still think there should be some changes here. |
Right, little detail, big difference. So that's the reason for Though I'm still not happy with the naming of the value. I believe all values of But the values were not the only thing of this proposal. What about the renaming? Last point, my proposal included a keyword Sebastian |
Fair point. :) Leaning towards
If we end up preserving the line-breaking opportunities, then it's a type of collapsing really. Note that newlines collapse to nothing in CJK contexts, for example. Also I don't have a better name.
There was some historical issue about not having the same name as an XSL:FO property. If that's no longer relevant, we could use
Actually one of the major use cases was inline notes like footnotes, which would warrant |
Then we agree on this. Nothing else to consider.
What about
What was that issue exactly? And who could answer whether that's still a problem?
I was thinking of code blocks. For them you normally want whitespace before and after the actual code to be discarded. Sebastian |
That's the |
Oh, right. Well, you actually want both sides trimmed, inside and outside, though the outer whitespace is already collapsed by default via the whitespace collapsing algorithm. The inline-block use case is still valid, though, as in https://jsfiddle.net/SebastianZ/qLjh7wup/3/. (Though the use cases I am currently thinking of can be solved by using Flexbox or Grid layout, which automatically discard the white space around their items. As this logic somewhat conflicts with Sebastian |
As far as I understand,
text-space-collapse
is meant to control the white space processing inside an element whiletext-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 withtext-space-collapse: discard
, becausetext-space-collapse: discard
discards all white space within an element andtext-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:white-space-inner
/white-space-inside
/white-space-within
andwhite-space-outer
/white-space-outside
/white-space-around
(name bikeshedding welcome).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:
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:Sebastian
The text was updated successfully, but these errors were encountered: