[w3c/webcomponents] idea: Allow light DOM to delegate styles/behavior to shadow DOM (#883)

I have an idea that is tangentially related to the "allow complex selectors in ::slotted: and related issues (as referenced in #745, #881 and some others), but I felt the concept was different enough to warrant its own post (if the community disagrees, I'm happy to delete this issue and move it to one of those other threads). 

I would like an API that is an inversion of the `::part` API (I don't have a good name for it right now), but one where slotted content (even if it is nested within a DOM structure) could defer its styling to the shadow root's styles (like a dialog styling certain buttons to look a specific way but keeping them visible to the light DOM for integration testing, removal, etc.).

This same API could potentially be used to allow custom elements to control the behaviors attached to certain slotted elements (again, a dialog might be able to say a slotted button with a certain attribute might act as a close button).

This is different from previous proposals in that all content within the light DOM isn't available to the shadow root, but only those elements the light DOM author chooses to defer to the 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/883

Received on Monday, 22 June 2020 15:02:06 UTC