简体   繁体   中英

Angular 4 with Bootstrap - LESS/SASS

I am working with bootstrap in Angular.

As we have css files alongside every component in Angular I am wondering what part SASS/LESS play. Eg would I be swimming against the tide if I tried to implement to incorporate LESS/SASS into my angular application?

Definitely a good idea to use sass or less. In factor Agnular CLI supports it. If you're using Angular CLI, you can tell it to use sass instead of css. Here is an article from scotch.io (one of my favorites) on using sass with Angular CLI. In general, to get started with an Angular application that uses sass, use the following command.

ng new my-app --style=scss

If you want to update your existing css application, you can run the following command to update the default.

ng set defaults.styleExt scss

From, there, you will need to update the names of your .css files to .scss. Then you should be good.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM