Skip to content

[css-mixins-1][css-extensions-1] Improve grammars of at-rule preludes #13167

@cdoublev

Description

@cdoublev

Would it be possible to add contextual productions for the value definitions of the prelude of @function, @mixin, @env, @custom-media, @custom-selector?

For example:

- <@function> = @function <function-token> <function-parameter>#? )
-   [ returns <css-type> ]?
- {
-   <declaration-rule-list>
- }
+ <@function> = @function <custom-function-definition> { <declaration-rule-list > }
+ <custom-function-definition> = <function-token> <function-parameter>#? ) [ returns <css-type> ]?

The main reason is simply convenience in implementing declarative grammar validation (eg. an invalid @function parameter type).

I think this can also help to clarify them and to understand the terminology defined in prose.

Similarly, would it be possible to add a production for the value definition of a custom selector name?

- <custom-selector> = <custom-arg>? : <extension-name> [ ( <custom-arg>+#? ) ]?
+ <custom-selector> = <custom-arg>? <custom-selector-name> [ ( <custom-arg>+#? ) ]?
+ <custom-selector-name> = : <extension-name>

Happy to submit these changes is that sounds good to the editors of the related specs.

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