Use <ident-token> instead of Identifier (#3075)

This commit is contained in:
Rafer45 2021-06-09 19:02:38 -04:00 committed by GitHub
parent 2cb85cb367
commit 9625ee0608
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 20 additions and 10 deletions

View File

@ -17,12 +17,14 @@ The grammar for the `@forward` rule is as follows:
<x><pre>
**ForwardRule** ::= '@forward' QuotedString AsClause? (ShowClause | HideClause)?
**AsClause** ::= 'as' Identifier '*'
**AsClause** ::= 'as' [\<ident-token>][] '*'
**ShowClause** ::= 'show' MemberName (',' MemberName)*
**HideClause** ::= 'hide' MemberName (',' MemberName)*
**MemberName** ::= '$'? Identifier
**MemberName** ::= '$'? [\<ident-token>][]
</pre></x>
[\<ident-token>]: https://drafts.csswg.org/css-syntax-3/#ident-token-diagram
`@forward` rules must be at the top level of the document, and must come before
any rules other than `@charset` or `@use`. The `QuotedString`'s contents, known
as the rule's *URL*, must be a [valid URL string][] (for non-[special][] base

View File

@ -8,9 +8,11 @@
## Syntax
<x><pre>
**FunctionRule** ::= '@function' Identifier ArgumentDeclaration '{' Statements '}'
**FunctionRule** ::= '@function' [\<ident-token>][] ArgumentDeclaration '{' Statements '}'
</pre></x>
[\<ident-token>]: https://drafts.csswg.org/css-syntax-3/#ident-token-diagram
No whitespace is allowed between the `Identifier` and the `ArgumentDeclaration`
in `FunctionRule`.

View File

@ -17,9 +17,11 @@
### Syntax
<x><pre>
**MixinRule** ::= '@mixin' Identifier ArgumentDeclaration? '{' Statements '}'
**MixinRule** ::= '@mixin' [\<ident-token>][] ArgumentDeclaration? '{' Statements '}'
</pre></x>
[\<ident-token>]: https://drafts.csswg.org/css-syntax-3/#ident-token-diagram
No whitespace is allowed between the `Identifier` and the `ArgumentDeclaration`
in `MixinRule`.

View File

@ -29,13 +29,15 @@ The grammar for the `@use` rule is as follows:
<x><pre>
**UseRule** ::= '@use' QuotedString AsClause? WithClause?
**AsClause** ::= 'as' ('\*' | Identifier)
**AsClause** ::= 'as' ('\*' | [\<ident-token>][])
**WithClause** ::= 'with' '('
&#32; KeywordArgument (',' KeywordArgument)\* ','?
&#32; ')'
**KeywordArgument** ::= '$' Identifier ':' Expression
**KeywordArgument** ::= '$' [\<ident-token>][] ':' Expression
</pre></x>
[\<ident-token>]: https://drafts.csswg.org/css-syntax-3/#ident-token-diagram
`@use` rules must be at the top level of the document, and must come before any
rules other than `@charset` or `@forward`. The `QuotedString`'s contents, known
as the rule's *URL*, must be a [valid URL string][] (for non-[special][] base

View File

@ -163,7 +163,7 @@ modules:
<x><pre>
**PublicIdentifier** ::= [\<ident-token>][] that doesn't begin with '-' or '_'
**NamespacedIdentifier** ::= Identifier | Identifier '.' PublicIdentifier
**NamespacedIdentifier** ::= [\<ident-token>][] | [\<ident-token>][] '.' PublicIdentifier
</pre></x>
[\<ident-token>]: https://drafts.csswg.org/css-syntax-3/#ident-token-diagram

View File

@ -99,7 +99,7 @@ No whitespace is allowed between components of an `InterpolatedIdentifier`.
**PseudoSelector** ::= NormalPseudoSelector
&#32; | SelectorPseudo
&#32; | NthSelectorPseudo
**NormalPseudoSelector** ::= ':' ':'? VendorPrefix? Identifier
**NormalPseudoSelector** ::= ':' ':'? VendorPrefix? [\<ident-token>][]
&#32; ('(' [\<declaration-value>] ')')?
**SelectorPseudo** ::= SelectorPseudoName '(' Selector ')'
**NthSelectorPseudo** ::= NthSelectorPseudoName '(' [\<an+b>] 'of'¹ Selector ')'
@ -110,6 +110,7 @@ No whitespace is allowed between components of an `InterpolatedIdentifier`.
[\<declaration-value>]: https://www.w3.org/TR/css-syntax-3/#typedef-declaration-value
[\<an+b>]: https://www.w3.org/TR/css-syntax-3/#the-anb-type
[\<ident-token>]: https://drafts.csswg.org/css-syntax-3/#ident-token-diagram
1: The string `of` is matched case-insensitively. In addition, it must be parsed
as an identifier.

View File

@ -14,11 +14,12 @@
<x><pre>
**Variable** ::= PlainVariable | NamespacedVariable
**PlainVariable** ::= '$' Identifier
**NamespacedVariable** ::= Identifier '.$' [PublicIdentifier][]
**PlainVariable** ::= '$' [\<ident-token>][]
**NamespacedVariable** ::= [\<ident-token>][] '.$' [PublicIdentifier][]
**VariableDeclaration** ::= Variable ':' Expression ('!global' | '!default')*
</pre></x>
[\<ident-token>]: https://drafts.csswg.org/css-syntax-3/#ident-token-diagram
[PublicIdentifier]: modules.md#syntax
No whitespace is allowed after the `$` in `PlainVariable` or before or after