Skip to content

Fix color generation compatibility with chroma-js v3#211

Merged
linuspahl merged 1 commit into
mainfrom
fix-button-hover-color
Jul 9, 2026
Merged

Fix color generation compatibility with chroma-js v3#211
linuspahl merged 1 commit into
mainfrom
fix-button-hover-color

Conversation

@linuspahl

@linuspahl linuspahl commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Description

chroma-js v3 changed the output of .css() to use CSS Color Level 4 space-separated syntax (rgb(r g b / a)) instead of the legacy comma-separated format (rgba(r, g, b, a)). This broke Mantine v8's internal color parser (toRgba), which only handles comma-separated input — causing hover states on default buttons to render an invalid color (rgba(173879298, 0, NaN, 1)).

Replace all .css() calls in opacify, contrastingColor, colorLevel, and inputColors with .hex(), which produces output (#rrggbbaa for semi-transparent, #rrggbb for opaque) that is compatible with both Mantine's parser and the browser. Regenerate theme.json with the updated utilities.

Before:
image

After:
image

@linuspahl linuspahl requested a review from maxiadlovskii July 7, 2026 14:17
@linuspahl linuspahl merged commit 1327169 into main Jul 9, 2026
1 check passed
@linuspahl linuspahl deleted the fix-button-hover-color branch July 9, 2026 09:47
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.

2 participants