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

runarberg has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-shadow-parts] Can I use ::slotted and ::part together? ==
From my understanding, the [compound selector](https://drafts.csswg.org/selectors-4/#typedef-compound-selector) allows selecting a pseudo element. So I’m wondering if we can select a shadow part of a slotted custom element?

```css
::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:

```css
::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?

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5161 using your GitHub account

Received on Thursday, 4 June 2020 01:10:38 UTC