I defined a variable like this in the global scss called styles.scss in angular6
$color-redpink-dark: #E84A5F;
and I want to use the variable in a scss component, but when I declare the property I have the next output:
background-color: $color-redpink-dark;
Undefined variable: "$color-redpink-dark".
Should not the component scss use the color defined in the global scss?
Greetings.
You have to import the file with defined variable in the beginning of component.scss file using the variable:
@import 'your-file-name';
background-color: $color-redpink-dark;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With