summaryrefslogtreecommitdiff
path: root/node_modules/postcss-lab-function/dist/index.mjs
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/postcss-lab-function/dist/index.mjs
parent1368909b3cd552dbb0d12d5863c597f5be46177d (diff)
updated node_modules
Diffstat (limited to 'node_modules/postcss-lab-function/dist/index.mjs')
-rw-r--r--node_modules/postcss-lab-function/dist/index.mjs2
1 files changed, 1 insertions, 1 deletions
diff --git a/node_modules/postcss-lab-function/dist/index.mjs b/node_modules/postcss-lab-function/dist/index.mjs
index 7cb9ea59..cd9739dc 100644
--- a/node_modules/postcss-lab-function/dist/index.mjs
+++ b/node_modules/postcss-lab-function/dist/index.mjs
@@ -1 +1 @@
-import s from"@csstools/postcss-progressive-custom-properties";import{tokenize as e}from"@csstools/css-tokenizer";import{color as t,SyntaxFlag as r,serializeRGB as o,colorDataFitsRGB_Gamut as a,serializeP3 as n}from"@csstools/css-color-parser";import{replaceComponentValues as l,parseCommaSeparatedListOfComponentValues as i,isFunctionNode as p,stringify as u}from"@csstools/css-parser-algorithms";function hasFallback(s){const e=s.parent;if(!e)return!1;const t=s.prop.toLowerCase(),r=e.index(s);for(let s=0;s<r;s++){const r=e.nodes[s];if("decl"===r.type&&r.prop.toLowerCase()===t)return!0}return!1}function hasSupportsAtRuleAncestor(s){let e=s.parent;for(;e;)if("atrule"===e.type){if("supports"===e.name.toLowerCase()){if(-1!==e.params.toLowerCase().indexOf("lab("))return!0;if(-1!==e.params.toLowerCase().indexOf("lch("))return!0}e=e.parent}else e=e.parent;return!1}const c=/(lab|lch)\(/i,f=/^(lab|lch)$/i,basePlugin=s=>({postcssPlugin:"postcss-lab-function",Declaration:m=>{const b=m.value;if(!c.test(b))return;if(hasFallback(m))return;if(hasSupportsAtRuleAncestor(m))return;const g=e({css:b}),y=l(i(g),(s=>{if(!p(s)||!f.test(s.getName()))return;const e=t(s);return e&&!(e.syntaxFlags.has(r.Experimental)||e.syntaxFlags.has(r.HasNoneKeywords)||e.syntaxFlags.has(r.RelativeColorSyntax))?o(e):void 0})),d=u(y);if(d===b)return;let h=d;s?.subFeatures.displayP3&&(h=u(l(i(g),(s=>{if(!p(s)||!f.test(s.getName()))return;const e=t(s);return e&&!(e.syntaxFlags.has(r.Experimental)||e.syntaxFlags.has(r.HasNoneKeywords)||e.syntaxFlags.has(r.RelativeColorSyntax))?a(e)?o(e):n(e):void 0})))),m.cloneBefore({value:d}),s?.subFeatures.displayP3&&h!==d&&m.cloneBefore({value:h}),s?.preserve||m.remove()}});basePlugin.postcss=!0;const postcssPlugin=e=>{const t=Object.assign({enableProgressiveCustomProperties:!0,preserve:!1,subFeatures:{displayP3:!0}},e);return t.subFeatures=Object.assign({displayP3:!0},t.subFeatures),t.enableProgressiveCustomProperties&&(t.preserve||t.subFeatures.displayP3)?{postcssPlugin:"postcss-lab-function",plugins:[s(),basePlugin(t)]}:basePlugin(t)};postcssPlugin.postcss=!0;export{postcssPlugin as default};
+import s from"@csstools/postcss-progressive-custom-properties";import{color as e,SyntaxFlag as t,serializeRGB as r,colorDataFitsRGB_Gamut as o,serializeP3 as a}from"@csstools/css-color-parser";import{hasFallback as l,hasSupportsAtRuleAncestor as i}from"@csstools/utilities";import{replaceComponentValues as n,parseCommaSeparatedListOfComponentValues as c,isFunctionNode as u,stringify as p}from"@csstools/css-parser-algorithms";import{tokenize as m}from"@csstools/css-tokenizer";const g=/\b(?:lab|lch)\(/i,f=/^(?:lab|lch)$/i,basePlugin=s=>({postcssPlugin:"postcss-lab-function",Declaration(b){const y=b.value;if(!g.test(y))return;if(l(b))return;if(i(b,g))return;const v=m({css:y}),F=n(c(v),(s=>{if(!u(s)||!f.test(s.getName()))return;const o=e(s);return o&&!(o.syntaxFlags.has(t.Experimental)||o.syntaxFlags.has(t.HasNoneKeywords)||o.syntaxFlags.has(t.RelativeColorSyntax))?r(o):void 0})),x=p(F);if(x===y)return;let P=x;s?.subFeatures.displayP3&&(P=p(n(c(v),(s=>{if(!u(s)||!f.test(s.getName()))return;const l=e(s);return l&&!(l.syntaxFlags.has(t.Experimental)||l.syntaxFlags.has(t.HasNoneKeywords)||l.syntaxFlags.has(t.RelativeColorSyntax))?o(l)?r(l):a(l):void 0})))),b.cloneBefore({value:x}),s?.subFeatures.displayP3&&P!==x&&b.cloneBefore({value:P}),s?.preserve||b.remove()}});basePlugin.postcss=!0;const postcssPlugin=e=>{const t=Object.assign({enableProgressiveCustomProperties:!0,preserve:!1,subFeatures:{displayP3:!0}},e);return t.subFeatures=Object.assign({displayP3:!0},t.subFeatures),t.enableProgressiveCustomProperties&&(t.preserve||t.subFeatures.displayP3)?{postcssPlugin:"postcss-lab-function",plugins:[s(),basePlugin(t)]}:basePlugin(t)};postcssPlugin.postcss=!0;export{postcssPlugin as default};