How to use global css styles in shadow dom

Jiubao picture Jiubao · Feb 29, 2016 · Viewed 11.9k times · Source

Shadow dom encapsulate css styles, selectors don't cross the shadow boundary.

Question: How to use global common css styles in shadow dom?
(suppose there are some common css styles which will be used across all pages (e.g.: font-family, h1, h2, clear, reset ...), how to make it works in shadow dom?)

Answer

MarcG picture MarcG · Mar 7, 2016

Some solutions:

Please note, one of the articles listed above was also pointed out by Amid. By the time that article was written, Chrome had no CSS variables. But now it already works natively with the recently launched Google Chrome 49.