I have a Less variable called @side . I want to set the @sideOpposite variable depending on the value of the @side variable. It can take only two values: "left" or "right."
In other words, I need a junior equivalent of JS code:
var side = "left", sideOpposite = (side === "left")? "right" : "left";
I tried to accomplish this with the when function, but from the fact that, as I understand it, it doesnβt work this way and applies only to CSS properties, not to variables:
when (@side = right){ @sideOpposite: left; } when (@side = left){ @sideOpposite: right; }
zorza source share