Fix broken minification for non-opaque oklab colors #901
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.
Fixes incorrect addition of an extra hyphen to CSS output for floating-point values that are sufficiently low to be represented by scientific notation.
Context
If a value is represented by scientific notation, it may not be prefixed by "-0" but rather "-D", where D is some digit. In the code block below, if
number < 0
buts
is not prefixed by "-0", then two hyphens are written.https://github.com/parcel-bundler/lightningcss/blob/0afd5d67196c1363e9f70aec8a763e786691255e/src/values/number.rs#L38C1-L49C13
This changes fixes this incorrect behavior by trimming additional leading hyphens ("-") from the string representation of the negative number.
Resolves Issue
This resolves issue with incorrect conversion from color-mix to oklab() (#899) resulting from double negative sign.
This issue is urgent for myself, as it causes Tailwind v4 classes using custom hex colors and non-100% opacity to break, as is seen in the reproduction here provided in the GH issue.