From 615ce3d80c4b431ba6349d6186673d94c49ad48f Mon Sep 17 00:00:00 2001 From: andruud Date: Wed, 29 Oct 2025 15:33:35 +0100 Subject: [PATCH] [css-mixins-1] Do not allow @mixin rules as nested group rules 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. --- css-mixins-1/Overview.bs | 3 +++ css-nesting-1/Overview.bs | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/css-mixins-1/Overview.bs b/css-mixins-1/Overview.bs index b9619bad714..7693a09bacf 100644 --- a/css-mixins-1/Overview.bs +++ b/css-mixins-1/Overview.bs @@ -917,6 +917,9 @@ If a [=default value=] and a [=parameter type=] are both provided, then the default value must parse successfully according to that parameter type’s syntax. Otherwise, the ''@mixin'' rule is invalid. +A ''@mixin'' rule cannot be a [=nested group rule=]; +it is invalid within the body of a [=style rule=]. +

The Mixin Preamble

diff --git a/css-nesting-1/Overview.bs b/css-nesting-1/Overview.bs index 352d99df07c..9c77956bd6b 100644 --- a/css-nesting-1/Overview.bs +++ b/css-nesting-1/Overview.bs @@ -625,7 +625,8 @@ Nesting Other At-Rules {#conditionals} this specification allows nested group rules inside of [=style rules=]: any at-rule whose body contains [=style rules=] - can be nested inside of a [=style rule=] as well. + can be nested inside of a [=style rule=] as well, + unless otherwise specified. When nested in this way, the contents of a [=nested group rule=]'s block