postcss-colormin
Advanced tools
Comparing version 4.0.0-nightly.2020.1.9 to 4.0.0-nightly.2020.1.11
@@ -10,4 +10,2 @@ "use strict"; | ||
var _postcss = _interopRequireDefault(require("postcss")); | ||
var _postcssValueParser = _interopRequireWildcard(require("postcss-value-parser")); | ||
@@ -80,39 +78,51 @@ | ||
var _default = _postcss.default.plugin('postcss-colormin', () => { | ||
return (css, result) => { | ||
const resultOpts = result.opts || {}; | ||
const browsers = (0, _browserslist.default)(null, { | ||
stats: resultOpts.stats, | ||
path: __dirname, | ||
env: resultOpts.env | ||
}); | ||
const isLegacy = browsers.some(hasTransparentBug); | ||
const colorminCache = {}; | ||
const cache = {}; | ||
css.walkDecls(decl => { | ||
if (/^(composes|font|filter|-webkit-tap-highlight-color)/i.test(decl.prop)) { | ||
return; | ||
} | ||
function pluginCreator() { | ||
return { | ||
postcssPlugin: 'postcss-colormin', | ||
const value = decl.value; | ||
prepare(result) { | ||
const resultOpts = result.opts || {}; | ||
const browsers = (0, _browserslist.default)(null, { | ||
stats: resultOpts.stats, | ||
path: __dirname, | ||
env: resultOpts.env | ||
}); | ||
const isLegacy = browsers.some(hasTransparentBug); | ||
const colorminCache = {}; | ||
const cache = {}; | ||
return { | ||
OnceExit(css) { | ||
css.walkDecls(decl => { | ||
if (/^(composes|font|filter|-webkit-tap-highlight-color)/i.test(decl.prop)) { | ||
return; | ||
} | ||
if (!value) { | ||
return; | ||
} | ||
const value = decl.value; | ||
const cacheKey = `${decl.prop}|${decl.value}`; | ||
if (!value) { | ||
return; | ||
} | ||
if (cache[cacheKey]) { | ||
decl.value = cache[cacheKey]; | ||
return; | ||
} | ||
const cacheKey = `${decl.prop}|${decl.value}`; | ||
const newValue = transform(value, isLegacy, colorminCache); | ||
decl.value = newValue; | ||
cache[cacheKey] = newValue; | ||
}); | ||
if (cache[cacheKey]) { | ||
decl.value = cache[cacheKey]; | ||
return; | ||
} | ||
const newValue = transform(value, isLegacy, colorminCache); | ||
decl.value = newValue; | ||
cache[cacheKey] = newValue; | ||
}); | ||
} | ||
}; | ||
} | ||
}; | ||
}); | ||
} | ||
pluginCreator.postcss = true; | ||
var _default = pluginCreator; | ||
exports.default = _default; | ||
module.exports = exports.default; |
{ | ||
"name": "postcss-colormin", | ||
"version": "4.0.0-nightly.2020.1.9", | ||
"version": "4.0.0-nightly.2020.1.11", | ||
"description": "Minify colors in your CSS files with PostCSS.", | ||
@@ -33,7 +33,5 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"browserslist": "^4.6.0", | ||
"browserslist": "^4.16.0", | ||
"color": "^3.1.1", | ||
"has": "^1.0.3", | ||
"postcss": "^7.0.16", | ||
"postcss-value-parser": "^3.3.1" | ||
"postcss-value-parser": "^4.1.0" | ||
}, | ||
@@ -45,3 +43,9 @@ "bugs": { | ||
"node": ">=10.13.0" | ||
}, | ||
"devDependencies": { | ||
"postcss": "^8.2.1" | ||
}, | ||
"peerDependencies": { | ||
"postcss": "^8.2.1" | ||
} | ||
} |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
9885
4
199
0
1
+ Addednanoid@3.3.7(transitive)
+ Addedpostcss@8.4.49(transitive)
+ Addedpostcss-value-parser@4.2.0(transitive)
+ Addedsource-map-js@1.2.1(transitive)
- Removedhas@^1.0.3
- Removedpostcss@^7.0.16
- Removedhas@1.0.4(transitive)
- Removedpicocolors@0.2.1(transitive)
- Removedpostcss@7.0.39(transitive)
- Removedpostcss-value-parser@3.3.1(transitive)
- Removedsource-map@0.6.1(transitive)
Updatedbrowserslist@^4.16.0
Updatedpostcss-value-parser@^4.1.0