[csswg-drafts] [css-nesting-1] Ambiguity of specificity when no nesting selector is used (#9069)

keithjgrant has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-nesting-1] Ambiguity of specificity when no nesting selector is used ==
The specification discusses specificity under the section on the nesting selector (`&`):

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

However, it doesn't seem to directly address specificity for nested selectors that have multiple parent selectors but do not use `&`.

```
.foo,
#foo {
  .bar { ... }
}
```

Is the nested selector here also equivalent to `:is(.foo, #foo) .bar`?

The current implementations in both Chrome and Safari seem to interpret it that way ([demo](https://codepen.io/keithjgrant/pen/ZEmrdGm)), and I think this probably makes sense from an implementation standpoint, but it should probably be stated clearly.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/9069 using your GitHub account


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

Received on Friday, 14 July 2023 22:04:04 UTC