Re: [csswg-drafts] [css-scoping] Allow elements to expose a subset of their shadow tree, which can then be styled with regular CSS (#10939)

The discussion at the WHATWG-CSSWG meeting today around https://github.com/w3c/csswg-drafts/issues/12163 reminded me of this.
If something like this were to go forwards, how does it translate to DOM elements? Since once these are regular elements that can be targeted with combinators, once can also get them via `querySelector()`. Presumably this is less of an issue for open shadow roots and `slotted`, since there are other ways to get these references already, but not sure how it should work for closed shadow roots. Perhaps a way forwards is to simply not support this at all for referencing inside closed shadow roots. That gives the existing pseudo-elements a distinct purpose rather than them just being baggage, though having a nice way for natives to expose what they want from their shadow trees without creating dozens of pseudo-elements was a distinct use case for this. 🤔 

-- 
GitHub Notification of comment by LeaVerou
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10939#issuecomment-3164971211 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 7 August 2025 16:41:07 UTC