bkardell / half-light

Small library for experimenting with ways to tame Shadow DOM in CSS
Apache License 2.0
39 stars 1 forks source link

Scoped open stylable trees #14

Open lukewarlow opened 4 months ago

lukewarlow commented 4 months ago

While half-light does a great job at handling the use case of sharing page styles with all nested custom elements I think there's a use case that isn't addressed at the minute.

If I'm developing a custom element that embeds into other people's pages I might want to build it using nested custom elements but to include a single style tag in my root element. I don't want this to leak to the rest of the page but I do want all my children to get it.

knowler commented 4 months ago

@lukewarlow would you expect this to apply to all descendants of the shadow root (e.g. children, grandchildren, etc.)? Probably not slotted content though?

lukewarlow commented 4 months ago

Yeah all descendents. At first thought I'd say slotted contents too aside from something slotted in to the root that's sharing? But would need to think a bit harder about if that makes sense.

bkardell commented 4 months ago

I wonder if @sorvell's idea from #12 can help us here?

bkardell commented 4 months ago

whoops, I meant to do that in a pull request O