Skip to content

CSS :has-slotted support #1356

Open
Open

Description

@jackholden

Description

The :has-slotted CSS pseudo-class matches <slot> elements where the fallback content is not shown. The pseudo-class matches any slotted content, including white space, text nodes, or elements.

For Interop 2027, it would be great to have the :has-slotted selector available across all engines. It has already landed in Firefox. It is being worked on in WebKit (spec clarifications are being sought) and at one point, it was also being worked on in Chromium. Having this cross-engine would remove the need for hacky JS workarounds.

Spec:
https://drafts.csswg.org/css-shadow-1/#the-has-slotted-pseudo

Specification

W3C

web-feature

https://web-platform-dx.github.io/web-features-explorer/features/has-slotted/

Test Links

The below link shows all tests related to has-slotted including the functional psuedo :has-slotted() that as @emilio points out has not yet been implemented by any browser. Purely for visibility. The above tests are the ones related to the Interop 2027 proposal.

Additional Signals

Browser positions

Activity

  1. changed the title [-]:has-slotted support[/-] [+]CSS :has-slotted support[/+] on Sep 3, 2026
  2. github-actions commented on Sep 3, 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 feature (from the web-features project) which is 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.

    Feature :has-slotted

  3. emilio commented on Oct 1, 2026

    @emilio

    The tests links include the functional pseudo-class which was a bit more controversial and nobody implements (at least yet). Is that intentional?

  4. jackholden commented on Oct 1, 2026

    @jackholden
    Author

    @emilio I added it initially purely for showcasing all the :has-slotted tests but I didn't take into account the :has-slotted() tests which aren't part of this proposal. I have amended it above to hopefully make it clearer but also happy to completely remove it :)

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