Post

Oh this is maybe fun - a pure CSS way of hiding a “slot” of children if there are any children in that slot that aren’t allowed. For example, a Button Group component that only allows Buttons as children; otherwise the slot is display:none’d Maybe I’ll write a tiny thing about this.

0 reposts3 likes

I have a codepen up already, but nothing written yet Only works in regular dom, but should work in shadow dom with :has-slotted (Which is why I was thinking about it, since I’m trying to get a WebKit PR up for that)