Comparing version
@@ -5,2 +5,8 @@ # current | ||
# 2.0.2 | ||
* Extract trbl value reducing into a separate module. | ||
* Refactor core longhand optimiser to not rely on trbl cache. | ||
* Fixes parsing of some selector hacks. | ||
# 2.0.1 | ||
@@ -7,0 +13,0 @@ |
@@ -24,2 +24,3 @@ 'use strict'; | ||
normalizeUrl: require('postcss-normalize-url'), | ||
minifyTrbl: require('postcss-minify-trbl'), | ||
core: require('./lib/core'), | ||
@@ -26,0 +27,0 @@ // Optimisations after this are sensitive to previous optimisations in |
'use strict'; | ||
var TRBLOptimiser = require('./trblCache'); | ||
var postcss = require('postcss'); | ||
var collapsableTRBLProps = [ | ||
'margin', | ||
'padding', | ||
'border-color', | ||
'border-width', | ||
'border-style', | ||
]; | ||
function minimiseWhitespace (rule) { | ||
@@ -37,7 +28,2 @@ rule.before = rule.between = rule.after = ''; | ||
} | ||
if (~collapsableTRBLProps.indexOf(declaration.prop)) { | ||
var opt = new TRBLOptimiser(); | ||
opt.importShorthand(declaration.value); | ||
declaration.value = '' + opt; | ||
} | ||
// Remove whitespaces around ie 9 hack | ||
@@ -44,0 +30,0 @@ declaration.value = declaration.value.replace(/\s*(\\9)\s*/, '$1'); |
'use strict'; | ||
var capitalize = require('./util/capitalize'); | ||
var removeSelf = require('./util/removeSelf'); | ||
var TRBLCache = require('./trblCache'); | ||
var identical = require('./util/identicalValues'); | ||
@@ -41,7 +39,5 @@ var canMergeProperties = require('./util/canMergeProperties'); | ||
if (canMergeProperties.apply(this, rules)) { | ||
var opt = new TRBLCache(); | ||
rules.forEach(function (rule) { | ||
var propName = capitalize(rule.prop.split('-')[1]); | ||
opt['import' + propName].call(opt, rule.value); | ||
}); | ||
var value = rules.map(function (rule) { | ||
return rule.value; | ||
}).join(' '); | ||
@@ -53,3 +49,3 @@ rules.slice(0, 3).forEach(removeSelf); | ||
prop: type, | ||
value: '' + opt | ||
value: value | ||
}); | ||
@@ -56,0 +52,0 @@ |
{ | ||
"name": "cssnano", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "A modular minifier, built on top of the PostCSS ecosystem.", | ||
@@ -28,3 +28,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"autoprefixer-core": "^5.2.0", | ||
"autoprefixer-core": "^5.2.1", | ||
"balanced-match": "^0.2.0", | ||
@@ -35,3 +35,3 @@ "css-list": "^0.1.0", | ||
"minimist": "^1.1.1", | ||
"postcss": "^4.1.11", | ||
"postcss": "^4.1.13", | ||
"postcss-calc": "^4.1.0", | ||
@@ -42,3 +42,3 @@ "postcss-colormin": "^1.2.3", | ||
"postcss-discard-duplicates": "^1.1.3", | ||
"postcss-discard-empty": "^1.1.0", | ||
"postcss-discard-empty": "^1.1.1", | ||
"postcss-discard-unused": "^1.0.0", | ||
@@ -49,3 +49,4 @@ "postcss-font-family": "^1.1.0", | ||
"postcss-minify-font-weight": "^1.0.1", | ||
"postcss-minify-selectors": "^1.4.1", | ||
"postcss-minify-selectors": "^1.4.2", | ||
"postcss-minify-trbl": "^1.0.0", | ||
"postcss-normalize-url": "^2.0.2", | ||
@@ -66,3 +67,3 @@ "postcss-pseudoelements": "^2.2.0", | ||
"tape": "^4.0.0", | ||
"webpack": "^1.9.11" | ||
"webpack": "^1.10.0" | ||
}, | ||
@@ -69,0 +70,0 @@ "homepage": "https://github.com/ben-eb/cssnano", |
25674
-9.14%28
3.7%20
-9.09%396
-19.68%+ Added
+ Added
Updated
Updated
Updated