0

This question and this one are related.

In that second question, they recommend using link to link the same stylesheet from the same location, but there can also be global <style> elements inside the <head>. What's the best way to distribute those?

My first guess is that I have to copy their textContent into a new <style> element inside of the roots, but that seems like a hack.

What's the best way?

Community
  • 1
  • 1
trusktr
  • 44,284
  • 53
  • 191
  • 263
  • 2
    This question is either too broad, **opinion based** or requires discussion and so is off-topic for Stack Overflow. If you have a specific, answerable, programming issue, please provide full details. – Paulie_D Nov 19 '16 at 16:59
  • 2
    Maybe, you can ask about ways to achieve what you need, instead of asking for the best way? For example http://stackoverflow.com/questions/40973471/how-to-apply-common-css-styles-to-many-shadow-roots-at-once With given measurable constraint and question, users could provide and up-vote solutions. – tomalec Dec 05 '16 at 11:42
  • Thanks, I'll do that. – trusktr Dec 09 '16 at 22:52
  • 1
    Possible duplicate of [Share CSS styles across web components](http://stackoverflow.com/questions/29181739/share-css-styles-across-web-components) – Paul Sweatte May 04 '17 at 21:29

0 Answers0