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

I have some concerns regarding `::theme`.

How is it supposed to work with host elements? As an example, how should `<vaadin-button>` allow itself to be themed? Does it need to add a `part` attribute on itself in `connectedCallback` if not already specified by the user? How else could `::theme()` target all `<vaadin-button>` elements in all style scopes?

If a part attribute is required on the host, then I suppose it’s not possible to style all native elements across all style scopes without them having an explicit part attribute. I suppose that’s the expected behavior, that as a component author I can guarantee that no one can affect the styles of my component unintentionally.

I haven’t come to a conclusion with my thoughts whether themable elements should always be exposed in the light DOM so they would participate in global styling without any additional platform capabilities. Somehow it feels like shadow DOM should reserved for internal implementation details, and the component author doesn’t want you to mess with those. `::part` is an escape hatch of sorts, and that might be sufficient if there’s a relatively easy way to attach/adopt style sheets to any shadow root.

-- 
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-579134906

Received on Tuesday, 28 January 2020 08:31:23 UTC