clean-css
Advanced tools
Comparing version 3.4.6 to 3.4.7
@@ -0,1 +1,9 @@ | ||
[3.4.7 / 2015-11-10](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.6...v3.4.7) | ||
================== | ||
* Fixed issue [#692](https://github.com/jakubpawlowicz/clean-css/issues/692) - edge case in URL quoting. | ||
* Fixed issue [#695](https://github.com/jakubpawlowicz/clean-css/issues/695) - shorthand overriding edge case. | ||
* Fixed issue [#699](https://github.com/jakubpawlowicz/clean-css/issues/699) - IE9 transparent hack. | ||
* Fixed issue [#701](https://github.com/jakubpawlowicz/clean-css/issues/701) - `url` quoting with hash arguments. | ||
[3.4.6 / 2015-10-14](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.5...v3.4.6) | ||
@@ -2,0 +10,0 @@ ================== |
@@ -125,5 +125,5 @@ var canOverride = require('./can-override'); | ||
function mergingIntoFunction(left, right, validator) { | ||
for (var i = 0, l = left.components.length; i < l; i++) { | ||
if (anyValue(validator.isValidFunction, left.components[i])) | ||
function overridingFunction(shorthand, validator) { | ||
for (var i = 0, l = shorthand.components.length; i < l; i++) { | ||
if (anyValue(validator.isValidFunction, shorthand.components[i])) | ||
return true; | ||
@@ -264,2 +264,5 @@ } | ||
if (!anyValue(validator.isValidFunction, left) && overridingFunction(right, validator)) | ||
continue; | ||
component = right.components.filter(nameMatchFilter(left))[0]; | ||
@@ -279,3 +282,3 @@ mayOverride = (compactable[left.name] && compactable[left.name].canOverride) || canOverride.sameValue; | ||
if (mergingIntoFunction(left, right, validator)) | ||
if (overridingFunction(left, validator)) | ||
continue; | ||
@@ -282,0 +285,0 @@ |
@@ -131,3 +131,3 @@ var cleanUpSelectors = require('./clean-up').selectors; | ||
function colorMininifier(_, value, compatibility) { | ||
function colorMininifier(name, value, compatibility) { | ||
if (value.indexOf('#') === -1 && value.indexOf('rgb') == -1 && value.indexOf('hsl') == -1) | ||
@@ -165,3 +165,3 @@ return HexNameShortener.shorten(value); | ||
if (compatibility.colors.opacity) { | ||
if (compatibility.colors.opacity && name.indexOf('background') == -1) { | ||
value = value.replace(/(?:rgba|hsla)\(0,0%?,0%?,0\)/g, function (match) { | ||
@@ -168,0 +168,0 @@ if (split(value, ',').pop().indexOf('gradient(') > -1) |
@@ -87,3 +87,3 @@ var path = require('path'); | ||
return '\''; | ||
else if (/\s/.test(url)) | ||
else if (/\s/.test(url) || /[\(\)]/.test(url)) | ||
return '\''; | ||
@@ -95,5 +95,12 @@ else | ||
function rewriteUrls(data, options, context) { | ||
return reduceUrls(data, context, function (url, tempData) { | ||
url = url.replace(/^(url\()?\s*['"]?|['"]?\s*\)?$/g, ''); | ||
tempData.push('url(' + quoteFor(url) + rebase(url, options) + quoteFor(url) + ')'); | ||
return reduceUrls(data, context, function (originUrl, tempData) { | ||
var url = originUrl.replace(/^(url\()?\s*['"]?|['"]?\s*\)?$/g, ''); | ||
var match = originUrl.match(/^(url\()?\s*(['"]).*?(['"])\s*\)?$/); | ||
var quote; | ||
if (!!options.urlQuotes && match && match[2] === match[3]) { | ||
quote = match[2]; | ||
} else { | ||
quote = quoteFor(url); | ||
} | ||
tempData.push('url(' + quote + rebase(url, options) + quote + ')'); | ||
}); | ||
@@ -100,0 +107,0 @@ } |
@@ -77,3 +77,4 @@ var path = require('path'); | ||
fromBase: absoluteSourcePath, | ||
toBase: isRemote ? absoluteSourcePath : toBase | ||
toBase: isRemote ? absoluteSourcePath : toBase, | ||
urlQuotes: self.outerContext.options.compatibility.properties.urlQuotes | ||
}; | ||
@@ -80,0 +81,0 @@ styles = rewriteUrls(styles, rewriteOptions, self.outerContext); |
{ | ||
"name": "clean-css", | ||
"version": "3.4.6", | ||
"version": "3.4.7", | ||
"author": "Jakub Pawlowicz <contact@jakubpawlowicz.com> (http://twitter.com/jakubpawlowicz)", | ||
@@ -5,0 +5,0 @@ "description": "A well-tested CSS minifier", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
297086
5768