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

> @justinfagnani Thank you for the added context, that is very helpful. It makes sense that theming use-cases should be separate from the other open-styleable use-cases. Still, I think of open-styleable as a general solution that _should_ tackle a broad range of problems. That's why I suggested expanding your initial open-styleable proposal with `@sheet` in [#909 (comment)](https://github.com/WICG/webcomponents/issues/909#issuecomment-2042059261).

The problem with `@sheet` is that it doesn't necessarily work with existing pages and stylesheets. The problem I'm trying to address is migrating to web components within existing contexts.

> It's also worth noting that open-styleable is not the endgame. After introducing open-styleable, we can still have new APIs that are more tailored to specific use-cases.

I would say that Open Styeable isn't even the opening. it's just different from theming. Even though I consider the Open Styleable use case to be one of the top blockers for wider web components adoption, I wouldn't want to block theming on it. To me they're mostly orthogonal.

> If we're exploring mixins and functions as a way to solve theming, shouldn't we wait before discussing any new shadow-specific theming APIs (`::theme()` or otherwise)?

Wait for what specifically? I wouldn't want to wait until mixins and functions are set in stone in case there are changes to their proposal that would make them more suitable for this use case.

> I'm also glad you said "we'll need mixins and functions to work across shadow DOM boundaries", because that's a great example of a modern feature that would work well with open-styleable. You can imagine shadow-roots opting into a page stylesheet that contains theming-relevant mixins and functions. Mixins and functions don't cascade (unlike custom properties), so this feels like the natural way to include them across shadow boundaries.

Mixins and functions don't cascade in the current proposal, but I think the inability to forward a mixin or function definition into a shadow root to be a pretty major limitation. Importing a page-level stylesheet is a pretty severe form of encapsulation breaking for the many component authors for whom encapsulation is important.

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

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

Received on Wednesday, 4 September 2024 22:40:18 UTC