- From: Danny Engelman <notifications@github.com>
- Date: Mon, 17 May 2021 00:54:37 -0700
- To: WICG/webcomponents <webcomponents@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Monday, 17 May 2021 07:54:50 UTC
> Cool. ... you say ``slot > div span`` (inside a shadow root) achieves the same as the hypothetical concept ``::slotted(div) span`` No, I am not. It is not possible. Slotted content is styled by its host **container** (global CSS if you only have 1 one element with shadowDOM) > Can you make a really simple example, not a super complex one? I am not having any luck with it: https://codepen.io/trusktr/pen/e80e9d5d09de7facf22aeee85f6a7549 There is no simple example. Your CodePen has **one** shadowRoot. * The _complex_ **WORKAROUND** I post needs **two** shadowRoots: * #1 to seperate styles from the main DOM (or other container) * #2 for the Web Component itself (to make slots work) * and the original ``innerHTML``/_lightDOM_ needs to be **moved** to shadowRoot #1 (ps: your CodePen is private so can't be forked) <hr> I keep the **::slotted** StackOverflow answer, I posted a year ago, updated with every fact and rumor I read. https://stackoverflow.com/questions/61626493/slotted-css-selector-for-nested-children-in-shadowdom-slot/61631668#61631668 no updates there for months. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/WICG/webcomponents/issues/889#issuecomment-842100610
Received on Monday, 17 May 2021 07:54:50 UTC