Skip to content

30/15rem outputs 2 instead of 2rem #2418

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
regisphilibert opened this issue Jan 27, 2015 · 3 comments
Closed

30/15rem outputs 2 instead of 2rem #2418

regisphilibert opened this issue Jan 27, 2015 · 3 comments
Labels

Comments

@regisphilibert
Copy link

Problem appeared for me with the latest CodeKit but this has been reproduced using most recent version of less.js
Exemple :
LESS
@fontRem = 17rem;
.whatever{
font-size:25/@fontRem;
}
CSS OUTPUT
.whatever{font-size:1,47058824}
(unit is absent)
Used to be
.whatever{font-size:1,47058824rem}

This only fails with the / operator and only if left unit is absent.
30rem/15rem does output 2rem

Strict unit is set to default (off)

@lukeapage
Copy link
Member

looks like behaviour changed in v2 and probably shouldn't have.

with strict units it is correct because the final unit of your output is "1/rem"

@lukeapage lukeapage added the bug label Jan 28, 2015
@hermanndettmann
Copy link

I have the same issue with em-units!

@hawkz
Copy link

hawkz commented Jan 30, 2015

It does seem that units should be preserved according to the docs: http://lesscss.org/features/#features-overview-feature-operations

"If a unit is used in an operation... Less will use that unit for the final output."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants