Skip to content

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

Open
@keithjgrant

Description

@keithjgrant

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions