You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When used in any other context, [&] represents the same elements as :scope in that context (unless otherwise defined).
The nesting selector can be desugared by replacing it with the parent style rule’s selector, wrapped in an :is() selector.
This means that & {} can be desugared into :is(:scope) {} or :scope {}.
The specificity of the nesting selector is equal to the largest specificity among the complex selectors in the parent style rule’s selector list (identical to the behavior of :is()), or zero if no such selector list exists.
:is(:scope) {} or :scope {} would have specificity (0,1,0), but & {} is explicitly defined as having a specificity of (0,0,0) because there is no parent style rule’s selector list.
Since there is a collapsed explanation for the equivalency with :is() but there is no reasoning provided for this difference, is this truly intentional?
The text was updated successfully, but these errors were encountered:
https://drafts.csswg.org/css-nesting/#nest-selector
https://drafts.csswg.org/selectors/#specificity
This means that
& {}
can be desugared into:is(:scope) {}
or:scope {}
.:is(:scope) {}
or:scope {}
would have specificity (0,1,0), but& {}
is explicitly defined as having a specificity of (0,0,0) because there is no parent style rule’s selector list.Since there is a collapsed explanation for the equivalency with
:is()
but there is no reasoning provided for this difference, is this truly intentional?The text was updated successfully, but these errors were encountered: