Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Westbrook opened this issue Oct 7, 2024 · 0 comments
Open

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

Westbrook opened this issue Oct 7, 2024 · 0 comments
Labels
focus-area-proposal Focus Area Proposal

Comments

@Westbrook
Copy link

Westbrook commented Oct 7, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
focus-area-proposal Focus Area Proposal
Projects
Status: No status
Development

No branches or pull requests

1 participant