Imagine this scenario: You have a _variables.scss file with all the variables ready to use but you don't want to have to copy those files to every module that needs them.
Rather you would like to be able to do a simple @import "variables"; in the sass file of your component no? well read on :)
To achieve this functionality we are going to edit the angular.json file located in the root of your project. Look for the key "stylePreprocessorOptions" and define (or add) inside it the following:
"stylePreprocessorOptions": {
"includePaths": [
"src/styles/utils",
"src/styles/business-utils"
]
},
What we've done here is to tell aungular to expose those directories ("src/styles/utils" and "src/styles/business-utils") wherever a SASS file is compiled, allowing us to @include any files found there in our components.
It's that easy.
Bye!
Add new comment