I think the differences in output you're seeing are due to these compilers using different versions of the LESS spec. Previous versions current versions of LESS (thanks @seven-phases-max) allow variables created in mixins to be used throughout the whole document ('global scope').
You've created the @colorx
variable inside of a mixin. To make your code work in a compiler using version 1.4.x, you either need to set your @colorx
variable outside the mixin, so it has global scope, or apply the colour to .text
by using the mixin.
Here's an example demonstrating variable scope LESS in a compiler (currently) running an older compiler So I guess you have a couple of options.
Option one, keeping using the old compiler and change your mixin to this:
.setColor(){
@colorx:"yellow";
color: @colorx;
}
.text {
.steColor();
font-size:20px;
}
Or, drop set colour all together, and declare the @colorx:"yellow";
variable in the body of your less file.
Or lastly, as @seven-phases-max has pointed out, your code works in the current versions of the compiler, so you could switch to a more up-to-date compiler and use your code as-is.