How should we write in .less
to obtain
left: calc(50% - 38px);
I have
@myWidth: 38px;
left: calc(50% - @myWidth);
I obtain
left: calc(12%); // ?? > (50-38) = 12%
LESS makes calculations using the first unit of measurement it encounters. Since you don't want LESS to calculate the expression, wrap it in a string.
Pen - click view compiled in the CSS panel
left: calc(~'50% - 38px');
@myWidth: 38px;
left: calc(~'50% - @{myWidth}');