- From: Guillaume via GitHub <noreply@w3.org>
- Date: Wed, 18 Feb 2026 17:34:13 +0000
- To: public-css-archive@w3.org
cdoublev has just created a new issue for https://github.com/w3c/csswg-drafts: == [css-nesting-1][css-cascade-6] Conflicting definitions of nested/scoped style rules and the nesting selector == [CSS Nesting](https://drafts.csswg.org/css-nesting-1/#conditionals) states the following about the contents of nested group rules: > - Style rules are nested style rules, with their nesting selector taking its definition from the nearest ancestor style rule. But [CSS Cascade 6](https://drafts.csswg.org/css-cascade-6/#scope-effects) states that style rules in `@scope` are scoped style rules, with their nesting selector taking its definition from it: > - The style rules in an `@scope` `<rule-list>` are scoped style rules. > - The `&` selector is defined to behave as `:where(:scope)`. I think that *nested style rule* and *scoped style rule* are exclusive, since a scoped style rule may not have an ancestor style rule. I think it may be appropriate to append *"unless the nested group rule is `@scope`, in which case it is a [scoped style rule](https://drafts.csswg.org/css-cascade-6/#scoped-style-rules)"*, in the CSS Nesting definition. [CSS Nesting](https://drafts.csswg.org/css-nesting-1/#nesting-at-scope) also states: > When the `@scope` rule is a nested group rule, an `&` in the `<scope-start>` selector refers to the elements matched by the nearest ancestor style rule. While [CSS Cascade 6](https://drafts.csswg.org/css-cascade-6/#scope-limits) states: > Any `:scope` or `&` selectors in `<scope-start>` are interpreted as defined for its outer context. And if the closest outer context is `@scope`, then it is defined by CSS Cascade 6 as `:where(:scope)` (see the first quote above), instead of _the elements matched by the nearest ancestor style rule_. I think it may be appropriate to append *"unless there is a closer `@scope`, in which case it behaves like `:where(:scope)`"*, in the CSS Nesting definition, as stated in its non-normative note. Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/13517 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Wednesday, 18 February 2026 17:34:14 UTC