CSS Nesting 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 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", in the CSS Nesting definition.
CSS Nesting 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 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.
CSS Nesting states the following about the contents of nested group rules:
But CSS Cascade 6 states that style rules in
@scopeare scoped style rules, with their nesting selector taking its definition from it: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", in the CSS Nesting definition.CSS Nesting also states:
While CSS Cascade 6 states:
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.