Skip to content

Conversation

@philipp-spiess
Copy link
Contributor

@philipp-spiess philipp-spiess commented Nov 27, 2024

After the changes in #15201, our Windows CI started to fail. The problem is that lightningcss now needs to convert oklch colors into the oklab space to inline some color-mix() functions.

The problem, though, is that this calculation seems to have rounding differences between macOS, Linux, and Windows. Since we still want to define the default color space in oklch and use lightningcss as a post-processor in our unit tests so we have a better coverage of the output, this PR attempts to fix the issue by adding a custom vitest serializer. It will find usages of the oklab() function with arguments that have lots of decimal places (at least 6 decimal places). What it then does is simply cut off any excess decimal places to truncate the output to 5 places. E.g.:

- oklab(62.7955% .224863 .125846 / .75);
+ oklab(62.7955% .22486 .12584 / .75);

Test Plan

I updated the CI workflow file to make all three builds run in CI and observed that they are now all green again.

Screenshot 2024-11-27 at 14 54 52

@philipp-spiess philipp-spiess changed the title Reduce precision of oklab() arguments in test snapshots Reduce precision of oklab() arguments in test snapshots Nov 27, 2024
@philipp-spiess philipp-spiess force-pushed the chore/fix-ci branch 3 times, most recently from 75ce5ff to 956ba02 Compare November 27, 2024 13:31
@philipp-spiess philipp-spiess marked this pull request as ready for review November 27, 2024 13:42
@philipp-spiess philipp-spiess requested a review from a team as a code owner November 27, 2024 13:42
@adamwathan adamwathan merged commit bfcc144 into next Nov 27, 2024
1 check passed
@adamwathan adamwathan deleted the chore/fix-ci branch November 27, 2024 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants