Skip to content

[css-overflow-4] line-clamp shorthand syntax is ambiguous #12416

Open
@andreubotella

Description

@andreubotella

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-clamp1. 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 3 or line-clamp: none -webkit-legacy might be confusing to developers, especially since setting the block-ellipsis value might be uncommon.

cc @frivoal @emilio @bfgeek

Footnotes

  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.

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