Skip to content

[css-overflow-4] Clarify canonical order of *-line-clamp longhands #8742

@cdoublev

Description

@cdoublev

Is it max-lines, block-ellipsis, continue? Or max-lines, continue, block-ellipsis?

https://drafts.csswg.org/css-overflow-4/#propdef-line-clamp
https://drafts.csswg.org/css-overflow-4/#propdef--webkit-line-clamp

  • Name: line-clamp
  • Value: none | <integer [1,∞]> <'block-ellipsis'>?
  • Canonical order: per grammar
  • [...]

The line-clamp property is a shorthand for the max-lines, block-ellipsis, and continue properties.

  • Name: -webkit-line-clamp
  • Value: none | <integer [1,∞]>
  • Canonical order: per grammar
  • [...]

Like line-clamp, -webkit-line-clamp is a shorthand of max-lines, continue, and block-ellipsis [...]

I would assume max-lines, block-ellipsis, continue, because the grammar of line-clamp takes an explicit value for max-lines then for <block-ellipsis>, and the grammar of -webkit-line-clamp only takes an explicit max-lines value.

Would you accept a PR with the following clarification(s) in the definition of -webkit-line-clamp?

- Like 'line-clamp', '-webkit-line-clamp' is a shorthand of 'max-lines', 'continue', and 'block-ellipsis',
+ Like 'line-clamp', '-webkit-line-clamp' is a shorthand of 'max-lines', 'block-ellipsis', and 'continue',
  except that:

    * its syntax is ''line-clamp/none'' | <<integer [1,∞]>>
-   * it sets 'continue' to ''-webkit-discard'' instead of ''discard''
    * it unconditionally sets 'block-ellipsis' to ''block-ellipsis/auto''
+   * it sets 'continue' to ''-webkit-discard'' instead of ''discard''
+     when an `<<integer [1,∞]>>` is specified

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