I use Angular2 and angular-cli in my project. I defined some Sass variables in the global style.scss file. How can I access these variables from my custom components (from component.scss)? Мaybe I have to import the separate file with these variables in each component.scss file.
You should put your variables inside a seperate
.scss file like
_vars.scss. Notice the underscore in front of the name. This will tell the compiler that the output of the file should not be embedded if you use it with
Then for instance in your
component.scss you can do (at the top of your file):
No need to add the underscore nor the extension