I have a file containing variables with different themes that I need to override:
_vars.scss
body {
$bg-color: #fff
}
body.theme-dark {
$bg-color: #333
}
In my Angular button component, I am referencing these variables:
button.scss
@import '_vars.scss';
.button {
background-color: $bg-color;
}
However, I encountered a compiling error:
SassError: Undefined variable.
background-color: $bg-color;
What is the correct way to overwrite variables based on the body theme class? Thank you!