You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Guarded css styles defined inside mixin use global scope instead of local one. The consequence the same variable has different value in guard and different value in declaration.
@caller: global;
.caller() {
.caller when (@caller=caller){ // this should use global variable value
guard-expected-caller-but-is: @caller;
}
.global when (@caller=global){ // this should use global variable value
guard-expected-global-but-is: @caller;
}
}
.local-in-caller {
.caller();
@caller: caller;
}
there was a bug in guarded mixins that resulted in some frankly odd behaviour.
the only thing fixing it broke was this test
.light when (lightness(@a) > 50%) {
color: green;
}
.dark when (lightness(@a) < 50%) {
color: orange;
}
@a: #ddd;
.see-the {
@a: #444; // this mirrors what mixins do - they evaluate the guards at the point of definition
.light();
.dark();
}
.hide-the {
.light();
.dark();
}
and previous the local definition of @a changed which of the mixins came through. which is frankly pretty odd.
Guarded css styles defined inside mixin use global scope instead of local one. The consequence the same variable has different value in guard and different value in declaration.
1.) Mixin redefines
@usedScope
variable:actual output:
expected output:
2.) Mixin argument redefines
@usedScope
:actual output:
expected output:
3.) Variable defined in caller is visible:
compiles into:
expected css:
Tested with windows node.js lessc 1.6.1 (LESS Compiler) [JavaScript]
The text was updated successfully, but these errors were encountered: