summaryrefslogtreecommitdiff
path: root/node_modules/@csstools/postcss-nested-calc
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2024-05-14 14:05:49 +0800
committerlittleblack111 <littleblack11111@gmail.com>2024-05-14 14:05:49 +0800
commit06823fbf1c2e763a5bf76c3990ca98fbbcd98691 (patch)
tree4280bece3888d12a022093bf1a9cd1b049393602 /node_modules/@csstools/postcss-nested-calc
parent1368909b3cd552dbb0d12d5863c597f5be46177d (diff)
updated node_modules
Diffstat (limited to 'node_modules/@csstools/postcss-nested-calc')
-rw-r--r--node_modules/@csstools/postcss-nested-calc/CHANGELOG.md12
-rw-r--r--node_modules/@csstools/postcss-nested-calc/README.md2
-rw-r--r--node_modules/@csstools/postcss-nested-calc/dist/index.cjs2
-rw-r--r--node_modules/@csstools/postcss-nested-calc/dist/index.mjs2
-rw-r--r--node_modules/@csstools/postcss-nested-calc/package.json3
5 files changed, 11 insertions, 10 deletions
diff --git a/node_modules/@csstools/postcss-nested-calc/CHANGELOG.md b/node_modules/@csstools/postcss-nested-calc/CHANGELOG.md
index bd4cf68e..6d369f34 100644
--- a/node_modules/@csstools/postcss-nested-calc/CHANGELOG.md
+++ b/node_modules/@csstools/postcss-nested-calc/CHANGELOG.md
@@ -1,5 +1,11 @@
# Changes to PostCSS Nested Calc
+### 3.0.2
+
+_February 19, 2024_
+
+- Reuse code with `@csstools/utilities`
+
### 3.0.1
_December 15, 2023_
@@ -12,10 +18,4 @@ _July 3, 2023_
- Change license to `MIT-0` ([read more about this change in the blog post](https://preset-env.cssdb.org/blog/license-change/))
-### 2.0.2
-
-_February 9, 2023_
-
-- Reduce the amount of duplicate fallback CSS.
-
[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-nested-calc/CHANGELOG.md)
diff --git a/node_modules/@csstools/postcss-nested-calc/README.md b/node_modules/@csstools/postcss-nested-calc/README.md
index 5b822e35..ce6119f4 100644
--- a/node_modules/@csstools/postcss-nested-calc/README.md
+++ b/node_modules/@csstools/postcss-nested-calc/README.md
@@ -1,6 +1,6 @@
# PostCSS Nested Calc [<img src="https://postcss.github.io/postcss/logo.svg" alt="PostCSS Logo" width="90" height="90" align="right">][PostCSS]
-[<img alt="npm version" src="https://img.shields.io/npm/v/@csstools/postcss-nested-calc.svg" height="20">][npm-url] [<img alt="CSS Standard Status" src="https://cssdb.org/images/badges/nested-calc.svg" height="20">][css-url] [<img alt="Build Status" src="https://github.com/csstools/postcss-plugins/workflows/test/badge.svg" height="20">][cli-url] [<img alt="Discord" src="https://shields.io/badge/Discord-5865F2?logo=discord&logoColor=white">][discord]
+[<img alt="npm version" src="https://img.shields.io/npm/v/@csstools/postcss-nested-calc.svg" height="20">][npm-url] [<img alt="Build Status" src="https://github.com/csstools/postcss-plugins/workflows/test/badge.svg" height="20">][cli-url] [<img alt="Discord" src="https://shields.io/badge/Discord-5865F2?logo=discord&logoColor=white">][discord]<br><br>[<img alt="Baseline Status" src="https://cssdb.org/images/badges-baseline/nested-calc.svg" height="20">][css-url] [<img alt="CSS Standard Status" src="https://cssdb.org/images/badges/nested-calc.svg" height="20">][css-url]
```bash
npm install @csstools/postcss-nested-calc --save-dev
diff --git a/node_modules/@csstools/postcss-nested-calc/dist/index.cjs b/node_modules/@csstools/postcss-nested-calc/dist/index.cjs
index a52f3cd7..27ae530a 100644
--- a/node_modules/@csstools/postcss-nested-calc/dist/index.cjs
+++ b/node_modules/@csstools/postcss-nested-calc/dist/index.cjs
@@ -1 +1 @@
-"use strict";var e=require("postcss-value-parser");const t=/calc\(/gim;function hasFallback(e){const t=e.parent;if(!t)return!1;const r=t.index(e);for(let a=0;a<r;a++){const r=t.nodes[a];if("decl"===r.type&&r.prop.toLowerCase()===e.prop.toLowerCase())return!0}return!1}const creator=r=>{const a=Object.assign({preserve:!0},r);return{postcssPlugin:"postcss-nested-calc",Declaration(r,{result:n}){if((r.value.match(t)||[]).length<2)return;if(r.variable)return;if(hasFallback(r))return;const o=r.value;let s;try{s=e(o)}catch(e){return void r.warn(n,`Failed to parse value '${o}'. Leaving the original value intact.`)}if(void 0===s)return;e.walk(s.nodes,(t=>{t.type&&"function"===t.type&&"calc"===t.value.toLowerCase()&&e.walk(t.nodes,(e=>{if(e.type&&"function"===e.type)return"calc"===e.value.toLowerCase()&&void(e.value="")}))}),!0);const c=String(s);c!==o&&(r.cloneBefore({value:c}),a.preserve||r.remove())}}};creator.postcss=!0,module.exports=creator;
+"use strict";var e=require("postcss-value-parser"),t=require("@csstools/utilities");const r=/calc\(/gim;const creator=s=>{const a=Object.assign({preserve:!0},s);return{postcssPlugin:"postcss-nested-calc",Declaration(s,{result:o}){if((s.value.match(r)||[]).length<2)return;if(s.variable)return;if(t.hasFallback(s))return;const c=s.value;let l;try{l=e(c)}catch(e){return void s.warn(o,`Failed to parse value '${c}'. Leaving the original value intact.`)}if(void 0===l)return;e.walk(l.nodes,(t=>{t.type&&"function"===t.type&&"calc"===t.value.toLowerCase()&&e.walk(t.nodes,(e=>{if(e.type&&"function"===e.type)return"calc"===e.value.toLowerCase()&&void(e.value="")}))}),!0);const n=String(l);n!==c&&(s.cloneBefore({value:n}),a.preserve||s.remove())}}};creator.postcss=!0,module.exports=creator;
diff --git a/node_modules/@csstools/postcss-nested-calc/dist/index.mjs b/node_modules/@csstools/postcss-nested-calc/dist/index.mjs
index 41363381..5ef02cad 100644
--- a/node_modules/@csstools/postcss-nested-calc/dist/index.mjs
+++ b/node_modules/@csstools/postcss-nested-calc/dist/index.mjs
@@ -1 +1 @@
-import e from"postcss-value-parser";const t=/calc\(/gim;function hasFallback(e){const t=e.parent;if(!t)return!1;const r=t.index(e);for(let a=0;a<r;a++){const r=t.nodes[a];if("decl"===r.type&&r.prop.toLowerCase()===e.prop.toLowerCase())return!0}return!1}const creator=r=>{const a=Object.assign({preserve:!0},r);return{postcssPlugin:"postcss-nested-calc",Declaration(r,{result:o}){if((r.value.match(t)||[]).length<2)return;if(r.variable)return;if(hasFallback(r))return;const n=r.value;let s;try{s=e(n)}catch(e){return void r.warn(o,`Failed to parse value '${n}'. Leaving the original value intact.`)}if(void 0===s)return;e.walk(s.nodes,(t=>{t.type&&"function"===t.type&&"calc"===t.value.toLowerCase()&&e.walk(t.nodes,(e=>{if(e.type&&"function"===e.type)return"calc"===e.value.toLowerCase()&&void(e.value="")}))}),!0);const c=String(s);c!==n&&(r.cloneBefore({value:c}),a.preserve||r.remove())}}};creator.postcss=!0;export{creator as default};
+import e from"postcss-value-parser";import{hasFallback as t}from"@csstools/utilities";const r=/calc\(/gim;const creator=s=>{const a=Object.assign({preserve:!0},s);return{postcssPlugin:"postcss-nested-calc",Declaration(s,{result:o}){if((s.value.match(r)||[]).length<2)return;if(s.variable)return;if(t(s))return;const n=s.value;let c;try{c=e(n)}catch(e){return void s.warn(o,`Failed to parse value '${n}'. Leaving the original value intact.`)}if(void 0===c)return;e.walk(c.nodes,(t=>{t.type&&"function"===t.type&&"calc"===t.value.toLowerCase()&&e.walk(t.nodes,(e=>{if(e.type&&"function"===e.type)return"calc"===e.value.toLowerCase()&&void(e.value="")}))}),!0);const l=String(c);l!==n&&(s.cloneBefore({value:l}),a.preserve||s.remove())}}};creator.postcss=!0;export{creator as default};
diff --git a/node_modules/@csstools/postcss-nested-calc/package.json b/node_modules/@csstools/postcss-nested-calc/package.json
index d4bb4e20..032d4110 100644
--- a/node_modules/@csstools/postcss-nested-calc/package.json
+++ b/node_modules/@csstools/postcss-nested-calc/package.json
@@ -1,7 +1,7 @@
{
"name": "@csstools/postcss-nested-calc",
"description": "Use nested calc() expressions in CSS",
- "version": "3.0.1",
+ "version": "3.0.2",
"contributors": [
{
"name": "Antonio Laguna",
@@ -48,6 +48,7 @@
"dist"
],
"dependencies": {
+ "@csstools/utilities": "^1.0.0",
"postcss-value-parser": "^4.2.0"
},
"peerDependencies": {