A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/w3c/csswg-drafts/issues/9069 below:

[css-nesting-1] Ambiguity of specificity when no nesting selector is used · Issue #9069 · w3c/csswg-drafts · GitHub

The specification discusses specificity under the section on the nesting selector (&):

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()).

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? (or, in other words, is a leading & implicit in this example?)

The current implementations in both Chrome and Safari seem to interpret it that way (demo), and I think this probably makes sense from an implementation standpoint, but I'm having trouble finding something concrete in the spec that states this one way or the other.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.3