postcss-calc
Advanced tools
Comparing version 7.0.2 to 7.0.3
@@ -0,1 +1,5 @@ | ||
# 7.0.3 | ||
- Fixed: substracted css-variable from zero ([#111](https://github.com/postcss/postcss-calc/issues/111)) | ||
# 7.0.2 | ||
@@ -2,0 +6,0 @@ |
@@ -71,3 +71,3 @@ "use strict"; | ||
if (isValueType(node.left.type) && node.left.value === 0 && node.operator === "-" && node.right.type !== "Function") { | ||
if (isValueType(node.left.type) && node.left.value === 0 && node.operator === "-" && !isCSSFunction(node.right)) { | ||
return flipValue(node.right); | ||
@@ -328,2 +328,15 @@ } // value + value | ||
exports.default = _default; | ||
function isCSSFunction(node) { | ||
if (node.type === "Function") { | ||
return true; | ||
} | ||
if (node.type === "MathExpression") { | ||
return isCSSFunction(node.left) || isCSSFunction(node.right); | ||
} | ||
return false; | ||
} | ||
module.exports = exports.default; |
{ | ||
"name": "postcss-calc", | ||
"version": "7.0.2", | ||
"version": "7.0.3", | ||
"description": "PostCSS plugin to reduce calc()", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
151802
3746
1