I've used guard expressions elsewhere in my CSS to achieve IF statements in LESS, however these don't work for me when trying to declare variables like so...
@neutral: false;
@warm: true;
when (@neutral = true) {
@green: #91C95B;
@red: #F15647;
etc...
}
when (@warm = true) {
@green: #91AD3C;
@red: #BF2A23;
etc...
}
This is an example of how I would like to be able to use that variable
h1 {
color:@green;
}
This is how I would expect it to compile down to CSS
h1 {
color: #91AD3C;
}
Is this possible with LESS or would I need to modify my code to use mixin guards?