CSS Modules: Scope Locals & Extend
:local(.continueButton) {
color: green;
}:export {
continueButton: __buttons_continueButton_djd347adcxz9;
}
.__buttons_continueButton_djd347adcxz9 {
color: green;
}import styles from './buttons.css'
elem.innerHTML = `<button class="${styles.continueButton}">Continue</button>`Composition
.globalButtonStyle {
background: white;
border: 1px solid;
border-radius: 0.25rem;
}
.globalButtonStyle:hover {
box-shadow: 0 0 4px -2px;
}
:local(.continueButton) {
compose-with: globalButtonStyle;
color: green;
}Local-by-default & reuse across files
Building
Development
License
With thanks
Last updated