Skip to content

[css-conditional][css-overflow] Container features for line-clamped containers? #12506

@LeaVerou

Description

@LeaVerou

Without a way to visually indicate that a container's displayed content has been clamped, 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. 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions