lesscss-java icon indicating copy to clipboard operation
lesscss-java copied to clipboard

Mathematical operations do not work on rem units

Open robfletcher opened this issue 12 years ago • 1 comments

I'm attempting to build a mixin for outputting rem units with a pixel fallback, basically:

.margin-top(@size: 1) {
    margin-top: @size * 16px;
    margin-top: @size * 1rem;
}

However the CSS output is:

margin-top: 16px;
margin-top: 1 rem;

Note the space between 1 and rem which makes the rule invalid.

I have tried a couple of other ways of achieving the same result such as @size + rem or ~"@{size}rem" with no success.

robfletcher avatar Jul 12 '13 10:07 robfletcher

I should note the mixin works as written using the less 1.3.3 Ruby gem.

robfletcher avatar Jul 12 '13 10:07 robfletcher