Compiling all less files into one stylesheet?

2019-04-10 16:57发布

问题:

I am using simpless, I drag the project into it and target all the less files to styles.css

The issue is when compiling the less stylesheets are just over writing each other rather than being merged together. Is there a way when compiling to merge them all into styles.css ?

回答1:

You have to create a master less file that imports the subfiles. The master file would import the subfiles with:

@import "myfile1.less";
@import "myfile2.less";

Into the compiler, you just pass the master less file.

Hope this helps // ph



标签: css less