If I have a numerical LESS variable for line-height
@lineHeight: 1.2
how do I add em to the end of it to set the height of the element to produce:
height: 1.2em;
The following do not work:
height: @(lineHeight)em;
height: @(lineHeight)"em";
height: @(lineHeight) + "em";
height: @lineHeight + "em";
I have seen other threads where the answer is adding a unit is not easy, but that doesn't seem right as the numerical line-height value goes hand in hand with the em unit.
I found a solution in a shopware theme-mixin
height: ~"@{lineHeight}px";
But the solution from seven-phases-max
in your comments works too
height: unit(@lineHeight, px);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With