Reduce precision of oklab() arguments in test snapshots
#15210
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
After the changes in #15201, our Windows CI started to fail. The problem is that lightningcss now needs to convert
oklchcolors into theoklabspace to inline somecolor-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
oklchand 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 theoklab()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.: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.