1

I want to join multiple bootstrap based addons/themes into one vendor.css:

// Twitter Bootstrap v3.0.3
@import "vendor/bootstrap/less/bootstrap.less";

// Jasny Bootstrap v3.0.1-p7
@import "vendor/bootstrap-jasny/less/jasny-bootstrap.less";

Both files include a mixins.less with a different file path. As soon as I delete @import "mixins.less"; in jasny-bootstrap.less everything works fine, otherwise the compiler (grunt-contrib-less v0.9.0) gets stuck.

Since I use bower for package management, it's not an option for me to modify any vendor files. Do I have any other chance to get this to work than compiling every vendor on its own?

Arnold Daniels
  • 16,516
  • 4
  • 53
  • 82
Sascha Galley
  • 15,711
  • 5
  • 37
  • 51
  • 1
    See [#1770](https://github.com/less/less.js/issues/1770), basically Bootstrap (and its derivatives) is not supposed to be compiled more then once in the same context. I.e. in your case you need to compile those two independently as separate css files. That's pretty much straightforward limitation: they use the same mixin and variable names defined in the same global scope so it's simply impossible to compile them together. – seven-phases-max Jan 12 '14 at 18:28
  • Also notice that even if it's compiled OK when you delete "mixins.less" the resulting css is not actually correct (because CSS classes generated by "Bootstrap" use variable values (i.e. colors/grids/everything) and mixins defined in "Jasny Bootstrap" so technically the result CSS is not really a "Bootstrap + Jasny Bootstrap" but more like "polluted Jasny Bootstrap" :) – seven-phases-max Jan 12 '14 at 18:37
  • 1
    I agree with @seven-phases-max you have to build Bootstrap OR Jansy and not both. If you compile both, you should not compile them in the same file. See also https://github.com/jasny/bootstrap/blob/master/less/bootstrap.less it imports all Bootstrap's files too. See also https://github.com/SomMeri/less4j/wiki/Less-Language-Variables#last-declaration-win---even-after-use, so you're compiling Bootstrap with Jansy's settings. – Bass Jobsen Jan 12 '14 at 18:58

0 Answers0