Re: [csswg-drafts] [css-text-decor] Feature request - add a property text-decoration-length that modifies the length of the underline (#4557)

The CSS Working Group just discussed `[css-text-decor] Feature request - add a property text-decoration-length that modifies the length of the underline`, and agreed to the following:

* ``RESOLVED: Remove text-decoration-skip-inset, add `text-decoration-trim: <length> <length>?`, follow-up for improvements and issues``

<details><summary>The full IRC log of that discussion</summary>
&lt;emilio> topic: [css-text-decor] Feature request - add a property text-decoration-length that modifies the length of the underline<br>
&lt;emilio> github: https://github.com/w3c/csswg-drafts/issues/4557<br>
&lt;emilio> fantasai: there's been a variety of requests for controlling the length of underlines<br>
&lt;fantasai> https://github.com/w3c/csswg-drafts/issues/4517<br>
&lt;emilio> ... we have some spec text to ensure that underlines break between words<br>
&lt;emilio> ... but we've been asked to provide more control<br>
&lt;emilio> ... suggestion is to define a new `text-decoration-trim` property<br>
&lt;fantasai> https://github.com/w3c/csswg-drafts/issues/4557#issuecomment-1117735704<br>
&lt;emilio> ... which would take a `&lt;length-percentage>`<br>
&lt;emilio> ... and shortens the underline by the given amount<br>
&lt;emilio> ... there's the question of what's the percentage relative to<br>
&lt;emilio> ... so we could start with `&lt;length>`<br>
&lt;emilio> ... on block containers we could apply it to both sides of the block<br>
&lt;emilio> ... on inlines it should follow the behavior of box-decoration-break<br>
&lt;emilio> ... negative values are allowed and would extend the text-decoration<br>
&lt;emilio> ... percentages were suggested to be relative to the containing-block<br>
&lt;emilio> ... there's some effect animating where that'd be useful for<br>
&lt;fantasai> https://www.w3.org/TR/css-text-decor-4/#text-decoration-skip-inset-property<br>
&lt;emilio> ... if we want to discuss percentages we can do that now but I'd like to add this to the spec and remove `text-decoration-skip-inset`<br>
&lt;emilio> ... as described above wrt inlines / blocks<br>
&lt;emilio> astearns: is text-decoration-skip-inset implemented anywhere?<br>
&lt;emilio> fantasai: I don't think so<br>
&lt;emilio> astearns: is trim the best word when negative lengths can be an extension?<br>
&lt;tantek> just like indent negative means outdent?<br>
&lt;fantasai> yep<br>
&lt;emilio> fantasai: I think so since negative trim is to extend the same way as negative extend is trim, I think use case is mostly trimming<br>
&lt;emilio> florian: the property that would be dropped had an auto value<br>
&lt;emilio> ... should this have the same value?<br>
&lt;emilio> ... if you want the browser to trim by the right amount<br>
&lt;emilio> ... so we'd be losing this but we could reintroduce this if wanted<br>
&lt;emilio> fantasai: yes<br>
&lt;emilio> astearns: fantasai, would this go into your initial write-up? or should we decide later?<br>
&lt;emilio> fantasai: I don't think an auto value is particularly useful if you can specify lengths<br>
&lt;tantek> +1 fantasai, worth documenting an actual use-case of for 'auto', like what problem is it solving?<br>
&lt;fantasai> it's solving the problem documented in https://www.w3.org/TR/css-text-decor-4/#text-decoration-skip-inset-property<br>
&lt;emilio> florian: in CJK when you have a piece of content and they might be next to each other, and without skipping you might not notice that they're different words<br>
&lt;emilio> ... you might want to say "browser, just do something"<br>
&lt;faceless> Easy enough to define "auto" as "the width of the underline" perhaps?<br>
&lt;emilio> ... you could do "3px" or something, but then why that?<br>
&lt;emilio> fantasai: I think the width of the underline was my initial thought<br>
&lt;emilio> ... though might not be useful if the underline is very big? So might be more like `min(0.1em, underline-width)` or something<br>
&lt;emilio> florian: do we want browser guidance here?<br>
&lt;emilio> fantasai: I think we want to do that so people know what to implement<br>
&lt;emilio> florian: [missed]<br>
&lt;emilio> fantasai: one of the problems we have with percents is that we have percentages for word-spacing etc to reference the font-size of the element? Maybe we can do that<br>
&lt;astearns> s/[missed]/I have wanted this without having an opinion on a specific value/<br>
&lt;florian> s/[missed]/As one data point, I have authored CJK content where I've wanted this, without having a view as to how big it should be./<br>
&lt;emilio> fantasai: happy to start with `&lt;length>` / `&lt;length>|auto` / then add percentages<br>
&lt;emilio> ... probably worth starting with length and add things afterwards<br>
&lt;emilio> plinss: question, removing lengths from the end of the decoration, or also from the skipping between descenders and so<br>
&lt;emilio> fantasai: just end<br>
&lt;emilio> astearns: we discussed that and run into implementation difficulties<br>
&lt;emilio> plinss: ok, just wanted clarification, would be weird if it trimmed from both<br>
&lt;florian> s/do we want browser guidance here?/can we leave it as browser defined, or do browsers want guidance here?/<br>
&lt;jensimmons> `text-decoration-trim: &lt;length>` for the resolution<br>
&lt;emilio> jfkthame: one thing I wondered is whether we want two values, one for start, one for end<br>
&lt;emilio> fantasai: makes sense<br>
&lt;emilio> jensimmons: separate for start/end could be declared all at once<br>
&lt;tantek> q+ to ask about interactions with text-overflow<br>
&lt;emilio> ... could see authors creating some kind of drop-shadow-like effects<br>
&lt;fantasai> -> illustration https://github.com/w3c/csswg-drafts/issues/4517<br>
&lt;emilio> ... specially when combined with underline offset/thickness<br>
&lt;dbaron> maybe also when combined with italic/oblique<br>
&lt;emilio> ... there's the question of what happens with inline-box breaking<br>
&lt;emilio> astearns: that's the part where it'd follow box-decoration-break<br>
&lt;astearns> ack tantek<br>
&lt;Zakim> tantek, you wanted to ask about interactions with text-overflow<br>
&lt;emilio> tantek: just wanted to add with potential interactions with text-overflow: ellipsis<br>
&lt;emilio> ... do you want this always, only when there's no text overflow, do you want to trim from the ellipsis start...?<br>
&lt;emilio> fantasai: can't even remember whether the ellipsis gets underlined or not atm<br>
&lt;emilio> astearns: if you're not using trimming at all, it seems this is a higher level question, you should get control for whether the underline applies to the end overflow<br>
&lt;emilio> plinss: my intuition would be that the end would be that the end would be where it'd be without text overflow<br>
&lt;emilio> fantasai: [missed], something about box-decoration-break<br>
&lt;emilio> plinss: I like separate start/end, provides more interesting animation possibilities<br>
&lt;fantasai> box-decoration-break defaults to slice, which would get the behavior plinss describes<br>
&lt;emilio> RESOLVED: Remove text-decoration-skip-inset, add `text-decoration-trim: &lt;length> &lt;length>?`, follow-up for improvements and issues<br>
&lt;emilio> florian: could I ask people familiar with in-design and similar software if they have auto values and how it works if so?<br>
&lt;emilio> astearns: don't recall<br>
&lt;emilio> astearns: will ask about in-design underlines<br>
&lt;emilio> fantasai: should I add the definitions with auto / percentages in the first draft?<br>
&lt;emilio> astearns: I think it'd be good to add at least a note<br>
&lt;emilio> florian: either that or put the value in with an issue on how to define it<br>
&lt;emilio> fantasai: if people are fine with me adding it in I'd just do that since it makes it easier to discuss<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4557#issuecomment-1183456098 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 13 July 2022 16:48:18 UTC