Skip to content

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

Closed

Description

@regisphilibert

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)

Activity

  1. lukeapage commented on Jan 28, 2015

    @lukeapage
    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"

  2. hermanndettmann commented on Jan 30, 2015

    @hermanndettmann

    I have the same issue with em-units!

  3. hawkz commented on Jan 30, 2015

    @hawkz

    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."

  4. added a commit that references this issue on Sep 27, 2025
    cf4f8e5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions