4 ms·
Because a template would define the styles once, but be stamped multiple times, there should be minimal redundant copies of the styles themselves. How this perf
by Zikes 11y ago
Because a template would define the styles once, but be stamped multiple times, there should be minimal redundant copies of the styles themselves. How this performs will remain to be seen, as it would be up to the browsers to implement the spec optimally.
You can "pierce" the shadow DOM with the ">>>" combinator (previously /deep/), allowing you to style elements from outside of the shadow DOM. This is discouraged in the case of web components, however, as a component is supposed to operate as a black box entity. Instead, a component can expose APIs for styling, such as with CSS variables: https://www.polymer-project.org/1.0/docs/devguide/styling.html#xscope-styling-details https://www.polymer-project.org/1.0/docs/devguide/styling.ht...
Edit: This article[1] has details on performance and styling options.
[1] https://hacks.mozilla.org/2015/06/the-state-of-web-components/ https://hacks.mozilla.org/2015/06/the-state-of-web-component...
- arota 11y agoThe last I had read[1], the intention is to deprecate shadow piercing combinators altogether. [1] - https://www.w3.org/wiki/Webapps/WebComponentsApril2015Meeting https://www.w3.org/wiki/Webapps/WebComponentsApril2015Meetin...
- Zikes 11y agoI guess that would make it discouraged in all cases, then.