Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The docs list OKLCH as a supported
theme.colorsformat, and the docs theme itself uses anoklch-blueramp.lightenanddarkensend every non-var()color throughtoRgba, which parses hex,rgbandhsland returns{ r: 0, g: 0, b: 0, a: 1 }for anything else, so anoklch()value is treated as black.That shows up in the generated variables. In dark color scheme
--mantine-color-<name>-lightand-light-hoveraredarken(theme.colors[color][9], 0.5)anddarken(..., 0.3)(get-css-color-variables.ts:65-66), so an OKLCH color'slightvariant background came outrgba(0, 0, 0, 1). With<Button color="oklch-blue" variant="light" />in dark mode the button is black rather than a tint of the color. Thefilledvariant has the same problem for a rawoklch()colorprop, because its hover isdarken(color!, 0.1)(default-variant-colors-resolver.ts:81).The fix is the branch
rgba()already has (rgba.ts:13): OKLCH is passed through to a CSScolor-mixinstead of being converted to numeric channels, so the browser does the mixing andtoRgbadoes not have to carry an OKLab conversion.var()colors are unaffected and hex/rgb/hsl still take the numeric path.Tests were added next to the existing
supports css variablescases in both test files; they fail with only the two source lines reverted.corepack yarn jest packages/@mantine/corepasses (354 suites, 10746 tests), along with oxlint and oxfmt.