@csstools/postcss-color-function-display-p3-linear 1.0.1 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3 -3
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +1 -1
- package/package.json +9 -16
- package/dist/index.cjs +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# Changes to PostCSS Color Function Display P3 Linear
|
|
2
2
|
|
|
3
|
-
###
|
|
3
|
+
### 2.0.1
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
_January 25, 2026_
|
|
6
6
|
|
|
7
|
-
- Updated [`@csstools/
|
|
7
|
+
- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`4.0.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#401) (patch)
|
|
8
8
|
|
|
9
9
|
[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-color-function-display-p3-linear/CHANGELOG.md)
|
package/dist/index.d.ts
CHANGED
|
@@ -11,5 +11,6 @@ export declare type pluginOptions = {
|
|
|
11
11
|
/** Transform the display-p3-linear color space in the color() function in CSS. */
|
|
12
12
|
declare const postcssPlugin: PluginCreator<pluginOptions>;
|
|
13
13
|
export default postcssPlugin;
|
|
14
|
+
export { postcssPlugin as 'module.exports' }
|
|
14
15
|
|
|
15
16
|
export { }
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import s from"@csstools/postcss-progressive-custom-properties";import{tokenize as o}from"@csstools/css-tokenizer";import{color as r,ColorNotation as e,SyntaxFlag as t,serializeP3 as i}from"@csstools/css-color-parser";import{hasFallback as n,hasSupportsAtRuleAncestor as c}from"@csstools/utilities";import{replaceComponentValues as l,parseCommaSeparatedListOfComponentValues as p,isFunctionNode as a,stringify as u}from"@csstools/css-parser-algorithms";const m=/\bdisplay-p3-linear\b/i,f=/^color$/i,basePlugin=s=>({postcssPlugin:"postcss-color-function-display-p3-linear",Declaration(g){const v=g.value;if(!m.test(v))return;if(n(g))return;if(c(g,m))return;const
|
|
1
|
+
import s from"@csstools/postcss-progressive-custom-properties";import{tokenize as o}from"@csstools/css-tokenizer";import{color as r,ColorNotation as e,SyntaxFlag as t,serializeP3 as i}from"@csstools/css-color-parser";import{hasFallback as n,hasSupportsAtRuleAncestor as c}from"@csstools/utilities";import{replaceComponentValues as l,parseCommaSeparatedListOfComponentValues as p,isFunctionNode as a,stringify as u}from"@csstools/css-parser-algorithms";const m=/\bdisplay-p3-linear\b/i,f=/^color$/i,basePlugin=s=>({postcssPlugin:"postcss-color-function-display-p3-linear",Declaration(g){const v=g.value;if(!m.test(v))return;if(n(g))return;if(c(g,m))return;const d=o({css:v}),y=l(p(d),s=>{if(!a(s)||!f.test(s.getName()))return;const o=r(s);return!o||o.colorNotation!==e.Linear_Display_P3||o.syntaxFlags.has(t.Experimental)||o.syntaxFlags.has(t.HasNoneKeywords)?void 0:i(o)}),P=u(y);P!==v&&(g.cloneBefore({value:P}),s?.preserve||g.remove())}});basePlugin.postcss=!0;const postcssPlugin=o=>{const r=Object.assign({preserve:!1,enableProgressiveCustomProperties:!0},o);return r.enableProgressiveCustomProperties&&r.preserve?{postcssPlugin:"postcss-color-function-display-p3-linear",plugins:[s(),basePlugin(r)]}:basePlugin(r)};postcssPlugin.postcss=!0;export{postcssPlugin as default,postcssPlugin as"module.exports"};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@csstools/postcss-color-function-display-p3-linear",
|
|
3
3
|
"description": "Use the display-p3-linear color space on the color() function in CSS",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "2.0.1",
|
|
5
5
|
"contributors": [
|
|
6
6
|
{
|
|
7
7
|
"name": "Romain Menke",
|
|
@@ -20,20 +20,13 @@
|
|
|
20
20
|
}
|
|
21
21
|
],
|
|
22
22
|
"engines": {
|
|
23
|
-
"node": ">=
|
|
23
|
+
"node": ">=20.19.0"
|
|
24
24
|
},
|
|
25
25
|
"type": "module",
|
|
26
|
-
"main": "dist/index.cjs",
|
|
27
|
-
"module": "dist/index.mjs",
|
|
28
26
|
"exports": {
|
|
29
27
|
".": {
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
"default": "./dist/index.mjs"
|
|
33
|
-
},
|
|
34
|
-
"require": {
|
|
35
|
-
"default": "./dist/index.cjs"
|
|
36
|
-
}
|
|
28
|
+
"types": "./dist/index.d.ts",
|
|
29
|
+
"default": "./dist/index.mjs"
|
|
37
30
|
}
|
|
38
31
|
},
|
|
39
32
|
"files": [
|
|
@@ -43,11 +36,11 @@
|
|
|
43
36
|
"dist"
|
|
44
37
|
],
|
|
45
38
|
"dependencies": {
|
|
46
|
-
"@csstools/css-color-parser": "^
|
|
47
|
-
"@csstools/css-parser-algorithms": "^
|
|
48
|
-
"@csstools/css-tokenizer": "^
|
|
49
|
-
"@csstools/postcss-progressive-custom-properties": "^
|
|
50
|
-
"@csstools/utilities": "^
|
|
39
|
+
"@csstools/css-color-parser": "^4.0.1",
|
|
40
|
+
"@csstools/css-parser-algorithms": "^4.0.0",
|
|
41
|
+
"@csstools/css-tokenizer": "^4.0.0",
|
|
42
|
+
"@csstools/postcss-progressive-custom-properties": "^5.0.0",
|
|
43
|
+
"@csstools/utilities": "^3.0.0"
|
|
51
44
|
},
|
|
52
45
|
"peerDependencies": {
|
|
53
46
|
"postcss": "^8.4"
|
package/dist/index.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var s=require("@csstools/postcss-progressive-custom-properties"),e=require("@csstools/css-tokenizer"),o=require("@csstools/css-color-parser"),r=require("@csstools/utilities"),t=require("@csstools/css-parser-algorithms");const i=/\bdisplay-p3-linear\b/i,a=/^color$/i,basePlugin=s=>({postcssPlugin:"postcss-color-function-display-p3-linear",Declaration(n){const l=n.value;if(!i.test(l))return;if(r.hasFallback(n))return;if(r.hasSupportsAtRuleAncestor(n,i))return;const c=e.tokenize({css:l}),p=t.replaceComponentValues(t.parseCommaSeparatedListOfComponentValues(c),s=>{if(!t.isFunctionNode(s)||!a.test(s.getName()))return;const e=o.color(s);return!e||e.colorNotation!==o.ColorNotation.Linear_Display_P3||e.syntaxFlags.has(o.SyntaxFlag.Experimental)||e.syntaxFlags.has(o.SyntaxFlag.HasNoneKeywords)?void 0:o.serializeP3(e)}),u=t.stringify(p);u!==l&&(n.cloneBefore({value:u}),s?.preserve||n.remove())}});basePlugin.postcss=!0;const postcssPlugin=e=>{const o=Object.assign({preserve:!1,enableProgressiveCustomProperties:!0},e);return o.enableProgressiveCustomProperties&&o.preserve?{postcssPlugin:"postcss-color-function-display-p3-linear",plugins:[s(),basePlugin(o)]}:basePlugin(o)};postcssPlugin.postcss=!0,module.exports=postcssPlugin;
|