I created a new cli project with --style=sass and then defined some variables in the src/sass/styles.scss (no partials created) so they should be globally defined right? , so when i tried to use them in home.component.scss i got this error https://i.stack.imgur.com/UlWYY.jpg
i then added a black border just to make sure normal css works and it did work , the problem is with sass , here's the angular.json
"styles": [
"src/sass/styles.scss",
"./node_modules/bootstrap/dist/css/bootstrap.min.css",
"./node_modules/malihu-custom-scrollbar-
plugin/jquery.mCustomScrollbar.css",
"./node_modules/animate.css/animate.min.css",
edit: i then created a partial _variables.scss and in the component.scss i wrote @import '~sass/variables'; after importing them in the styles.scss like so @import './variables'; according to the guide from this link : https://scotch.io/tutorials/using-sass-with-the-angular-cli still not working.
The best approach to achieve this, is creating a variable file and import this file in your scss files.
Like so:
or
And in your styles.scss you just put a reference of your variable file!