0
I am 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 file foo.component.scss
I’m trying to access the file _variables.scss
to pick up a variable that contains a standard color for the project. To do this, I am 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 by creating a reference in the config files, or some other configuration?
I ended up using a tag I found in the file schema
angular-cli.json
calling forstylePreprocessorOptions
. with her I could tell the projects that the foldersrc/styles
is a default folder for access to any component. so I just need to call the name of the file I want in there...– LeandroLuk