Answers for "angular adding a scss file to a component"

CSS
-1

how to import scss file in angular

In the new angular v6, importing sass files is a little different from the previous version.

I just needed to import like this (in a component stylesheet)

@import "~src/sass/variables";    // note: without file extension

Now everything works fine

Thanks all for the help
Posted by: Guest on March-09-2021
0

how to generate angular component with scss

ng g component componentname
//it will automatically create 4 files
//componentname.html
//componentname.scss
//componentname.ts
//componentname.spec.ts
Posted by: Guest on August-16-2021

Code answers related to "angular adding a scss file to a component"

Browse Popular Code Answers by Language