reduce-css-calc
Advanced tools
Comparing version
@@ -0,1 +1,5 @@ | ||
# 2.0.5 - 2017-05-12 | ||
- Fixed: Support division with a CSS variable. | ||
# 2.0.4 - 2017-05-09 | ||
@@ -2,0 +6,0 @@ |
@@ -72,5 +72,7 @@ 'use strict'; | ||
if (left.type === 'CssVariable' || right.type === 'CssVariable') return node; | ||
// something + 0 => something | ||
// something - 0 => something | ||
if (right.value === 0) return left; | ||
@@ -171,3 +173,3 @@ | ||
function reduceDivisionExpression(node) { | ||
if (node.right.type === 'MathExpression') return node; | ||
if (!isValueType(node.right.type)) return node; | ||
@@ -174,0 +176,0 @@ if (node.right.type !== 'Value') throw new Error(`Cannot divide by "${node.right.unit}", number expected`); |
{ | ||
"name": "reduce-css-calc", | ||
"version": "2.0.4", | ||
"version": "2.0.5", | ||
"description": "Reduce CSS calc() function to the maximum", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
47225
0.31%1027
0.1%