Re: [csswg-drafts] [css-nesting][selectors] Behavior of & at the root of a stylesheet (#10287)

Currently the spec says that 

> The [specificity](https://drafts.csswg.org/selectors-4/#specificity) of the [nesting selector](https://drafts.csswg.org/css-nesting/#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()](https://drafts.csswg.org/selectors-4/#matches-pseudo)).

As I read the current spec, `&` as the top level selector resolves to the same thing as `:scope` in the same context (i.e. to `:root`) but has the specificity identical to that of `:is()` with the empty selector list (i.e. zero). So behavior of Chrome and Firefox looks intuitive to me and behavior of Safari (presuming it does some implicit conversion/substitution) seems too "magical". However, adding an explicit clarification about that particular case would be great!

-- 
GitHub Notification of comment by SelenIT
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10287#issuecomment-2099231850 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 7 May 2024 20:18:51 UTC