Skip to content

:has(...) pseudo-class use with :host #791

Closed

Description

@Westbrook

Description

The :host selector on a shadow root is handicapped in many browsers by not being allowed to relate to the :has(...) pseudo-class in any way. This prevents the use of:

:host(:has(.el)) {
   /* ... */
}

Which would select the :host when there is an element with a classname of el in the light DOM tree of the :host.

And, it prevents the use of:

:host:has(.el) {
   /* ... */
}

Which would select the :host when there is an element with a classname of el in the shadow DOM tree of the :host.

Building off of the proposal to include this selector in previous interop calendars, it is time to support browsers in bringing this selector to life.

Specification

https://drafts.csswg.org/css-scoping/?utm_source=recordnotfound.com#host-selector

Additional Signals

WPTs
Chrome bug

Activity

  1. wpt-interop commented on Feb 13, 2025

    @wpt-interop
    Collaborator

    Thank you for proposing :has(...) pseudo-class use with :host for inclusion in Interop 2025.

    We wanted to let you know that this proposal was not selected to be part of Interop this year.

    On behalf of the entire Interop team, thank you for submitting this proposal for consideration. We got many more proposals than we could include in this year's project, necessitating some difficult choices. Please note this should not be taken as a comment on the technology as a whole, or our willingness to consider it for Interop in the future. We appreciate the work you put into your proposal, and would welcome your participation in future rounds of Interop.

    For an overview of our process, see proposal selection. Thank you again for contributing to Interop 2025.

    Posted on behalf of the Interop team.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    focus-area-proposal

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions