2 ms·
There's a strong difference between styles and themes. Theming is quite easy with web components, as long as you have a semantic layer to your design tokens. Si
by jjcm 3y ago
There's a strong difference between styles and themes. Theming is quite easy with web components, as long as you have a semantic layer to your design tokens. Since custom properties do cascade, it's quite easy to automatically switch themes while still preventing css-selector clobber issues with styles.
If you're curious on this approach, my site non.io has light/dark theming via this method, and Figma's light/dark mode was loosely based on this approach.