Global styles are going in to "src/styles.scss", contents of styles.scss:
// bs variables
@import '../src/assets/scss/variables';
// importing bootstrap
@import '~bootstrap/scss/bootstrap';
i import there BS's "_variables.scss", then in my component "Login" (login.component.scss), i'm trying to use a variable from "_variables.scss", but it won't see this variable.
What load order of scss files are in angular? Or what's the correct place to import variables file?
UPDATE 1
Contents of login.component.scss:
#login {
background-color: $blue;
}
UPDATE 2
as @Drenai pointed me regarding assets directory, i've placed my _variables.scss under src/_variables.scss, then imported it in styles.scss, but variables won't work in my login.component.scss if i don't explicitly import it there. But why do i have to import it in a login.component.scss if it's imported in styles.scss already?
UPDATE 3
Just found and old issue: https://github.com/angular/angular-cli/issues/3700 seems like there's no other way, we have to import variables in every component. Or use CSS variables.
/src/assets/scss/variablesyour own variables file? If so, it shouldn't be in the assets folder - as it will be bundled with your app at build time - not loaded at runtime. I'll give you more info based on that. Add in some of yourLoginComponentscss import code too so we can see it - Drenaisrc/appfor example. - AntoineBsrc/assets, it should contain assets - images, icons, styles. Don't understand. - Alexander Kim