postcss-colormin 7.0.7 → 7.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "postcss-colormin",
3
- "version": "7.0.7",
3
+ "version": "7.0.8",
4
4
  "description": "Minify colors in your CSS files with PostCSS.",
5
5
  "main": "src/index.js",
6
6
  "types": "types/index.d.ts",
@@ -27,8 +27,8 @@
27
27
  },
28
28
  "repository": "cssnano/cssnano",
29
29
  "dependencies": {
30
- "@colordx/core": "^5.0.0",
31
- "browserslist": "^4.28.1",
30
+ "@colordx/core": "^5.0.3",
31
+ "browserslist": "^4.28.2",
32
32
  "caniuse-api": "^3.0.0",
33
33
  "postcss-value-parser": "^4.2.0"
34
34
  },
package/src/index.js CHANGED
@@ -108,6 +108,7 @@ function addPluginDefaults(options, browsers) {
108
108
  * @property {boolean} [hsl]
109
109
  * @property {boolean} [name]
110
110
  * @property {boolean} [transparent]
111
+ * @property {boolean} [transformCustomProperties] Whether to minify colors inside custom property values (default: true)
111
112
  */
112
113
 
113
114
  /**
@@ -150,6 +151,10 @@ function pluginCreator(config = {}) {
150
151
  return;
151
152
  }
152
153
 
154
+ if (config.transformCustomProperties === false && decl.prop.startsWith('--')) {
155
+ return;
156
+ }
157
+
153
158
  const value = decl.value;
154
159
 
155
160
  if (!value) {
package/types/index.d.ts CHANGED
@@ -7,6 +7,7 @@ export = pluginCreator;
7
7
  * @property {boolean} [hsl]
8
8
  * @property {boolean} [name]
9
9
  * @property {boolean} [transparent]
10
+ * @property {boolean} [transformCustomProperties] Whether to minify colors inside custom property values (default: true)
10
11
  */
11
12
  /**
12
13
  * @typedef {{ overrideBrowserslist?: string | string[] }} AutoprefixerOptions
@@ -30,6 +31,10 @@ type MinifyColorOptions = {
30
31
  hsl?: boolean | undefined;
31
32
  name?: boolean | undefined;
32
33
  transparent?: boolean | undefined;
34
+ /**
35
+ * Whether to minify colors inside custom property values (default: true)
36
+ */
37
+ transformCustomProperties?: boolean | undefined;
33
38
  };
34
39
  type AutoprefixerOptions = {
35
40
  overrideBrowserslist?: string | string[];
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":";AAsGA;;;;;;;;GAQG;AAEH;;;;GAIG;AAEH;;;;GAIG;AACH,wCAHW,OAAO,GACN,OAAO,SAAS,EAAE,MAAM,CAsDnC;;;;;;;;;;;;;2BA9DY;IAAE,oBAAoB,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;CAAE;2BAC5C,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,GAAG,KAAK,CAAC;eACpD,kBAAkB,GAAG,mBAAmB,GAAG,mBAAmB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":";AAsGA;;;;;;;;;GASG;AAEH;;;;GAIG;AAEH;;;;GAIG;AACH,wCAHW,OAAO,GACN,OAAO,SAAS,EAAE,MAAM,CA0DnC;;;;;;;;;;;;;;;;;2BAlEY;IAAE,oBAAoB,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;CAAE;2BAC5C,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,GAAG,KAAK,CAAC;eACpD,kBAAkB,GAAG,mBAAmB,GAAG,mBAAmB"}