This project has moved. For the latest updates, please go here.

Split less file

Apr 6, 2013 at 8:33 PM
I'm using LessTranslator to compile one less file into a bundle.
The less file contains many imports that depend on each other.
The resulting CSS has more than 4095 rules, which is the limit of rules per sheet in IE9, and so my website isn't usable in IE9.

Splitting the less file into 2 smaller less files is a very difficult task as a result of the dependencies between the imports and fact that I'm using Bootstrap.

Is there a way to somehow split the resulting CSS into 2 files while still using one less file as a source? Or maybe there's a better way I'm not aware of?

Thanks
Coordinator
Apr 7, 2013 at 7:48 AM
Edited Apr 7, 2013 at 7:50 AM
Hello, Bumpy!

I think, that you need to manually optimize your less-files. I doubt, that you need all modules of the Bootstrap, try commenting out unused imports.

In addition, you can still split the Bootstrap to different less-files. Just in each file, you need to import the variables.less and mixins.less files.
Jun 2, 2014 at 3:31 PM
Hi

I have also run into this problem.

We are extending bootstrap with the site design theme all in the one file which works well.

Would it be worthwhile / feasible to add the following handler behavior to the end of the less file we could then enable just for IE 7-8-9

<link rel="stylesheet" type="text/css" href="/css/bootstrap.less?page=1&length=4095" />
<link rel="stylesheet" type="text/css" href="/css/bootstrap.less?page=2&length=4095" />


I would be grateful for your thoughts.