Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

postcss-colormin

Package Overview
Dependencies
Maintainers
7
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-colormin - npm Package Compare versions

Comparing version 4.0.0-nightly.2020.1.9 to 4.0.0-nightly.2020.1.11

72

dist/index.js

@@ -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"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc