Answer the question
In order to leave comments, you need to log in
How to use external constants in SASS?
I have a BEM project, so I use modular SCSS.
I would like to store constants (like colors) in a separate file, and later connect it to other modules.
I created a separate _libary.scss file and import it with @use.
But when I try to connect the constant to the file (color: library.$primary-color;), I get an error
SassError: SassError: Invalid CSS after " color: library": expected expression (e.g. 1px, bold), was ".$primary-color;"
on line 9 of src/components/app/app.module.scss
>> color: library.$primary-color;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question