Skip to content

Releases: MoOx/reduce-css-calc

v2.0.4

09 May 16:47

Choose a tag to compare

  • Fixed: CSS variable regex was overly greedy and caused a crash in some
    cases. (#27 - @andyjansson)

v2.0.3

09 May 00:33

Choose a tag to compare

  • Fixed: Regression in handling decimals without having any numbers after
    the decimal place (e.g. 10.px).

v2.0.2

08 May 20:28

Choose a tag to compare

  • Fixed: Regression in consecutive subtraction handling
    (#25 - @andyjansson)

v2.0.1

08 May 15:48

Choose a tag to compare

  • Fixed: Support for nested calc e.g. calc(100% - calc(50px - 25px)).
  • Fixed: Support for CSS variables e.g. calc(var(--mouseX) * 1px).

v2.0.0

08 May 13:45

Choose a tag to compare

  • Rewritten with a jison parser for more accurate value parsing.
  • Breaking: reduce-css-calc will now throw when trying to multiply or divide
    by the same unit (e.g. calc(200px * 20px)), and also when trying to divide
    by zero.
  • Added: Better handling of zero values (e.g. calc(100vw / 2 - 6px + 0px)
    becomes calc(100vw / 2 - 6px)).
  • Added: Better handling of mixed time values (e.g. calc(1s - 50ms)
    becomes 0.95s).
  • Added: Inner parentheses calculation to simplify complex expressions (e.g.
    calc(14px + 6 * ((100vw - 320px) / 448)) becomes calc(9.71px + 1.34vw)
    with precision set to 2).
  • Fixed: calc(1px + 1) does not evaluate to 2px.

(#22 - @andyjansson)

1.3.0

26 Aug 11:03

Choose a tag to compare

  • Added: calc identifier from unresolved nested expressions are removed for
    better browser support
    (#19 - @ben-eb)

1.2.8

26 Aug 10:14

Choose a tag to compare

  • Fixed: regression from 1.2.5 on calc() with value without leading 0
    (#17 - @ben-eb)

1.2.7

22 Aug 10:19

Choose a tag to compare

  • Fixed: regression from 1.2.5 on calc() with value without leading 0
    (@MoOx)

1.2.6

22 Aug 08:57

Choose a tag to compare

  • Fixed: regression from 1.2.5 on calc() on multiple lines
    (@MoOx)

1.2.5

22 Aug 06:01

Choose a tag to compare

  • Fixed: security issue due to the usage of eval().
    This is to avoid an arbitrary code execution.
    Now operations are resolved using
    math-expression-evaluator