clean-css
Advanced tools
Comparing version 3.4.21 to 3.4.22
@@ -0,1 +1,7 @@ | ||
[3.4.22 / 2016-12-12](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.21...v3.4.22) | ||
================== | ||
* Fixed issue [#841](https://github.com/jakubpawlowicz/clean-css/issues/841) - disabled importing and files passed as array. | ||
* Ignores `@import` at-rules if appearing after any non-`@import` rules. | ||
[3.4.21 / 2016-11-16](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.20...v3.4.21) | ||
@@ -2,0 +8,0 @@ ================== |
@@ -225,3 +225,3 @@ /** | ||
simpleOptimize(tokens, options); | ||
simpleOptimize(tokens, options, context); | ||
@@ -228,0 +228,0 @@ if (options.advanced) |
@@ -72,3 +72,3 @@ var fs = require('fs'); | ||
context.done.push(noImportPart); | ||
context.left.unshift([data.substring(nextEnd + 1), context]); | ||
context.left.unshift([data.substring(nextEnd + 1), override(context, { shallow: false })]); | ||
context.afterContent = hasContent(noImportPart); | ||
@@ -75,0 +75,0 @@ return inline(data, nextStart, nextEnd, context); |
@@ -17,2 +17,3 @@ var cleanUpSelectors = require('./clean-up').selectors; | ||
var CHARSET_REGEXP = new RegExp('^' + CHARSET_TOKEN, 'i'); | ||
var IMPORT_REGEXP = /^@import["'\s]/i; | ||
@@ -404,3 +405,3 @@ var FONT_NUMERAL_WEIGHTS = ['100', '200', '300', '400', '500', '600', '700', '800', '900']; | ||
function optimize(tokens, options) { | ||
function optimize(tokens, options, context) { | ||
var ie7Hack = options.compatibility.selectors.ie7Hack; | ||
@@ -410,2 +411,3 @@ var adjacentSpace = options.compatibility.selectors.adjacentSpace; | ||
var mayHaveCharset = false; | ||
var afterContent = false; | ||
@@ -422,6 +424,8 @@ options.unitsRegexp = buildUnitRegexp(options); | ||
optimizeBody(token[2], options); | ||
afterContent = true; | ||
break; | ||
case 'block': | ||
cleanUpBlock(token[1], spaceAfterClosingBrace); | ||
optimize(token[2], options); | ||
optimize(token[2], options, context); | ||
afterContent = true; | ||
break; | ||
@@ -431,2 +435,3 @@ case 'flat-block': | ||
optimizeBody(token[2], options); | ||
afterContent = true; | ||
break; | ||
@@ -438,2 +443,7 @@ case 'at-rule': | ||
if (token[0] == 'at-rule' && IMPORT_REGEXP.test(token[1]) && afterContent) { | ||
context.warnings.push('Ignoring @import rule "' + token[1] + '" as it appears after rules thus browsers will ignore them.'); | ||
token[1] = ''; | ||
} | ||
if (token[1].length === 0 || (token[2] && token[2].length === 0)) { | ||
@@ -440,0 +450,0 @@ tokens.splice(i, 1); |
{ | ||
"name": "clean-css", | ||
"version": "3.4.21", | ||
"version": "3.4.22", | ||
"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
308262
5911