summaryrefslogtreecommitdiff
path: root/node_modules/@csstools/postcss-nested-calc/dist
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/@csstools/postcss-nested-calc/dist')
-rw-r--r--node_modules/@csstools/postcss-nested-calc/dist/has-fallback-decl.d.ts2
-rw-r--r--node_modules/@csstools/postcss-nested-calc/dist/index.cjs1
-rw-r--r--node_modules/@csstools/postcss-nested-calc/dist/index.d.ts8
-rw-r--r--node_modules/@csstools/postcss-nested-calc/dist/index.mjs1
-rw-r--r--node_modules/@csstools/postcss-nested-calc/dist/occurrences.d.ts1
5 files changed, 13 insertions, 0 deletions
diff --git a/node_modules/@csstools/postcss-nested-calc/dist/has-fallback-decl.d.ts b/node_modules/@csstools/postcss-nested-calc/dist/has-fallback-decl.d.ts
new file mode 100644
index 00000000..d7ae8d89
--- /dev/null
+++ b/node_modules/@csstools/postcss-nested-calc/dist/has-fallback-decl.d.ts
@@ -0,0 +1,2 @@
+import type { Declaration } from 'postcss';
+export declare function hasFallback(node: Declaration): boolean;
diff --git a/node_modules/@csstools/postcss-nested-calc/dist/index.cjs b/node_modules/@csstools/postcss-nested-calc/dist/index.cjs
new file mode 100644
index 00000000..a52f3cd7
--- /dev/null
+++ b/node_modules/@csstools/postcss-nested-calc/dist/index.cjs
@@ -0,0 +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;
diff --git a/node_modules/@csstools/postcss-nested-calc/dist/index.d.ts b/node_modules/@csstools/postcss-nested-calc/dist/index.d.ts
new file mode 100644
index 00000000..139448be
--- /dev/null
+++ b/node_modules/@csstools/postcss-nested-calc/dist/index.d.ts
@@ -0,0 +1,8 @@
+import type { PluginCreator } from 'postcss';
+/** postcss-nested-calc plugin options */
+export type pluginOptions = {
+ /** Preserve the original notation. default: true */
+ preserve?: boolean;
+};
+declare const creator: PluginCreator<pluginOptions>;
+export default creator;
diff --git a/node_modules/@csstools/postcss-nested-calc/dist/index.mjs b/node_modules/@csstools/postcss-nested-calc/dist/index.mjs
new file mode 100644
index 00000000..41363381
--- /dev/null
+++ b/node_modules/@csstools/postcss-nested-calc/dist/index.mjs
@@ -0,0 +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};
diff --git a/node_modules/@csstools/postcss-nested-calc/dist/occurrences.d.ts b/node_modules/@csstools/postcss-nested-calc/dist/occurrences.d.ts
new file mode 100644
index 00000000..61f8b784
--- /dev/null
+++ b/node_modules/@csstools/postcss-nested-calc/dist/occurrences.d.ts
@@ -0,0 +1 @@
+export declare function numberOfCalcOccurrences(value: string): number;