Skip to content

[css-shadow-parts] Can I use ::slotted and ::part together? #5161

@runarberg

Description

@runarberg

From my understanding, the compound selector allows selecting a pseudo element. So I’m wondering if we can select a shadow part of a slotted custom element?

::slotted(my-element::part(my-shadow-part)) {
  /* ... */
}

I’ve tried this in Chrome and Firefox and it doesn’t work. I’ve also tried the selector as if ::part was tree abiding:

::slotted(my-element)::part(my-shadow-part)

And unsurprisingly it didn’t work either.

My question is: Is the former example a bug in the implementation or is the ::part pseudo element not accessible with ::slotted by design?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions