Re: [WICG/webcomponents] [open-stylable] Collection of user stories (Issue #1052)

Filtering as a [potentially key requirement](https://github.com/WICG/webcomponents/issues/909#issuecomment-1998319218):

> To me, the key open question that needs to be answered is whether selective adoption of document-level stylesheets is necessary or not. That is, should a component or users of the component need to be able to filter (i.e. selectively apply) which stylesheet or style rules apply to its shadow tree.

answering yes, filtering needed, with [related essential requirements](https://github.com/WICG/webcomponents/issues/909#issuecomment-2000272076):

**Use cases are intertwined.**

Whether simple (I just want my page resets to work in my shadow tree) or most painful (component and context are controlled by different entities) or in between, use cases trace to the same shadow encapsulation, and loosening encapsulation will likely impact many if not all in some way.

**Declarative shadow DOM is required.**

To me, declarative shadow DOM is required from the onset not just because it is a new thing so logically it must be supported too, but because shadow trees are just HTML and they are what are doing the encapsulating to loosen. And they are a part of the solution.

So Javascript-only solutions are basically out. And polyfillability though not a strict requirement is in this case something of an acid test for completeness.

But also declarative shadow trees already by design address opt-in for imperatively-created web components.

**Context-aware opt-in protection is needed.**

I don't think an opt-in flag or mode that just brings in all page styles would work as expected in all cases. Some shadow styles could unexpectedly lose. Or get pulled back into a specificity race that could feel like shadow trees just gave up.

**Prioritization is required.**

Or maybe just unavoidable, since unlayered styles are of necessity assigned a layer priority. And a limited form of priority for shadow trees already exists in the context step, so any brought-in styles would pass through that step too.



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

Message ID: <WICG/webcomponents/issues/1052/2005261539@github.com>

Received on Monday, 18 March 2024 23:13:25 UTC