Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
cdoublev opened this issue Apr 20, 2023 · 1 comment
Closed

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

cdoublev opened this issue Apr 20, 2023 · 1 comment

Comments

@cdoublev
Copy link
Collaborator

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 | <'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 |
  • 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 , 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'' | <>
-   * 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 `<>` is specified
frivoal added a commit that referenced this issue Jun 6, 2025
Adjust the order of the text to match the order of the grammar, in order
to avoid suggesting a different ordering.

See #8742
@frivoal
Copy link
Collaborator

frivoal commented Jun 6, 2025

Sorry for not catching this earlier. I don't think the order of the prose text is usually taken as a strong indicator or the canonical order, but just to be on the safe side, I agree with your suggestion. Just applied it to the spec (slightly tweaked, to take into account other recent changes).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants