postcss-calc 7.0.2 → 7.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/dist/index.js +0 -0
- package/dist/lib/convertUnit.js +0 -0
- package/dist/lib/reducer.js +14 -1
- package/dist/lib/stringifier.js +0 -0
- package/dist/lib/transform.js +0 -0
- package/dist/parser.js +0 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
File without changes
|
package/dist/lib/convertUnit.js
CHANGED
|
File without changes
|
package/dist/lib/reducer.js
CHANGED
|
@@ -68,7 +68,7 @@ function reduceAddSubExpression(node, precision) {
|
|
|
68
68
|
} // 0 - something => -something
|
|
69
69
|
|
|
70
70
|
|
|
71
|
-
if (isValueType(node.left.type) && node.left.value === 0 && node.operator === "-" && node.right
|
|
71
|
+
if (isValueType(node.left.type) && node.left.value === 0 && node.operator === "-" && !isCSSFunction(node.right)) {
|
|
72
72
|
return flipValue(node.right);
|
|
73
73
|
} // value + value
|
|
74
74
|
// value - value
|
|
@@ -324,4 +324,17 @@ function reduce(node, precision) {
|
|
|
324
324
|
|
|
325
325
|
var _default = reduce;
|
|
326
326
|
exports.default = _default;
|
|
327
|
+
|
|
328
|
+
function isCSSFunction(node) {
|
|
329
|
+
if (node.type === "Function") {
|
|
330
|
+
return true;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
if (node.type === "MathExpression") {
|
|
334
|
+
return isCSSFunction(node.left) || isCSSFunction(node.right);
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
return false;
|
|
338
|
+
}
|
|
339
|
+
|
|
327
340
|
module.exports = exports.default;
|
package/dist/lib/stringifier.js
CHANGED
|
File without changes
|
package/dist/lib/transform.js
CHANGED
|
File without changes
|
package/dist/parser.js
CHANGED
|
File without changes
|