You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Such empty @layer rules are allowed before @import and @namespace rules
Aside: I think that enumerating at-rules and style rules may not seem necessary and may be simplified to rules.
Any @import rules must precede all other valid rules (ignoring @charset and @layer statement rules) and must not have any other valid rules (ignoring @charset and @layer statement rules) between it and previous @import rules, or else the @import rule is invalid.
The text was updated successfully, but these errors were encountered:
I found #6522. Based on its resolution, interleaving @layer statement between @imports, or interleaving @import between @layer statements, must be invalid. The current prose and Example 31 seem confusing then.
It’s also possible to have @import rules help establish the order, by placing them between @layer rules. This example will have the same result:
And it seems to also apply to interleaving @layer between @namespace statements, or vice-versa, as explained in this non-normative note:
Note: Any @layer rule that comes after an @import or @namespace rule will cause any subsequent @import or @namespace rules to be ignored.
Actually, this means you can declare @layer, @import, @namespace, in this order, but not @import, @layer, @namespace. I am confused.
Aside (another simplification suggestion):
Such empty @layer are allowed before @import and @namespace rules (after the @charset rule, if any) as well as everywhere @layer block at-rules are allowed.
@charset is always ignored by the parser, according to CSS Syntax 3, therefore I think removing "(after the @charset rule, if any)" would avoid any confusion about @layer statement preceding @charset (valid, if I am not mistaken).
Requirements are quite fragmented and seem to lack specifics on their motivations, which makes them even more difficult to grasp, but after re-reading, there do not seem to me to be any contradictions (at least in CSS Cascade 5).
According to 2. Importing Style Sheets: the
@import
rule,@import
can precede@layer
statement.But it is not clear if it can be preceded by
@layer
statement (emphasize added):What are these other valid at-rules or style rules? Do they include
@charset
and@layer
statements?I guess
@import
can now be preceded by@layer
based on 6.4.4.2. Declaring Without Styles: the@layer
statement at-rule:Aside: I think that enumerating at-rules and style rules may not seem necessary and may be simplified to rules.
The text was updated successfully, but these errors were encountered: