Skip to content

Commit 5a9abdc

Browse files
committed
add more tests and update the site
1 parent e8c4a8b commit 5a9abdc

File tree

5 files changed

+793
-1123
lines changed

5 files changed

+793
-1123
lines changed

packages/css-color-parser/dist/index.cjs

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

packages/css-color-parser/dist/index.mjs

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

packages/css-color-parser/src/functions/color-mix.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,8 @@ function colorMixComponents(componentValues: Array<ComponentValue>, colorParser:
205205
color: color,
206206
percentage: percentage,
207207
});
208+
} else {
209+
return false;
208210
}
209211

210212
let pSum = 0;

packages/css-color-parser/test/basic/color-mix-function.mjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,11 @@ const tests = [
124124
['color-mix(in srgb, red, lime, blue, maroon, green, navy, cyan, magenta, yellow)', canonicalize('rgb(99, 99, 99)')], // multiple args
125125
['color-mix(in srgb, cyan 50%, magenta 50%, yellow 50%)', canonicalize('rgb(170, 170, 170)')], // multiple args
126126
['color-mix(in srgb, cyan 25%, magenta 25%, yellow 25%)', canonicalize('rgba(170, 170, 170, 0.75)')], // multiple args
127+
128+
['color-mix(in oklab, red,)', ''],
129+
['color-mix(in oklab, red 5%,)', ''],
130+
['color-mix(in oklab, red, blue, green,)', ''],
131+
['color-mix(in oklab, red, , green)', ''],
127132
];
128133

129134
for (const test of tests) {

0 commit comments

Comments
 (0)