3 ms·
> Nothing in Web Components is forcing you to use ShadowDOM Yes. There is just one thing forcing someone to use shadowDOM: slots. You can't use slots without s
by brazukadev 1y ago
> Nothing in Web Components is forcing you to use ShadowDOM
Yes. There is just one thing forcing someone to use shadowDOM: slots. You can't use slots without shadowDOM or at least use something like this.children to capture the content inside the <custom-element></custom-element>.
But that is quite the important feature lacking.
- no_wizard 1y agoIn my mind this has always made no sense to me, why slots aren’t independent of the shadow dom. Same thing with how css is handled, especially since we have @layer and @scoped now
- jfagnani 1y agoIt's not possible to make slots work without a separate tree like shadow DOM. The browser can't tell what the container for a slot is vs what content should project into it.