summaryrefslogtreecommitdiff
path: root/node_modules/@csstools/postcss-trigonometric-functions/dist/index.cjs
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/@csstools/postcss-trigonometric-functions/dist/index.cjs')
-rw-r--r--node_modules/@csstools/postcss-trigonometric-functions/dist/index.cjs1
1 files changed, 1 insertions, 0 deletions
diff --git a/node_modules/@csstools/postcss-trigonometric-functions/dist/index.cjs b/node_modules/@csstools/postcss-trigonometric-functions/dist/index.cjs
new file mode 100644
index 00000000..6fe36838
--- /dev/null
+++ b/node_modules/@csstools/postcss-trigonometric-functions/dist/index.cjs
@@ -0,0 +1 @@
+"use strict";var s=require("@csstools/css-calc"),e=require("@csstools/css-parser-algorithms"),o=require("@csstools/css-tokenizer");const t=["asin","acos","atan","atan2","sin","cos","tan"],n=new RegExp(`^(${t.join("|")})$`,"i"),c=new RegExp(`(${t.join("|")})\\(`,"i");function calc(t){const c=o.tokenize({css:t});return c.some((s=>s[0]===o.TokenType.Function&&n.test(s[4].value)))?e.stringify(s.calcFromComponentValues(e.parseCommaSeparatedListOfComponentValues(c),{precision:5,toCanonicalUnits:!0})):t}const creator=s=>{const e=Object.assign({preserve:!1},s);return{postcssPlugin:"postcss-trigonometric-functions",Declaration(s){if(!c.test(s.value))return;const o=calc(s.value);o!==s.value&&(s.cloneBefore({value:o}),e.preserve||s.remove())}}};creator.postcss=!0,module.exports=creator;