Skip to content

Commit 9e2a77e

Browse files
authored
[css-mixins-1] Do not allow @mixin rules as nested group rules (#13038)
We currently say that "any at-rule whose body contains style rules" can be nested group rules, which strictly covers `@mixin` as well. However, this obviously doesn't make sense for mixins: the relevant parent comes from the `@apply` rule invoking it, not from the place where the `@mixin` rule is defined.
1 parent 4c9075b commit 9e2a77e

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

css-mixins-1/Overview.bs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -917,6 +917,9 @@ If a [=default value=] and a [=parameter type=] are both provided,
917917
then the default value must parse successfully according to that parameter type’s syntax.
918918
Otherwise, the ''@mixin'' rule is invalid.
919919

920+
A ''@mixin'' rule cannot be a [=nested group rule=];
921+
it is invalid within the body of a [=style rule=].
922+
920923
<h4 id=mixin-preamble>
921924
The Mixin Preamble</h4>
922925

css-nesting-1/Overview.bs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,8 @@ Nesting Other At-Rules {#conditionals}
625625
this specification allows <dfn export>nested group rules</dfn>
626626
inside of [=style rules=]:
627627
any at-rule whose body contains [=style rules=]
628-
can be nested inside of a [=style rule=] as well.
628+
can be nested inside of a [=style rule=] as well,
629+
unless otherwise specified.
629630

630631
When nested in this way,
631632
the contents of a [=nested group rule=]'s block

0 commit comments

Comments
 (0)