Join two .less files into one css file

匆匆过客 提交于 2019-12-18 03:04:44

问题


When working with lesscss I would like to join two or three .less files into one super css file.

I know that you can do it using some little ruby magic, but I would like to know if there is something simple in the less engine?


回答1:


You can use import, similar to how you can in a regular CSS file.

@import "reset";
@import "config";
@import "header";
@import "forms";

Taken from this SO post. It's also mentioned in the "Importing" section of the Less Documentation.




回答2:


Simple solution:

  1. Create a main.less file and open it (name it as you like)

  2. Import your other css and less files via @import

    • @import "filename.less"; for less files

    • @import "filename.css"; for css files.

  3. Compile your main.less file and just include this main.css in your site

  4. Smile :)



来源:https://stackoverflow.com/questions/3538605/join-two-less-files-into-one-css-file

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!