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

I think the use cases here boil down to 3 main buckets, all of which would be useful to support:
1. look right in context: a shadow root wants to style some important parts but wants to apply base/default page styles so that it looks right in the page context. This would likely be for things that would often be in a reset or base (by design low specificity) stylesheet.
2. no opinion about styling: a shadow root exists for DOM isolation and composition and doesn't care about styling at all and therefore wants to allow page styles to be applied.
3. theming: a shadow root needs/wants more customization than is currently possible via `::part()` and wants to allow sheets to be applied for theming.

The initial proposal to simply apply document styles en masse to a shadow root via some opt-in switch supports these use cases. As many have mentioned above, greater control over *how* page styles apply would make the results more predictable:
* expose the cascade order of the document styles so a component could apply styling before and/or after them. This could possibly be done leveraging `@layer`
* selective application of document sheets to shadow roots via some filtering mechanism
* selective application of document sheet rules to shadow roots

@bkardell has explored these possibilities in  [half-light](https://github.com/bkardell/half-light).

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

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

Received on Friday, 8 March 2024 01:30:05 UTC