Skip to content

11.2.2

Latest

Choose a tag to compare

@ludofischer ludofischer released this 01 Oct 21:22
· 5 commits to master since this release

What's Changed

Bug Fixes

  • transform a division or unit conversion only when the result is exact at the
    configured precision. For example., calc(100% / 3) stays calc(100% / 3) instead of
    becoming calc(33.33333%), and calc(1cm + 1px)
    is no longer converted to 1.02646cm.
    Use precision: false to transform every division.
  • keep precision significant digits for values below 1, so
    calc(1px / 150000) is no longer rounded to .00001px
  • min(), max() and clamp() preserve the original unit
  • keep the order of terms and factors around var(), env(), attr() and
    other substitution functions. For example, with --a: 1px + 2px, var(--a) * 2 means
    1px + 2px * 2, so reordering the multiplication would be a bug.
    var(--a) * 2 is not rewritten to 2 * var(--a), var(--a) / var(--a) is
    not cancelled, and parentheses are kept (1px - (2 * var(--a))).
    Unrecognised functions such as anchor-size() are treated the same way, so
    in 2 * anchor-size(width) * .5, is no longer transformed to anchor-size(width)
  • keep the parentheses of a nested calc() that contains unresolved values, so
    calc(var(--a) - calc(var(--b) - var(--c))) is no longer rewritten to
    calc(var(--a) - var(--b) + var(--c))
  • do not flip every sign of a parenthesized sum that starts with a negative
    term: calc((var(--b) - 7 - 2)) is now calc(-9 + var(--b)) instead of
    calc(-1 * (9 - var(--b))), which changed the value when --b expands to
    several tokens

Full Changelog: v11.2.1...v11.2.2