[csswg-drafts] [css-overflow-4] `line-clamp` shorthand syntax is ambiguous (#12416)

andreubotella has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-overflow-4] `line-clamp` shorthand syntax is ambiguous ==
Currently the syntax for the `line-clamp` property is `none | [<integer [1,∞]> || <'block-ellipsis'>] -webkit-legacy?`. The `none` branch at the left of the bar (`|`) sets all three longhands to their initial values. However, `none` is also a valid value for the right hand of the bar, since it's a valid value for the `block-ellipsis` property; and that would set `continue` to its non-initial `collapse` value.

The `none` left branch probably needs to keep that name for compatibility with `-webkit-line-clamp`[^1]. But we probably want to be able to represent `continue: collapse; max-lines: none; block-ellipsis: none` with some shorthand. So should we find some other keyword for the `block-ellipsis` value where there's no ellipsis? Note that the declarations `line-clamp: none -webkit-legacy` or `line-clamp: none 3` might be confusing to developers, especially since setting the `block-ellipsis` value might be uncommon.

cc @frivoal @emilio

[^1]: Well, traditionally, at least Webkit and Chromium's implementation of `-webkit-line-clamp` didn't support the `none` keyword as an input, and also didn't support any other way to input the initial state of that property other than with `initial`; although they did output `none` when serializing the property 🤷. But this has been fixed over the past few years, and currently all mainstream browsers will accept `-webkit-line-clamp: none`.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12416 using your GitHub account


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

Received on Monday, 30 June 2025 10:15:25 UTC