Skip to content

Commit 4802b42

Browse files
committed
finishing up
1 parent 4ddbc76 commit 4802b42

12 files changed

Lines changed: 116 additions & 2 deletions

File tree

plugins/postcss-color-mix-function/test/basic.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,3 +178,7 @@
178178
color-3: color-mix(in display-p3-linear, pink, green);
179179
color-4: color-mix(in display-p3-linear, lime, green);
180180
}
181+
182+
.default-interpolation-space {
183+
color: color-mix(#09232c, white 50%);
184+
}

plugins/postcss-color-mix-function/test/basic.expect.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,3 +184,7 @@
184184
color-3: rgb(188, 164, 149);
185185
color-4: rgb(0, 205, 0);
186186
}
187+
188+
.default-interpolation-space {
189+
color: rgb(123, 137, 142);
190+
}

plugins/postcss-color-mix-function/test/basic.preserve-true.expect.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,3 +263,8 @@
263263
color-4: rgb(0, 205, 0);
264264
color-4: color-mix(in display-p3-linear, lime, green);
265265
}
266+
267+
.default-interpolation-space {
268+
color: rgb(123, 137, 142);
269+
color: color-mix(#09232c, white 50%);
270+
}

plugins/postcss-color-mix-function/test/basic.with-cloned-rules.expect.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,3 +263,8 @@
263263
color-4: rgb(0, 205, 0);
264264
color-4: color-mix(in display-p3-linear, lime, green);
265265
}
266+
267+
.default-interpolation-space {
268+
color: rgb(123, 137, 142);
269+
color: color-mix(#09232c, white 50%);
270+
}

plugins/postcss-progressive-custom-properties/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
### Unreleased (minor)
44

55
- Add support for `color(display-p3-linear 0.3081 0.014 0.0567)`
6+
- Add support for `color-mix(in display-p3-linear, red, blue)`
7+
- Add support for `color-mix(red, blue)`
8+
- Add support for `alpha(from red / 0.5)`
69

710
### 4.1.0
811

plugins/postcss-progressive-custom-properties/dist/index.cjs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

plugins/postcss-progressive-custom-properties/dist/index.mjs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

plugins/postcss-progressive-custom-properties/scripts/color-mix.mjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,12 @@ export const colorMixMatchers = [
4747
matcherForValue('color-mix(in $a $b hue,$1 $2,$3 $4, _z)'),
4848
],
4949
},
50+
{
51+
'supports': 'color-mix(red, blue)',
52+
'property': 'color',
53+
'sniff': 'color-mix(',
54+
'matchers': [
55+
matcherForValue('color-mix(_z)'),
56+
],
57+
},
5058
];

plugins/postcss-progressive-custom-properties/scripts/relative-color-syntax.mjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
import { matcherForValue } from './matcher-for-value.mjs';
22

33
export const relativeColorSyntaxMatches = [
4+
{
5+
'supports': 'color(from red display-p3-linear r g b)',
6+
'property': 'color',
7+
'sniff': 'display-p3-linear',
8+
'matchers': [
9+
matcherForValue('color(from $a display-p3-linear _z)'),
10+
],
11+
},
412
{
513
'supports': 'lab(from red l 1 1% / calc(alpha + 0.1))',
614
'property': 'color',

plugins/postcss-progressive-custom-properties/src/matchers.ts

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,6 +1004,61 @@ export const matchers = [
10041004
}
10051005
]
10061006
},
1007+
{
1008+
"supports": "color-mix(red, blue)",
1009+
"property": "color",
1010+
"sniff": "color-mix(",
1011+
"matchers": [
1012+
{
1013+
"type": "function",
1014+
"value": "color-mix",
1015+
"nodes": [
1016+
{
1017+
"type": "word",
1018+
"anyRemainingArguments": true
1019+
}
1020+
]
1021+
}
1022+
]
1023+
},
1024+
{
1025+
"supports": "color(from red display-p3-linear r g b)",
1026+
"property": "color",
1027+
"sniff": "display-p3-linear",
1028+
"matchers": [
1029+
{
1030+
"type": "function",
1031+
"value": "color",
1032+
"nodes": [
1033+
{
1034+
"type": "word",
1035+
"value": "from"
1036+
},
1037+
{
1038+
"type": "space"
1039+
},
1040+
{
1041+
"type": "word",
1042+
"isVariable": true
1043+
},
1044+
{
1045+
"type": "space"
1046+
},
1047+
{
1048+
"type": "word",
1049+
"value": "display-p3-linear"
1050+
},
1051+
{
1052+
"type": "space"
1053+
},
1054+
{
1055+
"type": "word",
1056+
"anyRemainingArguments": true
1057+
}
1058+
]
1059+
}
1060+
]
1061+
},
10071062
{
10081063
"supports": "lab(from red l 1 1% / calc(alpha + 0.1))",
10091064
"property": "color",

0 commit comments

Comments
 (0)