Skip to content

[css-nesting] Make nesting work in :host rules #9496

Open
@sorvell

Description

@sorvell

When styling elements in Shadow DOM, combinators can be used with the :host selector to select elements in the shadowRoot (e.g. :host > div { ... }). These rules do not currently work with CSS nesting.

It's not clear if this is a bug or omission or intentional (hope not) via the language at https://drafts.csswg.org/css-nesting/#nesting.

Note that the behavior of combinators next to :host is somewhat unique in that the tree traversed is the shadow tree, not the tree in the scope of the host element. This likely(?) means this needs a specific callout in the spec.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions