summaryrefslogtreecommitdiff
path: root/node_modules/postcss-color-hex-alpha/dist
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/postcss-color-hex-alpha/dist')
-rw-r--r--node_modules/postcss-color-hex-alpha/dist/index.cjs1
-rw-r--r--node_modules/postcss-color-hex-alpha/dist/index.d.ts12
-rw-r--r--node_modules/postcss-color-hex-alpha/dist/index.mjs1
3 files changed, 0 insertions, 14 deletions
diff --git a/node_modules/postcss-color-hex-alpha/dist/index.cjs b/node_modules/postcss-color-hex-alpha/dist/index.cjs
deleted file mode 100644
index bd64bbe9..00000000
--- a/node_modules/postcss-color-hex-alpha/dist/index.cjs
+++ /dev/null
@@ -1 +0,0 @@
-"use strict";var e=require("postcss-value-parser"),s=require("@csstools/utilities");const creator=t=>{const r=Object.assign({preserve:!1},t);return{postcssPlugin:"postcss-color-hex-alpha",Declaration(t){if(!/#([0-9A-Fa-f]{4}(?:[0-9A-Fa-f]{4})?)\b/.test(t.value))return;if(s.hasFallback(t))return;const{value:a}=t,l=e(a);l.walk((e=>{if("function"===e.type&&"url"===e.value)return!1;isAlphaHex(e)&&hexa2rgba(e)}));const c=l.toString();c!==a&&(t.cloneBefore({value:c}),r.preserve||t.remove())}}};function isAlphaHex(e){return"word"===e.type&&/^#([0-9A-Fa-f]{4}(?:[0-9A-Fa-f]{4})?)$/.test(e.value)}creator.postcss=!0;const t=1e5,hexa2rgba=e=>{const s=e.value,r=`0x${5===s.length?s.slice(1).replace(/[0-9A-Fa-f]/g,"$&$&"):s.slice(1)}`,[a,l,c,n]=[parseInt(r.slice(2,4),16),parseInt(r.slice(4,6),16),parseInt(r.slice(6,8),16),Math.round(parseInt(r.slice(8,10),16)/255*t)/t];e.value=`rgba(${a},${l},${c},${n})`};module.exports=creator;
diff --git a/node_modules/postcss-color-hex-alpha/dist/index.d.ts b/node_modules/postcss-color-hex-alpha/dist/index.d.ts
deleted file mode 100644
index ce39d2bc..00000000
--- a/node_modules/postcss-color-hex-alpha/dist/index.d.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-import type { PluginCreator } from 'postcss';
-
-declare const creator: PluginCreator<pluginOptions>;
-export default creator;
-
-/** postcss-color-hex-alpha plugin options */
-export declare type pluginOptions = {
- /** Preserve the original notation. default: false */
- preserve?: boolean;
-};
-
-export { }
diff --git a/node_modules/postcss-color-hex-alpha/dist/index.mjs b/node_modules/postcss-color-hex-alpha/dist/index.mjs
deleted file mode 100644
index d1d4624e..00000000
--- a/node_modules/postcss-color-hex-alpha/dist/index.mjs
+++ /dev/null
@@ -1 +0,0 @@
-import e from"postcss-value-parser";import{hasFallback as s}from"@csstools/utilities";const creator=t=>{const r=Object.assign({preserve:!1},t);return{postcssPlugin:"postcss-color-hex-alpha",Declaration(t){if(!/#([0-9A-Fa-f]{4}(?:[0-9A-Fa-f]{4})?)\b/.test(t.value))return;if(s(t))return;const{value:a}=t,l=e(a);l.walk((e=>{if("function"===e.type&&"url"===e.value)return!1;isAlphaHex(e)&&hexa2rgba(e)}));const o=l.toString();o!==a&&(t.cloneBefore({value:o}),r.preserve||t.remove())}}};function isAlphaHex(e){return"word"===e.type&&/^#([0-9A-Fa-f]{4}(?:[0-9A-Fa-f]{4})?)$/.test(e.value)}creator.postcss=!0;const t=1e5,hexa2rgba=e=>{const s=e.value,r=`0x${5===s.length?s.slice(1).replace(/[0-9A-Fa-f]/g,"$&$&"):s.slice(1)}`,[a,l,o,n]=[parseInt(r.slice(2,4),16),parseInt(r.slice(4,6),16),parseInt(r.slice(6,8),16),Math.round(parseInt(r.slice(8,10),16)/255*t)/t];e.value=`rgba(${a},${l},${o},${n})`};export{creator as default};