Comparing version 4.1.1 to 4.2.0
@@ -0,1 +1,7 @@ | ||
## 4.2.0 (November 26, 2020) | ||
- Trim Custom Property values when possible (#393) | ||
- Fixed removing unit for zero-length dimentions in `min()`, `max()` and `clamp()` functions (#426) | ||
- Fixed crash on bad value in TRBL declaration value (#412) | ||
## 4.1.1 (November 15, 2020) | ||
@@ -2,0 +8,0 @@ |
@@ -0,5 +1,14 @@ | ||
var property = require('css-tree').property; | ||
module.exports = function cleanDeclartion(node, item, list) { | ||
if (node.value.children && node.value.children.isEmpty()) { | ||
list.remove(item); | ||
return; | ||
} | ||
if (property(node.property).custom) { | ||
if (/\S/.test(node.value.value)) { | ||
node.value.value = node.value.value.trim(); | ||
} | ||
} | ||
}; |
var packNumber = require('./Number').pack; | ||
var MATH_FUNCTIONS = { | ||
'calc': true, | ||
'min': true, | ||
'max': true, | ||
'clamp': true | ||
}; | ||
var LENGTH_UNIT = { | ||
@@ -46,3 +52,3 @@ // absolute length units | ||
// issue #222: don't remove units inside calc | ||
if (this.function && this.function.name === 'calc') { | ||
if (this.function && MATH_FUNCTIONS.hasOwnProperty(this.function.name)) { | ||
return; | ||
@@ -49,0 +55,0 @@ } |
@@ -81,3 +81,3 @@ var List = require('css-tree').List; | ||
var iehack = ''; | ||
var hasBadValues = declaration.value.children.some(function(child) { | ||
var hasBadValues = declaration.value.type !== 'Value' || declaration.value.children.some(function(child) { | ||
var special = false; | ||
@@ -84,0 +84,0 @@ |
{ | ||
"name": "csso", | ||
"version": "4.1.1", | ||
"version": "4.2.0", | ||
"description": "CSS minifier with structural optimisations", | ||
@@ -41,3 +41,3 @@ "homepage": "https://github.com/css/csso", | ||
"dependencies": { | ||
"css-tree": "^1.0.0" | ||
"css-tree": "^1.1.2" | ||
}, | ||
@@ -44,0 +44,0 @@ "browser": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
592991
6140
0
Updatedcss-tree@^1.1.2