1

I haven't found any information on memory consumption when placing CSS style in Shadow DOM.

What if I have a thousand instances of a particular web component on a page (each with style via shadow root); would that embedded style take up a 999 times as much memory as doing the same styling via an external style sheet?

Lonnie Best
  • 9,936
  • 10
  • 57
  • 97
  • @Supersharp : Ok, so in summary, it would indeed consume 999 times as much memory as doing the same styling via an external style sheet? This is a bit tricky. On one hand, I know that even with an external style sheet the styles must be applied to each element, but I'm not sure if styling in the Shadow DOM would necessarily consume more memory after instantiation. It seems possible that a browser implementation could store the styling at a static class-level instead of on each instance, but in practice I have no experience comparing the memory footprint of each methodology. – Lonnie Best Nov 15 '18 at 17:37
  • 1
    The inline ` – Supersharp Nov 15 '18 at 20:47

0 Answers0