Re: [csswg-drafts] [css-text-decor-4] Allow percentages in `text-decoration-trim` (#8403)

> > In this model, how do you inset (or outset) one end of the line independently of the other?
> 
> I don't think you can (except perhaps through another property to offset). Are there use cases that need this? Do other models allow this?

The current spec for `text-decoration-inset` (formerly `-trim`) accepts two `<length>s`, to adjust the start and end of the decoration line. So (assuming percentage support) you could, for example, animate the inset from `0 100%` to `0 0` to make the line grow from the start of the element to its end. Or you can set the insets to `1em -1em` to shift the line 1em forward without changing its length, etc. I can imagine a designer wanting a line to oscillate gently from side to side (e.g. as a `:hover` effect), which is easy with the `text-decoration-inset` model.

-- 
GitHub Notification of comment by jfkthame
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8403#issuecomment-3464027474 using your GitHub account


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

Received on Wednesday, 29 October 2025 21:04:53 UTC