Re: [w3c/webcomponents] Theming options for shadow roots (#864)

I think lexical names, while useful (the linked proposal is from me), is quite a large lift for this feature. We have existing cross-scope features that rely on string names, like CSS variables. It seems to me like we can do something opt-in with names and support lexical names if and when that ability comes to CSS.

`::theme` previously had been proposed as a new selector that matched elements with part attributes. `::theme` was somewhat opt-in in that an element ahd to mark some of its shadow elements as parts for them to be themable, but in the sense that a part attribute didn't necessary opt a grandparent scope into having a styleable part, `::theme` wasn't opt-in.

One change discussed was just using a separate attribute, like `theme`. The idea being that while `part` shouldn't opt-in to deep theming because it's main intent is to expose a part to the direct containing scope, a `theme` attribute could be an explicit opt-in to that behavior. Of course the ancestor scopes still haven't opted into deep styling, so the questions become about that. Can theming be _opt-out_ for containing scopes? Shadow roots with themable parts specify those, and they're by default themable from anywhere above in the tree, but containing scopes could have a way to block theming - maybe an option to `attachShadow`?

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

Received on Tuesday, 28 January 2020 03:14:02 UTC