Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19311,6 +19311,14 @@ mod tests {
".foo { color: color-mix(in srgb, blue, currentColor); }",
".foo{color:color-mix(in srgb,blue,currentColor)}",
);
minify_test(
".foo { color: color-mix(in srgb, accentcolor, blue); }",
".foo{color:color-mix(in srgb,accentcolor,blue)}",
);
minify_test(
".foo { color: color-mix(in srgb, blue, accentcolor); }",
".foo{color:color-mix(in srgb,blue,accentcolor)}",
);

// regex for converting web platform tests:
// test_computed_value\(.*?, `(.*?)`, `(.*?)`\);
Expand Down
4 changes: 3 additions & 1 deletion src/values/color.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3253,7 +3253,9 @@ impl CssColor {
+ From<OKLCH>
+ Copy,
{
if matches!(self, CssColor::CurrentColor) || matches!(other, CssColor::CurrentColor) {
if matches!(self, CssColor::CurrentColor | CssColor::System(..))
|| matches!(other, CssColor::CurrentColor | CssColor::System(..))
{
return Err(());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean you get an error instead of panic? Does the minify_test imply that this will now ‘work’ by not apply but keeping the existing colors in color-mix in this case? I don’t know Rust…

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it'll fall back to an unparsed property, which will preserve the original source as is.

}

Expand Down