clean-css
Advanced tools
Comparing version
@@ -0,1 +1,7 @@ | ||
0.8.2 / 2012-10-31 | ||
================== | ||
* Fixed shortening hex colors and their relation to hashes in urls. | ||
* Cleanup by @XhmikosR. | ||
0.8.1 / 2012-10-28 | ||
@@ -2,0 +8,0 @@ ================== |
@@ -59,3 +59,3 @@ var util = require('util'); | ||
replace(/url\(['"]([^\)]+)['"]\)/g, function(urlMatch) { | ||
if (urlMatch.match(/\s/g) != null) | ||
if (urlMatch.match(/\s/g) !== null) | ||
return urlMatch; | ||
@@ -83,6 +83,6 @@ else | ||
// whitespace before !important | ||
replace(/ !important/g, '!important') | ||
replace(/ !important/g, '!important'); | ||
// space with a comma | ||
replace(/[ ]?,[ ]?/g, ',') | ||
replace(/[ ]?,[ ]?/g, ','); | ||
@@ -117,7 +117,7 @@ // restore spaces inside IE filters (IE 7 issue) | ||
// long hex to short hex | ||
replace(/([^"'=\s])\s*#([0-9a-f]{6})/gi, function(match, prefix, color) { | ||
replace(/([,: \(])#([0-9a-f]{6})/gi, function(match, prefix, color) { | ||
if (color[0] == color[1] && color[2] == color[3] && color[4] == color[5]) | ||
return (prefix + (/:$/.test(prefix) ? '' : ' ')) + '#' + color[0] + color[2] + color[4]; | ||
return prefix + '#' + color[0] + color[2] + color[4]; | ||
else | ||
return (prefix + (/:$/.test(prefix) ? '' : ' ')) + '#' + color; | ||
return prefix + '#' + color; | ||
}); | ||
@@ -223,3 +223,3 @@ | ||
tempData.push(data.substring(cursor, nextStart)) | ||
tempData.push(data.substring(cursor, nextStart)); | ||
if (data[nextStart + 2] == '!') { | ||
@@ -226,0 +226,0 @@ // in case of special comments, replace them with a placeholder |
@@ -6,8 +6,8 @@ { | ||
"keywords": ["css", "minifier"], | ||
"homepage": "http://github.com/GoalSmashers/clean-css", | ||
"homepage": "https://github.com/GoalSmashers/clean-css", | ||
"repository": { | ||
"type" : "git", | ||
"url" : "http://github.com/GoalSmashers/clean-css.git" | ||
"url" : "https://github.com/GoalSmashers/clean-css.git" | ||
}, | ||
"version": "0.8.1", | ||
"version": "0.8.2", | ||
"main": "index.js", | ||
@@ -14,0 +14,0 @@ "bin": { |
@@ -305,3 +305,5 @@ var vows = require('vows'), | ||
'p{border:1px solid #f94311}' | ||
] | ||
], | ||
'colors and colons': 'a{background-image:linear-gradient(top,red,#e6e6e6)}', | ||
'colors and parentheses': 'a{background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#e6e6e6))}' | ||
}), | ||
@@ -335,2 +337,6 @@ 'font weights': cssContext({ | ||
'a{background:url("/images/long image name.png") 0 0 no-repeat}a{}a{background:url(/images/no-spaces.png) 0 0 no-repeat}' | ||
], | ||
'not add a space before url\'s hash': [ | ||
"url(\"../fonts/d90b3358-e1e2-4abb-ba96-356983a54c22.svg#d90b3358-e1e2-4abb-ba96-356983a54c22\")", | ||
"url(../fonts/d90b3358-e1e2-4abb-ba96-356983a54c22.svg#d90b3358-e1e2-4abb-ba96-356983a54c22)", | ||
] | ||
@@ -337,0 +343,0 @@ }), |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
718093
0.05%18033
0.03%