Skip to content

Commit 41ce3ab

Browse files
authored
fix: should not panic when passing system-color to color-mix (parcel-bundler#819)
1 parent 84ebbed commit 41ce3ab

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/lib.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19311,6 +19311,14 @@ mod tests {
1931119311
".foo { color: color-mix(in srgb, blue, currentColor); }",
1931219312
".foo{color:color-mix(in srgb,blue,currentColor)}",
1931319313
);
19314+
minify_test(
19315+
".foo { color: color-mix(in srgb, accentcolor, blue); }",
19316+
".foo{color:color-mix(in srgb,accentcolor,blue)}",
19317+
);
19318+
minify_test(
19319+
".foo { color: color-mix(in srgb, blue, accentcolor); }",
19320+
".foo{color:color-mix(in srgb,blue,accentcolor)}",
19321+
);
1931419322

1931519323
// regex for converting web platform tests:
1931619324
// test_computed_value\(.*?, `(.*?)`, `(.*?)`\);

src/values/color.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3253,7 +3253,9 @@ impl CssColor {
32533253
+ From<OKLCH>
32543254
+ Copy,
32553255
{
3256-
if matches!(self, CssColor::CurrentColor) || matches!(other, CssColor::CurrentColor) {
3256+
if matches!(self, CssColor::CurrentColor | CssColor::System(..))
3257+
|| matches!(other, CssColor::CurrentColor | CssColor::System(..))
3258+
{
32573259
return Err(());
32583260
}
32593261

0 commit comments

Comments
 (0)