Skip to content

:host(:has(...)) support #1395

Open
Open

Description

@jackholden

Description

This was proposed back in 2023 and 2025 by @Westbrook. It is currently implemented in both Firefox and Safari. Only Chromium browsers remain.

:host(:has()) selector combination, allows authors to select the host element if it has a descendent in the light DOM matching a provided relative selector list.

This would be extremely beneficial.

The implementation status in Chromium is currently marked as: Development work is on hold

Specification

W3C

web-feature

No response

Test Links

https://wpt.fyi/results/css/css-shadow?label=master&label=experimental&aligned&q=host-has

Additional Signals

#791 (2025)
#208 (2023)

https://drafts.csswg.org/css-shadow-1/#host-selector
https://drafts.csswg.org/selectors-4/#relational

https://issues.chromium.org/issues/40062355
w3c/csswg-drafts#11859

Activity

  1. github-actions commented on Sep 14, 2026

    @github-actions

    This comment was automatically generated based on the information you provided. Please don't edit it.

    Below is additional information about the web features (from the web-features project) which are referenced in your proposal.
    If this doesn't accurately correspond to your proposal, please update your initial comment to include web-features: <feature-id>.
    To find feature IDs, use the web-features explorer.

    Host

    Feature Host

    :host-context()

    Feature :host-context()

    • ID: host-context
    • Name: :host-context()
    • Description: The :host-context() CSS pseudo-class selects the containing element of the shadow tree in which it is used if that element or an ancestor matches the provided selector.
    • Baseline status: Limited Availability
    • Docs: :host-context() CSS pseudo-class
    • WPT tests: wpt.fyi results
    • More information: See the web-features explorer
    :has()

    Feature :has()

    Selectors (core)

    Feature Selectors (core)

    • ID: selectors
    • Name: Selectors (core)
    • Description: CSS selectors match elements based on their type, attributes, and relationship to other elements. They define the specific elements to which a block of styles will be applied. This feature represents the oldest selectors of CSS.
    • Baseline status: Widely Available
    • Docs: CSS selectors
    • WPT tests: wpt.fyi results
    • More information: See the web-features explorer
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