Import LESS file only for one page

后端 未结 3 1573
独厮守ぢ
独厮守ぢ 2021-01-13 06:58

I have main all.less file, where I\'m including all other less files

e.g.

@import \"scaffolding.less\";
@import \"type.less\";
@import          


        
3条回答
  •  说谎
    说谎 (楼主)
    2021-01-13 07:32

    On your homepage use:

    
    

    And then in your Less files:

    .homepage {
      @import "homepage.less";
    }
    

    The above still compiles all your code in a single file. Your compiled CSS code will have a larger number of bytes, but you can cache the same file for all your pages.

提交回复
热议问题