Using Global Styles in Shadow DOM | by EisenbergEffect | Feb, 2024 | Medium
February 29, 2024
One of the most common misunderstandings folks seem to have about Web Components is that they can’t take advantage of global CSS. This is simply not true. With only a few lines of JavaScript you can enable any Web Component to respond to your global CSS. In this article, I’ll show you how to build this into your own components, as well as how to take pre-existing FAST and Lit components and modify them to also respond to global styles. We’ll even see how to accomplish this with Declarative Shadow DOM (DSD).
Source: Using Global Styles in Shadow DOM | by EisenbergEffect | Feb, 2024 | Medium