Skip to content

unit lost when divise (or multiply) same units #2472

Closed

Description

@bassjobsen
test {
t1: (2em/1em) + 20;
t2: 20 + (2em/1em);
t3: 2em/1em;
t4: (2em/1px) + 20;
t5: 20 + (2em/1px);
t6: 2em/1px;
t7: (2em*1em) + 20;
t8: 20 + (2em*1em);
t9: 2em*1em;
t10: (2em*1px) + 20;
t11: 20 + (2em*1px);
t12: 2em*1px;
}

outputs:

test {
  t1: 22em;
  t2: 22;
  t3: 2em;
  t4: 22em;
  t5: 22em;
  t6: 2em;
  t7: 22em;
  t8: 22;
  t9: 2em;
  t10: 22em;
  t11: 22;
  t12: 2em;
}

The lost of units for t2 vs t5 and t8 vs t11 has already been described at #2471, but also t5 vs t11 seems unexpected.
Indeed mathematically em/em = 1 and em/px = ??, but with strict-units=off i expect both should be em.

Activity

  1. lukeapage commented on Feb 25, 2015

    @lukeapage
    Member

    in 1.7.5 the output is

    test {
      t1: 22em;
      t2: 22;
      t3: 2em;
      t4: 22em;
      t5: 22em;
      t6: 2em;
      t7: 22em;
      t8: 22em;
      t9: 2em;
      t10: 22em;
      t11: 22em;
      t12: 2em;
    }
    

    in 1.3.0 before strict math

    test {
      t1: 22em;
      t2: 22em;
      t3: 2em;
      t4: 22em;
      t5: 22em;
      t6: 2em;
      t7: 22em;
      t8: 22em;
      t9: 2em;
      t10: 22em;
      t11: 22em;
      t12: 2em;
    }
    
  2. seven-phases-max commented on Feb 25, 2015

    @seven-phases-max
    Member

    +1.

  3. added a commit that references this issue on Sep 27, 2025
    a37a742
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