I'm working with Angular (project generated by @angular/cli
), and the structure of my project is below:
src
| - app
| - foo
| - foo.component.js
| - foo.component.scss
| - foo.component.html
| - styles
| - _variables.scss
In my foo.component.scss
file I'm trying to access the _variables.scss
file to get a variable that contains a default color for the project. To do this, I'm using the structure below:
@import '~/.../src/styles/_variables.scss';
foo {
background-color: $color-red;
}
Is there any simpler way to import this file into component style sheets? or creating a reference in config files, or some other configuration?