Skip to content

Commit 39338c5

Browse files
committed
[css-cascade-5] Disallow empty @layer interspersed with @import or @namespace, #6522
1 parent 2505b96 commit 39338c5

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

css-cascade-5/Overview.bs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,9 @@ Importing Style Sheets: the ''@import'' rule
123123
as if they were written literally into the stylesheet at the point of the ''@import''.
124124

125125
Any ''@import'' rules must precede all other valid at-rules and style rules in a style sheet
126-
(ignoring ''@charset'' and empty ''@layer'' definitions), or else the ''@import'' rule is invalid.
126+
(ignoring ''@charset'' and empty ''@layer'' definitions),
127+
and must not have any other valid at-rules or style rules between it and previous ''@import'' rules,
128+
or else the ''@import'' rule is invalid.
127129
The syntax of ''@import'' is:
128130

129131
@@ -1392,7 +1394,7 @@ Anonymous Layers
13921394

13931395
* Multiple unnamed layer rules
13941396
place their styles into separate layers,
1395-
as each occurence is referencing a distinct anonymous layer name.
1397+
as each occurrence is referencing a distinct anonymous layer name.
13961398

13971399
13981400
@layer { /* layer 1 */ }
@@ -1610,8 +1612,9 @@ Declaring Without Styles: the ''@layer'' statement at-rule
16101612
@layer <>#;
16111613
16121614

1613-
Such empty ''@layer'' rules are allowed
1614-
anywhere either ''@import'' or other ''@layer'' rules are allowed.
1615+
Such empty ''@layer'' rules are allowed before and after ''@import'' and ''@namespace'' rules,
1616+
but are not allowed between (or intermixed with) ''@import'' and ''@namespace'' rules,
1617+
and may not precede any ''@charset'' rule.
16151618

16161619
Unlike the [[#layer-block|block syntax]],
16171620
multiple comma-separated layer names can be provided in this syntax,

0 commit comments

Comments
 (0)