3 ms·
I'd never thought of this but you're totally correct. The only way to encapsulate styles within a shadow dom is to create that style tag (or use the CSSOM to ge
by danielvaughn 3y ago
I'd never thought of this but you're totally correct. The only way to encapsulate styles within a shadow dom is to create that style tag (or use the CSSOM to generate a CSSStyleSheet), but either way it's the same outcome. The styles themselves are copied to each individual instance. Yuck.
- niutech 3y agoYou can use the same <link rel="stylesheet" href="..."> in Shadow DOM, which is cached by web browser.