These are chat archives for less/less.js

9th
Nov 2015
Paulo Oliveira
@poliveira89
Nov 09 2015 16:15
Hello :) I would like to disccuss something in here please, about “variables” not being overlayed or how to achieve that...

I have to file, like this:

// file1.less
@var1: #000000;

.stuff {
    background-color: @var1;
}
// file2.less
@var1: #c1c2c3;

@import "file1.less";

The compiled CSS file:

.stuff {
  background-color: #000000;
}
and my problem is that the variable I declared does not overlay after the import :worried: shouldn’t work? or should work? :confused:
Paulo Oliveira
@poliveira89
Nov 09 2015 16:28

I have done a new experiment, I have changed the order of the @importand it worked :confused:

like this:

@import "file1.less";

@var1: #c1c2c3;

and the output:

.stuff {
  background-color: #c1c2c3;
}

but this confuses because on bootstrap.less they @import variables.less before anything else