[csswg-drafts] [css-conditional][css-overflow] Container features for line-clamped containers? (#12506)

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

== [css-conditional][css-overflow] Container features for line-clamped containers? ==
Without a way to visually indicate that a container's displayed content has been clamped, [`line-clamp`](https://drafts.csswg.org/css-overflow-4/#line-clamp) is of limited utility. Authors typically want to indicate this, using UI elements such as a gradient fade out, ellipsis ("…"), a "show more" button, etc.

Perhaps we could introduce a container feature (e.g. `line-clamped` or just `clamped`) modeled after [scroll state container features](https://drafts.csswg.org/css-conditional-5/#scroll-state-container). Then, authors can use it to toggle display of such elements (or pseudo-elements).

One unfortunate side effect of using container queries is that it's not possible to style the element itself (e.g. apply a gradient), but I'm not sure how else to do this without introducing cycles.

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


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

Received on Sunday, 20 July 2025 23:16:57 UTC