I'm busy learning React with CSS-Modules and I don't quite understand how one would store variables? For example, in Sass you're able to do this:
// _variables.scss
$primary-color: #f1f1f1;
// heading.scss
@import './variables';
.heading {
color: $primary-color
}
How do you achieve this in CSS Modules?
Check this out
//vars.css
:root {
--color-black: #222;
}
//myComponent.module.css
@import './vars.css';
.component{
color: var(--color-black);
}