Skip to content
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

[css-properties-values-api] Allow <syntax> production in syntax descriptor #11426

Open
andruud opened this issue Jan 2, 2025 · 1 comment
Open

Comments

@andruud
Copy link
Member

andruud commented Jan 2, 2025

You currently need to specify the custom property type as a string, e.g. syntax: "<length> | auto", but now that <syntax> exists, it would be nice to just do syntax: <length> | auto.

We'd still allow string-wrapped types for legacy reasons, making the grammar syntax: <syntax> | <string>.

Note that <syntax> is wrapped in type() in some other cases:

  • In attr(), the <syntax> part must always be wrapped in type().
  • In @function, the <syntax> part may appear unwrapped when it's a single <syntax-component>, otherwise it must be wrapped in type().

However, I think such a wrapper would be redundant for the syntax descriptor (e.g. syntax: type(<length> | auto);), so I suggest that we just stick to the bare/unwrapped <syntax>.

@bramus
Copy link
Contributor

bramus commented Jan 2, 2025

This has tripped me up before, so I’d definitely like to see this :)

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