postcss-double-position-gradients 6.0.4 → 7.0.0

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/CHANGELOG.md CHANGED
@@ -1,9 +1,12 @@
1
1
  # Changes to PostCSS Double Position Gradients
2
2
 
3
- ### 6.0.4
3
+ ### 7.0.0
4
4
 
5
- _September 21, 2025_
5
+ _January 14, 2026_
6
6
 
7
- - Updated [`@csstools/postcss-progressive-custom-properties`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties) to [`4.2.1`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties/CHANGELOG.md#421) (patch)
7
+ - Updated: Support for Node `20.19.0` or later (major).
8
+ - Removed: `commonjs` API. In supported Node versions `require(esm)` will work without needing to make code changes.
9
+ - Updated [`@csstools/utilities`](https://github.com/csstools/postcss-plugins/tree/main/packages/utilities) to [`3.0.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/utilities/CHANGELOG.md#300) (major)
10
+ - Updated [`@csstools/postcss-progressive-custom-properties`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties) to [`5.0.0`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties/CHANGELOG.md#500) (major)
8
11
 
9
12
  [Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-double-position-gradients/CHANGELOG.md)
package/dist/index.d.ts CHANGED
@@ -10,5 +10,6 @@ export declare type pluginOptions = {
10
10
 
11
11
  declare const postcssPlugin: PluginCreator<pluginOptions>;
12
12
  export default postcssPlugin;
13
+ export { postcssPlugin as 'module.exports' }
13
14
 
14
15
  export { }
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import e from"@csstools/postcss-progressive-custom-properties";import t from"postcss-value-parser";import{hasFallback as r,hasSupportsAtRuleAncestor as s}from"@csstools/utilities";const o=/(?:repeating-)?(?:conic|linear|radial)-gradient\(/i,i=/^(?:repeating-)?(?:conic|linear|radial)-gradient$/i,n=["at","bottom","center","circle","closest-corner","closest-side","ellipse","farthest-corner","farthest-side","from","in","left","right","to","top"];function isPunctuationCommaNode(e){return!!e&&"div"===e.type&&","===e.value}function isNumericNode(e){if(!e)return!1;try{return!1!==t.unit(e.value)}catch{return!1}}const basePlugin=e=>({postcssPlugin:"postcss-double-position-gradients",Declaration(a,{result:c}){if(!o.test(a.value))return;if(r(a))return;if(s(a,o))return;let u;try{u=t(a.value)}catch{a.warn(c,`Failed to parse value '${a.value}' as a CSS gradient. Leaving the original value intact.`)}if(void 0===u)return;u.walk(e=>{if("function"!==e.type||!i.test(e.value))return;const t=e.nodes.filter(e=>"comment"!==e.type&&"space"!==e.type);let r=!1;t.forEach((t,s,o)=>{if("word"===t.type&&n.includes(t.value.toLowerCase())&&(r=!0),"div"===t.type&&","===t.value&&(r=!1),r)return;const i=o[s-1],a=o[s-2],c=o[s+1];if(a&&a.type&&isNumericNode(i)&&isNumericNode(t)){const r=a,s={type:"div",value:",",before:isPunctuationCommaNode(c)?c.before:"",after:isPunctuationCommaNode(c)?"":" ",sourceIndex:0,sourceEndIndex:0};e.nodes.splice(e.nodes.indexOf(t)-1,0,s,r)}})});const l=u.toString();l!==a.value&&(a.cloneBefore({value:l}),e?.preserve||a.remove())}});basePlugin.postcss=!0;const postcssPlugin=t=>{const r=Object.assign({enableProgressiveCustomProperties:!0,preserve:!0},t);return r.enableProgressiveCustomProperties&&r.preserve?{postcssPlugin:"postcss-double-position-gradients",plugins:[e(),basePlugin(r)]}:basePlugin(r)};postcssPlugin.postcss=!0;export{postcssPlugin as default};
1
+ import e from"@csstools/postcss-progressive-custom-properties";import t from"postcss-value-parser";import{hasFallback as s,hasSupportsAtRuleAncestor as r}from"@csstools/utilities";const o=/(?:repeating-)?(?:conic|linear|radial)-gradient\(/i,i=/^(?:repeating-)?(?:conic|linear|radial)-gradient$/i,n=["at","bottom","center","circle","closest-corner","closest-side","ellipse","farthest-corner","farthest-side","from","in","left","right","to","top"];function isPunctuationCommaNode(e){return!!e&&"div"===e.type&&","===e.value}function isNumericNode(e){if(!e)return!1;try{return!1!==t.unit(e.value)}catch{return!1}}const basePlugin=e=>({postcssPlugin:"postcss-double-position-gradients",Declaration(a,{result:c}){if(!o.test(a.value))return;if(s(a))return;if(r(a,o))return;let u;try{u=t(a.value)}catch{a.warn(c,`Failed to parse value '${a.value}' as a CSS gradient. Leaving the original value intact.`)}if(void 0===u)return;u.walk(e=>{if("function"!==e.type||!i.test(e.value))return;const t=e.nodes.filter(e=>"comment"!==e.type&&"space"!==e.type);let s=!1;t.forEach((t,r,o)=>{if("word"===t.type&&n.includes(t.value.toLowerCase())&&(s=!0),"div"===t.type&&","===t.value&&(s=!1),s)return;const i=o[r-1],a=o[r-2],c=o[r+1];if(a&&a.type&&isNumericNode(i)&&isNumericNode(t)){const s=a,r={type:"div",value:",",before:isPunctuationCommaNode(c)?c.before:"",after:isPunctuationCommaNode(c)?"":" ",sourceIndex:0,sourceEndIndex:0};e.nodes.splice(e.nodes.indexOf(t)-1,0,r,s)}})});const l=u.toString();l!==a.value&&(a.cloneBefore({value:l}),e?.preserve||a.remove())}});basePlugin.postcss=!0;const postcssPlugin=t=>{const s=Object.assign({enableProgressiveCustomProperties:!0,preserve:!0},t);return s.enableProgressiveCustomProperties&&s.preserve?{postcssPlugin:"postcss-double-position-gradients",plugins:[e(),basePlugin(s)]}:basePlugin(s)};postcssPlugin.postcss=!0;export{postcssPlugin as default,postcssPlugin as"module.exports"};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "postcss-double-position-gradients",
3
3
  "description": "Use double-position gradients in CSS",
4
- "version": "6.0.4",
4
+ "version": "7.0.0",
5
5
  "author": "Jonathan Neal <jonathantneal@hotmail.com>",
6
6
  "license": "MIT-0",
7
7
  "funding": [
@@ -15,20 +15,13 @@
15
15
  }
16
16
  ],
17
17
  "engines": {
18
- "node": ">=18"
18
+ "node": ">=20.19.0"
19
19
  },
20
20
  "type": "module",
21
- "main": "dist/index.cjs",
22
- "module": "dist/index.mjs",
23
21
  "exports": {
24
22
  ".": {
25
- "import": {
26
- "types": "./dist/index.d.ts",
27
- "default": "./dist/index.mjs"
28
- },
29
- "require": {
30
- "default": "./dist/index.cjs"
31
- }
23
+ "types": "./dist/index.d.ts",
24
+ "default": "./dist/index.mjs"
32
25
  }
33
26
  },
34
27
  "files": [
@@ -38,8 +31,8 @@
38
31
  "dist"
39
32
  ],
40
33
  "dependencies": {
41
- "@csstools/postcss-progressive-custom-properties": "^4.2.1",
42
- "@csstools/utilities": "^2.0.0",
34
+ "@csstools/postcss-progressive-custom-properties": "^5.0.0",
35
+ "@csstools/utilities": "^3.0.0",
43
36
  "postcss-value-parser": "^4.2.0"
44
37
  },
45
38
  "peerDependencies": {
package/dist/index.cjs DELETED
@@ -1 +0,0 @@
1
- "use strict";var e=require("@csstools/postcss-progressive-custom-properties"),t=require("postcss-value-parser"),s=require("@csstools/utilities");const r=/(?:repeating-)?(?:conic|linear|radial)-gradient\(/i,o=/^(?:repeating-)?(?:conic|linear|radial)-gradient$/i,i=["at","bottom","center","circle","closest-corner","closest-side","ellipse","farthest-corner","farthest-side","from","in","left","right","to","top"];function isPunctuationCommaNode(e){return!!e&&"div"===e.type&&","===e.value}function isNumericNode(e){if(!e)return!1;try{return!1!==t.unit(e.value)}catch{return!1}}const basePlugin=e=>({postcssPlugin:"postcss-double-position-gradients",Declaration(n,{result:a}){if(!r.test(n.value))return;if(s.hasFallback(n))return;if(s.hasSupportsAtRuleAncestor(n,r))return;let u;try{u=t(n.value)}catch{n.warn(a,`Failed to parse value '${n.value}' as a CSS gradient. Leaving the original value intact.`)}if(void 0===u)return;u.walk(e=>{if("function"!==e.type||!o.test(e.value))return;const t=e.nodes.filter(e=>"comment"!==e.type&&"space"!==e.type);let s=!1;t.forEach((t,r,o)=>{if("word"===t.type&&i.includes(t.value.toLowerCase())&&(s=!0),"div"===t.type&&","===t.value&&(s=!1),s)return;const n=o[r-1],a=o[r-2],u=o[r+1];if(a&&a.type&&isNumericNode(n)&&isNumericNode(t)){const s=a,r={type:"div",value:",",before:isPunctuationCommaNode(u)?u.before:"",after:isPunctuationCommaNode(u)?"":" ",sourceIndex:0,sourceEndIndex:0};e.nodes.splice(e.nodes.indexOf(t)-1,0,r,s)}})});const c=u.toString();c!==n.value&&(n.cloneBefore({value:c}),e?.preserve||n.remove())}});basePlugin.postcss=!0;const postcssPlugin=t=>{const s=Object.assign({enableProgressiveCustomProperties:!0,preserve:!0},t);return s.enableProgressiveCustomProperties&&s.preserve?{postcssPlugin:"postcss-double-position-gradients",plugins:[e(),basePlugin(s)]}:basePlugin(s)};postcssPlugin.postcss=!0,module.exports=postcssPlugin;