-
Notifications
You must be signed in to change notification settings - Fork 756
Description
In Cascade 5:
Such empty
@layerrules are allowed before@importand@namespacerules
Therefore there is probably an oversight in CSS Namespaces 3:
Any
@namespacerules must follow all@charsetand@importrules and precede all other non-ignored at-rules and style rules
For @import:
Any
@importrules must precede all other valid at-rules and style rules in a style sheet (ignoring@charsetand@layerstatement rules)
I would suggest:
- Any @namespace rules must follow all @charset and @import rules
- and precede all other non-ignored at-rules and style rules
+ Any @namespace rules must precede all other non-ignored rules (ignoring @layer statement rules),
+ and must not have any other non-ignored rules between it and previous @import or @namespace rulesAside: the first line confused me because it suggests that @namespace must be invalid when it does not follow @charset and @import rules, whereas it must remains valid, like any following @charset, only following @import are invalid.
I think the requirements should focus on what makes @namespace invalid, instead of what makes other rules invalid.
I am not sure the following table is appropriate, but a visual summary of the required hierarchy between these rules may be helpful to authors. At least, it is a good memo to me.
| Rule 1 | Rule 2 | Rule 3 | Invalid |
|---|---|---|---|
@layer |
@import |
@layer |
none |
@layer |
@namespace |
@layer |
none |
@layer |
@import |
@namespace |
none |
@import |
@namespace |
@layer |
none |
@import |
@layer |
@import |
@import: it must not follow @layer following @import |
@import |
@layer |
@namespace |
@namespace: it must not follow @layer following @import |
@namespace |
@layer |
@namespace |
@namespace: it must not follow @layer following @namespace |
@namespace |
@layer |
@import |
@import: it must not follow @namespace |
@namespace |
@import |
@layer |
@import: it must not follow @namespace |