-
Notifications
You must be signed in to change notification settings - Fork 678
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] add 'avoid' to text-wrap-mode #9448
Comments
That's probably not the best example for why it should inherit, since you probably wouldn't set this on a block. A better example might be a link that has some bold text inside it. |
If you make it an inheritable property then you only get one level of prioritization: the entire run of consecutive |
@fantasai Yeah, I guess it's about which thing would be more annoying: using a new property and having to set it for all the descendants you wanted to apply it to, versus needing to explicitly undo that for descendants that shouldn't be To me, the former would be worse, but maybe there are use cases that could convince me otherwise? I also get the desire to have the value space of wrap-before/after/inside match that of break-before/after/inside. |
I suspect this is a misunderstanding of how Say you have something like this:
If you apply If you apply In a way, this is similar to text-decoration: it's not inherited, but it covers the whole subtree rooted at the element you target. |
relatedly:
You cannot set up |
That didn't seem obvious in the spec language. In reading, your response, I was thinking that sounds like Is that how it would be with a non-inherited |
Yes, you are right. I figured that out and corrected myself in the next comment after that. |
Stated another way: If I have I'm not seeing the downside here. This seems much preferable to emulating the oddities of |
Does an inherited <span><span style="wrap-inside: avoid;">a b c d <span style="wrap-inside: avoid;">e f g</span></span> h <span style="wrap-inside: avoid;"><span style="wrap-inside: avoid;">i j k</span><span style="wrap-inside: avoid;">l m n</span> o</span></span>
To me, this whole process feels very different from Additionally, Also, something I'm not sure about from the current
|
Not in any obvious way I can think of, and that ability is the reason why it is designed the way it is at the moment.
I agree that is not 100% clear from the spec. I'd say no, you don't get skip/undo breaking on the outer box just because you had to break in the inner one, that would go against the sense of hierarchy. In example 4, I think you could take the break after But I guess that's open to interpretation, and that there's (at least) two questions:
But I do realize that this preference of mine isn't symmetric. I think I'd be more willing to change my mind on the first one than on the second. |
in #9102 (comment)_, we are working on the name of the onoff longhand property forThe values forwhite-space
ortext-wrap
.text-wrap-mode
are already decided aswrap | nowrap
.I am suggesting a third value be added,
avoid-wrap
(or maybe justavoid
). This would take the place of a separate (binary)wrap-inside
property. It would also make thetext-wrap-mode
property(whatever we call it)not be just a binary toggle, because it would have three values now.I think this is easier for authors than learning a new property (it's getting complicated enough anyway). Since
wrap-inside: avoid
is basically a relaxed version oftext-wrap-mode: nowrap
(provisional property name), I think it fits more naturally in the same property.One implication of making this change is that the property value would be inherited, like the other values of the
text-wrap-mode
property. But I think this is better anyway, so that if a paragraph is avoiding wraps where possible, so would its children (such as a long<b>
element).The text was updated successfully, but these errors were encountered: