Skip to content Skip to sidebar Skip to footer

Angular 6 - Less Css' Import Is Not Working Anymore

I wanted to re-use some structure from an Angular 5 project which uses Less. In this old project I could simply load .less files using this line from within a component: @import '~

Solution 1:

In angular 6 you have to import all files to main(in your case src/styles.less) css file :

In angular.json put ONLY:

"styles":["src/styles.less"]

In styles.less (import all files you want with / before app):

@import'./app/shared/less/bootstrap.less';

See my answer to css here:Angular 6 load css folders in angular.json

To your edit ./src/app..:

@import'./src/app/...'

Post a Comment for "Angular 6 - Less Css' Import Is Not Working Anymore"