from './button.css'; buttonElm.outerHTML = `<button class="${styles.primary}">Submit</button>"`; components/button.js .normal { /* all styles for Normal */ } .primary { /* all styles for Primary */ } components/button.css
all styles for Base */ } .normal { composes: base; /* all styles for Normal */ } .primary { composes: base; /* all styles for Primary */ } components/button.css
.base { /* all styles for Base */ } .primary { composes: base; composes: primary-color from "../settings/colors.css"; /* all styles for Primary */ } components/button.css