summaryrefslogtreecommitdiff
path: root/node_modules/postcss-color-hex-alpha
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-color-hex-alpha
parent1368909b3cd552dbb0d12d5863c597f5be46177d (diff)
updated node_modules
Diffstat (limited to 'node_modules/postcss-color-hex-alpha')
-rw-r--r--node_modules/postcss-color-hex-alpha/CHANGELOG.md12
-rw-r--r--node_modules/postcss-color-hex-alpha/README.md2
-rw-r--r--node_modules/postcss-color-hex-alpha/dist/index.cjs2
-rw-r--r--node_modules/postcss-color-hex-alpha/dist/index.mjs2
-rw-r--r--node_modules/postcss-color-hex-alpha/package.json3
5 files changed, 11 insertions, 10 deletions
diff --git a/node_modules/postcss-color-hex-alpha/CHANGELOG.md b/node_modules/postcss-color-hex-alpha/CHANGELOG.md
index e86c9da3..f92bca0c 100644
--- a/node_modules/postcss-color-hex-alpha/CHANGELOG.md
+++ b/node_modules/postcss-color-hex-alpha/CHANGELOG.md
@@ -1,5 +1,11 @@
# Changes to PostCSS Color Hex Alpha
+### 9.0.4
+
+_February 19, 2024_
+
+- Reuse code with `@csstools/utilities`
+
### 9.0.3
_December 15, 2023_
@@ -12,10 +18,4 @@ _February 6, 2023_
- Reduce the amount of duplicate fallback CSS.
-### 9.0.1
-
-_January 28, 2023_
-
-- Improve `types` declaration in `package.json`
-
[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-color-hex-alpha/CHANGELOG.md)
diff --git a/node_modules/postcss-color-hex-alpha/README.md b/node_modules/postcss-color-hex-alpha/README.md
index 8011cb87..43c61092 100644
--- a/node_modules/postcss-color-hex-alpha/README.md
+++ b/node_modules/postcss-color-hex-alpha/README.md
@@ -1,6 +1,6 @@
# PostCSS Color Hex Alpha [<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/postcss-color-hex-alpha.svg" height="20">][npm-url] [<img alt="CSS Standard Status" src="https://cssdb.org/images/badges/hexadecimal-alpha-notation.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/postcss-color-hex-alpha.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/hexadecimal-alpha-notation.svg" height="20">][css-url] [<img alt="CSS Standard Status" src="https://cssdb.org/images/badges/hexadecimal-alpha-notation.svg" height="20">][css-url]
```bash
npm install postcss-color-hex-alpha --save-dev
diff --git a/node_modules/postcss-color-hex-alpha/dist/index.cjs b/node_modules/postcss-color-hex-alpha/dist/index.cjs
index a77b6ad3..bd64bbe9 100644
--- a/node_modules/postcss-color-hex-alpha/dist/index.cjs
+++ b/node_modules/postcss-color-hex-alpha/dist/index.cjs
@@ -1 +1 @@
-"use strict";var e=require("postcss-value-parser");function hasFallback(e){const s=e.parent;if(!s)return!1;const t=e.prop.toLowerCase(),r=s.index(e);for(let e=0;e<r;e++){const r=s.nodes[e];if("decl"===r.type&&r.prop.toLowerCase()===t)return!0}return!1}const creator=s=>{const t=Object.assign({preserve:!1},s);return{postcssPlugin:"postcss-color-hex-alpha",Declaration(s){if(!/#([0-9A-Fa-f]{4}(?:[0-9A-Fa-f]{4})?)\b/.test(s.value))return;if(hasFallback(s))return;const{value:r}=s,a=e(r);a.walk((e=>{if("function"===e.type&&"url"===e.value)return!1;isAlphaHex(e)&&hexa2rgba(e)}));const n=a.toString();n!==r&&(s.cloneBefore({value:n}),t.preserve||s.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 s=1e5,hexa2rgba=e=>{const t=e.value,r=`0x${5===t.length?t.slice(1).replace(/[0-9A-Fa-f]/g,"$&$&"):t.slice(1)}`,[a,n,o,l]=[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*s)/s];e.value=`rgba(${a},${n},${o},${l})`};module.exports=creator;
+"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.mjs b/node_modules/postcss-color-hex-alpha/dist/index.mjs
index bc844333..d1d4624e 100644
--- a/node_modules/postcss-color-hex-alpha/dist/index.mjs
+++ b/node_modules/postcss-color-hex-alpha/dist/index.mjs
@@ -1 +1 @@
-import e from"postcss-value-parser";function hasFallback(e){const t=e.parent;if(!t)return!1;const s=e.prop.toLowerCase(),r=t.index(e);for(let e=0;e<r;e++){const r=t.nodes[e];if("decl"===r.type&&r.prop.toLowerCase()===s)return!0}return!1}const creator=t=>{const s=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(hasFallback(t))return;const{value:r}=t,a=e(r);a.walk((e=>{if("function"===e.type&&"url"===e.value)return!1;isAlphaHex(e)&&hexa2rgba(e)}));const n=a.toString();n!==r&&(t.cloneBefore({value:n}),s.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,n,o,l]=[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},${n},${o},${l})`};export{creator as default};
+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};
diff --git a/node_modules/postcss-color-hex-alpha/package.json b/node_modules/postcss-color-hex-alpha/package.json
index e55b97d4..a05752f8 100644
--- a/node_modules/postcss-color-hex-alpha/package.json
+++ b/node_modules/postcss-color-hex-alpha/package.json
@@ -1,7 +1,7 @@
{
"name": "postcss-color-hex-alpha",
"description": "Use 4 & 8 character hex color notation in CSS",
- "version": "9.0.3",
+ "version": "9.0.4",
"contributors": [
{
"name": "Antonio Laguna",
@@ -55,6 +55,7 @@
"dist"
],
"dependencies": {
+ "@csstools/utilities": "^1.0.0",
"postcss-value-parser": "^4.2.0"
},
"peerDependencies": {