W3C home > Mailing lists > Public > public-css-archive@w3.org > June 2020

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

From: Rúnar Berg Baugsson Sigríðarson via GitHub <sysbot+gh@w3.org>
Date: Thu, 04 Jun 2020 01:10:37 +0000
To: public-css-archive@w3.org
Message-ID: <issues.opened-630433658-1591233035-sysbot+gh@w3.org>
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

This archive was generated by hypermail 2.4.0 : Tuesday, 19 October 2021 01:31:27 UTC