1
I have this mixin that works perfectly:
.calcW(@valor2: 100px) {
width: -o-calc(~"100% - "@valor2);
width: -webkit-calc(~"100% - "@valor2);
width: -moz-calc(~"100% - "@valor2);
width: calc(~"100% - "@valor2);
}
I wish instead of the "100%" code above, I could put a variable called @valor1
, that way I’d have a mixin that would help me in every situation where I needed to calc()
, however, when I do the form below it does not work.
.calcW(@valor1: 100%, @valor2: 100px) {
width: -o-calc(~"@valor1 - "@valor2);
width: -webkit-calc(~"@valor1 - "@valor2);
width: -moz-calc(~"@valor1 - "@valor2);
width: calc(~"@valor1 - "@valor2);
}
I’ve tried several ways, several combinations, but none works, as I can use two variables in a function calc()
?
Remove the quotation marks ("") from the variable @valor1.
– Douglas Garrido
It’s the first way I tried, it doesn’t work. Pro Less compile @Calc, it needs to be written this way: http://stackoverflow.com/questions/17904088/disable-less-css-overwriting-calc
– Guilherme Laureano