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

To add a further use case to this - the shadow dom offers encapsulation for styling to ensure no leakage in either direction. However, I'm using css modules to achieve a lesser but sufficient encapsulation of styles[^1] for use with various rendering tools. With `open-styleable`, these same styles would, with only very minor tweaks, work fine in the shadow DOM.

Workarounds for this are not ideal:

1. Use a polyfill - this works, but I'm concerned for its performance and size; even though it's small and appears to work, I'm worried of death by a thousand ~cuts~ polyfills. 
2. Attach stylesheets to the shadow dom - tooling around this is pretty poor at the moment, until import attributes are well supported. Even then, there's a question of the dependency chain from css module composition that would need resolving
3. Rewrite all my styles to use `:part` selectors - extremely far from ideal.

[^1]: No leakage out of the component, and the only leakage in on _extremely_ badly written host selectors, an acceptable risk

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

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

Received on Tuesday, 14 January 2025 10:55:21 UTC