Angular 6 - Less CSS' import is not working anymore

后端 未结 1 1998
梦毁少年i
梦毁少年i 2021-01-24 01:13

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 compo

相关标签:
1条回答
  • 2021-01-24 01:54

    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/...'
    
    0 讨论(0)
提交回复
热议问题