half-light icon indicating copy to clipboard operation
half-light copied to clipboard

Scoped open stylable trees

Open lukewarlow opened this issue 1 year ago • 4 comments

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.

lukewarlow avatar Feb 15 '24 00:02 lukewarlow

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

knowler avatar Feb 15 '24 01:02 knowler

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.

lukewarlow avatar Feb 15 '24 01:02 lukewarlow

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

bkardell avatar Feb 15 '24 22:02 bkardell

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

bkardell avatar Feb 26 '24 01:02 bkardell