Skip to content

[css-values] Grammar syntax for defining excluded idents for <custom-ident> productions #11924

Open
@weinig

Description

@weinig

As part of an ongoing effort to generate the parsing and serialization of CSS values from the grammars in specs, another missing piece of information is the prose defined "excluded values" for <custom-ident> productions.

To give some concrete examples, lets take a look at the grammar for the view-transition-class property:

none | <custom-ident>+

In prose below the grammar is the text "none is an invalid for view-transition-class, even when combined with another ."

If instead, that information was available in a machine readable way, parsing and testing would be directly implementable.

I don't have strong opinions on the specifics of a syntax extension, so as a strawman I propose <custom-ident excluding=foo,bar,baz>

For the example above, this might look like:

none | <custom-ident excluding=none>+

Additional properties this would be beneficial for are:

CSS Conditional Rules Module Level 5: <'container-name'> excludes "none", "and", "or", and "not".
CSS Lists and Counters Module Level 3: <counter-name> excludes "none".
CSS Will Change Module Level 1: <animateable-feature> excludes "will-change", "none", "all", "auto", "scroll-position", and "contents".
CSS Color Adjustment Module Level 1: <'color-scheme'> excludes "normal", "light", "dark", and "only".

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