postcss-double-position-gradients 3.0.4 → 3.0.5
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 +4 -0
- package/README.md +3 -3
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +9 -2
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# PostCSS Double Position Gradients [<img src="https://postcss.github.io/postcss/logo.svg" alt="PostCSS" width="90" height="90" align="right">][postcss]
|
|
2
2
|
|
|
3
3
|
[<img alt="NPM Version" src="https://img.shields.io/npm/v/postcss-double-position-gradients.svg" height="20">][npm-url]
|
|
4
|
-
[<img alt="CSS Standard Status" src="https://cssdb.org/
|
|
5
|
-
[<img alt="
|
|
4
|
+
[<img alt="CSS Standard Status" src="https://cssdb.org/images/badges/double-position-gradients.svg" height="20">][css-url]
|
|
5
|
+
[<img alt="Discord" src="https://shields.io/badge/Discord-5865F2?logo=discord&logoColor=white">][discord]
|
|
6
6
|
|
|
7
7
|
[PostCSS Double Position Gradients] lets you use double-position gradients in
|
|
8
8
|
CSS, following the [CSS Image Values and Replaced Content] specification.
|
|
@@ -93,7 +93,7 @@ postcssDoublePositionGradients({ preserve: false })
|
|
|
93
93
|
```
|
|
94
94
|
|
|
95
95
|
[css-url]: https://cssdb.org/#double-position-gradients
|
|
96
|
-
[
|
|
96
|
+
[discord]: https://discord.gg/bUadyRwkJS
|
|
97
97
|
[npm-url]: https://www.npmjs.com/package/postcss-double-position-gradients
|
|
98
98
|
|
|
99
99
|
[CSS Image Values and Replaced Content]: https://www.w3.org/TR/css-images-4/#color-stop-syntax
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=e(require("postcss-value-parser"));const r=/(repeating-)?(conic|linear|radial)-gradient\([\W\w]*\)/i,n=/^(repeating-)?(conic|linear|radial)-gradient$/i,a=e=>"div"===e.type&&","===e.value;function i(e){try{return!1!==t.default.unit(null==e?void 0:e.value)}catch(e){return!1}}function o(e){const o=!("preserve"in Object(e))||Boolean(e.preserve);return{postcssPlugin:"postcss-double-position-gradients",Declaration(e,{result:l}){if(!r.test(e.value))return;let u;try{u=t.default(e.value)}catch(t){e.warn(l,`Failed to parse value '${e.value}' as a CSS gradient. Leaving the original value intact.`)}if(void 0===u)return;u.walk((e=>{if("function"!==e.type||!n.test(e.value))return;return e.nodes.filter((e=>"comment"!==e.type&&"space"!==e.type)).forEach(((t,r,n)=>{const o=Object(n[r-1]),l=Object(n[r-2]),u=Object(n[r+1]);if(l.type&&i(o)&&i(t)){const r={type:l.type,value:l.value},n={type:"div",value:",",before:a(u)?u.before:"",after:a(u)?"":" "};!function(e,t,...r){const n=e.findIndex((e=>e===t));e.splice.apply(e,[n-1,0].concat(Array.prototype.slice.call(...r,0)))}(e.nodes,t,[n,r])}})),!1}));const c=u.toString();if(c!==e.value){if(o)return void e.cloneBefore({value:c});e.value=c}}}}o.postcss=!0,module.exports=o;
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import e from"postcss-value-parser";const t=/(repeating-)?(conic|linear|radial)-gradient\([\W\w]*\)/i,r=/^(repeating-)?(conic|linear|radial)-gradient$/i,a=e=>"div"===e.type&&","===e.value;function n(t){try{return!1!==e.unit(null==t?void 0:t.value)}catch(e){return!1}}function i(i){const o=!("preserve"in Object(i))||Boolean(i.preserve);return{postcssPlugin:"postcss-double-position-gradients",Declaration(i,{result:l}){if(!t.test(i.value))return;let c;try{c=e(i.value)}catch(e){i.warn(l,`Failed to parse value '${i.value}' as a CSS gradient. Leaving the original value intact.`)}if(void 0===c)return;c.walk((e=>{if("function"!==e.type||!r.test(e.value))return;return e.nodes.filter((e=>"comment"!==e.type&&"space"!==e.type)).forEach(((t,r,i)=>{const o=Object(i[r-1]),l=Object(i[r-2]),c=Object(i[r+1]);if(l.type&&n(o)&&n(t)){const r={type:l.type,value:l.value},n={type:"div",value:",",before:a(c)?c.before:"",after:a(c)?"":" "};!function(e,t,...r){const a=e.findIndex((e=>e===t));e.splice.apply(e,[a-1,0].concat(Array.prototype.slice.call(...r,0)))}(e.nodes,t,[n,r])}})),!1}));const s=c.toString();if(s!==i.value){if(o)return void i.cloneBefore({value:s});i.value=s}}}}i.postcss=!0;export{i as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "postcss-double-position-gradients",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.5",
|
|
4
4
|
"description": "Use double-position gradients in CSS",
|
|
5
5
|
"author": "Jonathan Neal <jonathantneal@hotmail.com>",
|
|
6
6
|
"license": "CC0-1.0",
|
|
@@ -8,6 +8,13 @@
|
|
|
8
8
|
"bugs": "https://github.com/csstools/postcss-plugins/issues",
|
|
9
9
|
"main": "dist/index.cjs",
|
|
10
10
|
"module": "dist/index.mjs",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"import": "./dist/index.mjs",
|
|
14
|
+
"require": "./dist/index.cjs",
|
|
15
|
+
"default": "./dist/index.mjs"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
11
18
|
"files": [
|
|
12
19
|
"CHANGELOG.md",
|
|
13
20
|
"LICENSE.md",
|
|
@@ -34,7 +41,7 @@
|
|
|
34
41
|
"postcss-tape": "^6.0.1"
|
|
35
42
|
},
|
|
36
43
|
"peerDependencies": {
|
|
37
|
-
"postcss": "^8.
|
|
44
|
+
"postcss": "^8.4"
|
|
38
45
|
},
|
|
39
46
|
"keywords": [
|
|
40
47
|
"postcss",
|