[csswg-drafts] [css-overflow] Can you line-clamp by both a number of lines and a height at the same time? (#12041)

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

== [css-overflow] Can you line-clamp by both a number of lines and a height at the same time? ==
The `line-clamp` property is defined as a shorthand for three longhands, one of which is `max-lines`, which says that the clamp point should be after a particular line. You can also remove the `max-lines` property (or set the shorthand to `line-clamp: auto`) and set `max-height` to clamp by a height.

With the `continue: discard` approach that is currently in the spec, the clamping is based on fragmentation, and `max-lines` adds a region break. So if you have both `max-lines` and `max-height` and the content overflows before the specified line, it will clamp based on the height.

However, as we just resolved, `line-clamp` will instead default to the `continue: collapse` approach (see #7708) which isn't based on fragmentation. So should that have the same behavior when clamping by both a number of lines and a height?

In our implementation in Chromium, when we started working on it we decided to not support clamping by both, to focus the implementation effort to the simple cases. But maybe at this point it makes sense to reconsider this.

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


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

Received on Wednesday, 2 April 2025 18:43:36 UTC