Comparing version 4.0.2 to 4.0.3
@@ -0,1 +1,7 @@ | ||
## 4.0.3 (March 24, 2020) | ||
- Prevented percent sign removal in `flex`/`-ms-flex` (#410) | ||
- Fixed restructuring optimisation in some cases (@charlessuh & @chsuh, #358, #411) | ||
- Bumped dependencies (@AviVahl, #409) | ||
## 4.0.2 (October 28, 2019) | ||
@@ -2,0 +8,0 @@ |
@@ -10,3 +10,9 @@ var lexer = require('css-tree').lexer; | ||
'min-height', | ||
'max-height' | ||
'max-height', | ||
// issue #410: Don’t remove units in flex-basis value for (-ms-)flex shorthand | ||
// issue #362: shouldn't remove unit in -ms-flex since it breaks flex in IE10/11 | ||
// issue #200: shouldn't remove unit in flex since it breaks flex in IE10/11 | ||
'flex', | ||
'-ms-flex' | ||
]); | ||
@@ -13,0 +19,0 @@ |
@@ -37,9 +37,23 @@ var List = require('css-tree').List; | ||
list.prevUntil(item.prev, function(prev, prevItem) { | ||
// skip non-ruleset node if safe | ||
if (prev.type !== 'Rule') { | ||
return utils.unsafeToSkipNode.call(selectors, prev); | ||
var prevBlock = prev.block; | ||
var prevType = prev.type; | ||
if (prevType !== 'Rule') { | ||
var unsafe = utils.unsafeToSkipNode.call(selectors, prev); | ||
if (!unsafe && prevType === 'Atrule' && prevBlock) { | ||
walk(prevBlock, { | ||
visit: 'Rule', | ||
enter: function(node) { | ||
node.prelude.children.each(function(data) { | ||
disallowDownMarkers[data.compareMarker] = true; | ||
}); | ||
} | ||
}); | ||
} | ||
return unsafe; | ||
} | ||
var prevSelectors = prev.prelude.children; | ||
var prevBlock = prev.block; | ||
@@ -114,4 +128,4 @@ if (node.pseudoSignature !== prev.pseudoSignature) { | ||
// ruleset description overhead | ||
if (allowMergeDown && blockLength >= newBlockLength) { | ||
var newRule = { | ||
if (blockLength >= newBlockLength) { | ||
var newItem = list.createItem({ | ||
type: 'Rule', | ||
@@ -126,7 +140,13 @@ loc: null, | ||
pseudoSignature: node.pseudoSignature | ||
}; | ||
}); | ||
block.children = new List().fromArray(diff.ne1); | ||
prevBlock.children = new List().fromArray(diff.ne2overrided); | ||
list.insert(list.createItem(newRule), prevItem); | ||
if (allowMergeUp) { | ||
list.insert(newItem, prevItem); | ||
} else { | ||
list.insert(newItem, item); | ||
} | ||
return true; | ||
@@ -133,0 +153,0 @@ } |
{ | ||
"name": "csso", | ||
"version": "4.0.2", | ||
"version": "4.0.3", | ||
"description": "CSS minifier with structural optimisations", | ||
@@ -29,20 +29,2 @@ "homepage": "https://github.com/css/csso", | ||
"main": "./lib/index", | ||
"eslintConfig": { | ||
"env": { | ||
"node": true, | ||
"mocha": true, | ||
"es6": true | ||
}, | ||
"rules": { | ||
"no-duplicate-case": 2, | ||
"no-undef": 2, | ||
"no-unused-vars": [ | ||
2, | ||
{ | ||
"vars": "all", | ||
"args": "after-used" | ||
} | ||
] | ||
} | ||
}, | ||
"scripts": { | ||
@@ -62,15 +44,15 @@ "test": "mocha --reporter dot", | ||
"dependencies": { | ||
"css-tree": "1.0.0-alpha.37" | ||
"css-tree": "1.0.0-alpha.39" | ||
}, | ||
"devDependencies": { | ||
"coveralls": "^3.0.7", | ||
"eslint": "^6.5.1", | ||
"mocha": "^5.2.0", | ||
"nyc": "^14.1.0", | ||
"rollup": "^1.23.1", | ||
"rollup-plugin-commonjs": "^10.1.0", | ||
"rollup-plugin-json": "^4.0.0", | ||
"rollup-plugin-node-resolve": "^5.2.0", | ||
"@rollup/plugin-commonjs": "^11.0.1", | ||
"@rollup/plugin-json": "^4.0.1", | ||
"@rollup/plugin-node-resolve": "^7.0.0", | ||
"coveralls": "^3.0.11", | ||
"eslint": "^6.8.0", | ||
"mocha": "^7.1.1", | ||
"nyc": "^15.0.0", | ||
"rollup": "^1.29.0", | ||
"source-map": "^0.6.1", | ||
"terser": "^4.3.8" | ||
"terser": "^4.6.3" | ||
}, | ||
@@ -77,0 +59,0 @@ "engines": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
845541
15780
46
+ Addedcss-tree@1.0.0-alpha.39(transitive)
+ Addedmdn-data@2.0.6(transitive)
- Removedcss-tree@1.0.0-alpha.37(transitive)
- Removedmdn-data@2.0.4(transitive)
Updatedcss-tree@1.0.0-alpha.39