Re: [w3c/webcomponents] CSS encapsulation and common CSS rules (#800)

I believe you should be able to link to an external style sheet from within the Shadow DOM.

I've been wanting something similar [since 2005](http://lists.w3.org/Archives/Public/www-html/2005Jul/0043.html).

Just because the style sheet is external, doesn't mean its rules must apply to anything outside of the shadow dom that contains that link.

I have some custom elements that recur on the page one hundred times. It seem wasteful, upon inspecting the document's shadow dom nodes, that each of those shadow dom nodes contains an identical copy of a pretty lengthy set of CSS rules within each shadowDom's style tag.

Wouldn't it be more efficient if each shadow dom could linked to an external style sheet instead? The browser would cache that external resource after the first download of it, and use that cache for each recurring element's link to the same sheet.

I realize, that no matter where a style comes from, the browser still has to apply that style just as much, and it could be, that behind the scenes the browser is doing something way more efficient that what appear so redundant during document inspection. Yet, on the surface it appears excessively redundant and I've been wanting the ability to link to external style sheets from within components [for a long time now](http://lists.w3.org/Archives/Public/www-html/2005Jul/0043.html).

-- 
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/800#issuecomment-511209877

Received on Sunday, 14 July 2019 15:00:37 UTC