postcss-minify-gradients 8.0.6 → 9.0.1

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/README.md CHANGED
@@ -43,7 +43,7 @@ examples for your environment.
43
43
 
44
44
  ## Contributors
45
45
 
46
- See [CONTRIBUTORS.md](https://github.com/cssnano/cssnano/blob/master/CONTRIBUTORS.md).
46
+ See [CONTRIBUTORS.md](https://github.com/cssnano/cssnano/blob/main/CONTRIBUTORS.md).
47
47
 
48
48
 
49
49
  ## License
package/package.json CHANGED
@@ -1,17 +1,16 @@
1
1
  {
2
2
  "name": "postcss-minify-gradients",
3
- "version": "8.0.6",
3
+ "version": "9.0.1",
4
4
  "description": "Minify gradient parameters with PostCSS.",
5
5
  "exports": {
6
6
  ".": {
7
7
  "types": "./types/index.d.ts",
8
8
  "default": "./src/index.js"
9
9
  },
10
- "./src": "./src/index.js",
11
- "./src/*": "./src/*.js",
12
- "./src/*.js": "./src/*.js",
13
10
  "./package.json": "./package.json"
14
11
  },
12
+ "main": "./src/index.js",
13
+ "types": "./types/index.d.ts",
15
14
  "files": [
16
15
  "LICENSE-MIT",
17
16
  "src",
@@ -35,14 +34,14 @@
35
34
  },
36
35
  "dependencies": {
37
36
  "@colordx/core": "^5.6.0",
38
- "cssnano-utils": "^6.0.4",
37
+ "cssnano-utils": "^7.0.1",
39
38
  "postcss-value-parser": "^4.2.0"
40
39
  },
41
40
  "bugs": {
42
41
  "url": "https://github.com/cssnano/cssnano/issues"
43
42
  },
44
43
  "engines": {
45
- "node": "^22.11.0 || ^24.11.0 || >=26.0"
44
+ "node": "^22.22.3 || ^24.15.0 || >=26.0"
46
45
  },
47
46
  "devDependencies": {
48
47
  "postcss": "^8.5.26"
@@ -50,6 +49,7 @@
50
49
  "peerDependencies": {
51
50
  "postcss": "^8.5.26"
52
51
  },
52
+ "type": "module",
53
53
  "scripts": {
54
54
  "test": "node --test"
55
55
  }
package/src/index.js CHANGED
@@ -1,8 +1,8 @@
1
- 'use strict';
2
- const valueParser = require('postcss-value-parser');
3
- const { getArguments } = require('cssnano-utils');
4
- const isColorStop = require('./isColorStop.js');
1
+ import valueParser from 'postcss-value-parser';
2
+ import cssnanoUtils from 'cssnano-utils';
3
+ import isColorStop from './isColorStop.js';
5
4
 
5
+ const { getArguments } = cssnanoUtils;
6
6
  const directionsToAngles = new Map([
7
7
  ['top', '0deg'],
8
8
  ['right', '90deg'],
@@ -376,8 +376,8 @@ function pluginCreator() {
376
376
  },
377
377
  };
378
378
  }
379
-
379
+ /** @type {true} */
380
380
  pluginCreator.postcss = true;
381
- module.exports = /** @type {import('postcss').PluginCreator<void>}*/ (
382
- pluginCreator
383
- );
381
+ const moduleExports = pluginCreator;
382
+
383
+ export { moduleExports as default, moduleExports as 'module.exports' };
@@ -1,9 +1,9 @@
1
- 'use strict';
2
- const { unit } = require('postcss-value-parser');
3
- const { colordx: colord, extend } = require('@colordx/core');
4
- const hwbPlugin = require('@colordx/core/plugins/hwb');
5
- const namesPlugin = require('@colordx/core/plugins/names');
1
+ import postcssValueParser from 'postcss-value-parser';
2
+ import { colordx as colord, extend } from '@colordx/core';
3
+ import hwbPlugin from '@colordx/core/plugins/hwb';
4
+ import namesPlugin from '@colordx/core/plugins/names';
6
5
 
6
+ const { unit } = postcssValueParser;
7
7
  extend([
8
8
  /** @type {import('@colordx/core').Plugin} */ (
9
9
  /** @type {unknown} */ (hwbPlugin)
@@ -48,7 +48,7 @@ function isCSSLengthUnit(input) {
48
48
  */
49
49
  function isStop(str) {
50
50
  if (str) {
51
- let isColorStop = false;
51
+ let colorStop = false;
52
52
  const node = unit(str);
53
53
  if (node) {
54
54
  const number = Number(node.number);
@@ -56,12 +56,12 @@ function isStop(str) {
56
56
  number === 0 ||
57
57
  (!Number.isNaN(number) && isCSSLengthUnit(node.unit))
58
58
  ) {
59
- isColorStop = true;
59
+ colorStop = true;
60
60
  }
61
61
  } else {
62
- isColorStop = colorStopRegex.test(str);
62
+ colorStop = colorStopRegex.test(str);
63
63
  }
64
- return isColorStop;
64
+ return colorStop;
65
65
  }
66
66
  return true;
67
67
  }
@@ -70,6 +70,8 @@ function isStop(str) {
70
70
  * @param {string} [stop]
71
71
  * @return {boolean}
72
72
  */
73
- module.exports = function isColorStop(color, stop) {
73
+ function isColorStop(color, stop) {
74
74
  return colord(color).isValid() && isStop(stop);
75
- };
75
+ }
76
+
77
+ export default isColorStop;
package/types/index.d.ts CHANGED
@@ -1,3 +1,10 @@
1
- declare const _exports: import("postcss").PluginCreator<void>;
2
- export = _exports;
1
+ /**
2
+ * @return {import('postcss').Plugin}
3
+ */
4
+ declare function pluginCreator(): import('postcss').Plugin;
5
+ declare namespace pluginCreator {
6
+ var postcss: true;
7
+ }
8
+ declare const moduleExports: typeof pluginCreator;
9
+ export { moduleExports as default, moduleExports as 'module.exports' };
3
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":"AA4WA;;GAEG;AACH,iBAAS,aAAa,IAFV,OAAO,SAAS,EAAE,MAAM,CAYnC;kBAVQ,aAAa;iBAWX,IAAI;;AAEf,QAAA,MAAM,aAAa,sBAAgB,CAAC;AAEpC,OAAO,EAAE,aAAa,IAAI,OAAO,EAAE,aAAa,IAAI,gBAAgB,EAAE,CAAC"}
@@ -1,8 +1,8 @@
1
- export = isColorStop;
2
1
  /**
3
2
  * @param {string} color
4
3
  * @param {string} [stop]
5
4
  * @return {boolean}
6
5
  */
7
6
  declare function isColorStop(color: string, stop?: string): boolean;
7
+ export default isColorStop;
8
8
  //# sourceMappingURL=isColorStop.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"isColorStop.d.ts","sourceRoot":"","sources":["../src/isColorStop.js"],"names":[],"mappings":";AAmEA;;;;GAIG;6BACmC,KAAK,EAJhC,MAIgC,EAAE,IAAI,AAH9C,CACA,EADQ,MAGsC,GAFrC,OAAO"}
1
+ {"version":3,"file":"isColorStop.d.ts","sourceRoot":"","sources":["../src/isColorStop.js"],"names":[],"mappings":"AAmEA;;;;GAIG;AACH,iBAAS,WAAW,CAAC,KAAK,EAJf,MAIe,EAAE,IAAI,AAH7B,CACA,EADQ,MAGqB,GAFpB,OAAO,CAIlB;eAEc,WAAW"}