Skip to content

Conversation

cdoublev
Copy link
Collaborator

@cdoublev cdoublev commented Sep 5, 2025

It might not be obvious why property value range productions should be preferred (imo), so taking corner-* shorthands as an example, its current syntax is:

<length-percentage [0,∞]>{1,2} || <corner-shape-value>.

When replaced with <'border-top-left-radius'> || <'corner-top-left-shape'>:

  • readers know immediately that the first value is a radius (and the second is a shape)
  • spec authors will not need to update it if the syntax of corner-*-shape is later updated to eg. <corner-shape-value> | none
  • implementers do not need to look up what the second <length-percentage> value should be when omitted
  • implementers may have to write less code to validate a grammar rule applying on the longhand value, to expand the shorthand value, and serialize a value according to the shortest value principle

Applying this change left the extended definition of <corner-shape-value> at an inappropriate place, below the definition table of corner-shape, while it was no longer used in its syntax.

So I took changes a little further and ended with moving/rewriting corner shaping sections to make all *Corners" sections more consistent, in a separate commit.

I also made an unrelated editorial change. Although experienced CSS authors might intuitevily guess this, I suggest to explicitly defining that corner-shape values are expanded clockwise starting from the top corner, and what their default values when omitted. I preferred to suggest this change in a single PR to avoid merge conflicts.

@cdoublev cdoublev requested a review from noamr September 5, 2025 09:13
Copy link
Collaborator

@noamr noamr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks for this!

@noamr noamr merged commit 5b61925 into w3c:main Sep 5, 2025
1 check passed
@cdoublev cdoublev deleted the pr-12735 branch September 5, 2025 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants