Re: [WICG/webcomponents] "open-stylable" Shadow Roots (#909)

I wrote [a lengthy blog post](https://nolanlawson.com/2023/12/30/shadow-dom-and-the-problem-of-encapsulation/) on this topic, but I want to surface one thought that came from that post (and which applies to both the original proposal as well as @knowler's above):

_**Who** is opting-in the shadow root to become stylable by its container – the component author or component consumer?_

If it's the component author, then component consumers may still be frustrated, because not 100% of their third-party components are opted-in. In that world, their only recourse is patching the global `Element.prototype.attachShadow` (ala @bkardell's [library](https://github.com/bkardell/shadow-boxing/blob/a0a8f60fe485e52ebb993e0c1e1722e90b164b56/shadow-boxing.js#L91-L99) – thank you for illustrating this Brian!). Which, if you have to globally patch `attachShadow` anyway, then we're pretty close to what you could do with a "polyfill" today.

Whereas if it's the component consumer, then we have to consider component authors who _do not want_ to be opted-in. It would be similar to allowing component consumers to override a component author's choice to run in closed mode rather than open mode.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/WICG/webcomponents/issues/909#issuecomment-1884071922
You are receiving this because you are subscribed to this thread.

Message ID: <WICG/webcomponents/issues/909/1884071922@github.com>

Received on Wednesday, 10 January 2024 02:01:29 UTC