3 ms·
Cool solution. I'm using Lit, and implemented a different approach to this problem. I created a way to easily apply a set of styles to particular components, by
by gitaarik 3y ago
Cool solution. I'm using Lit, and implemented a different approach to this problem. I created a way to easily apply a set of styles to particular components, by using a mixin class:
const myStyles = litStyle(css`h1 { color: red; }`);
class MyComponent extends myStyles(LitElement) { // ..}
You can store the style definition in a separate file and import it and use it for the components that you want it for.
https://github.com/gitaarik/lit-style https://github.com/gitaarik/lit-style