Skip to content

fix(site): fix chart axis tick labels showing as black#301

Merged
mattvollmer merged 1 commit intomainfrom
fix/chart-axis-label-colors
Apr 30, 2026
Merged

fix(site): fix chart axis tick labels showing as black#301
mattvollmer merged 1 commit intomainfrom
fix/chart-axis-label-colors

Conversation

@mattvollmer
Copy link
Copy Markdown
Collaborator

The XAxis and YAxis tick labels on the /usage page charts were rendering as black instead of the themed muted color.

Recharts propagates the fill="" prop as an inline SVG attribute on <text> elements. In Tailwind v4, utility classes live in a CSS @layer, which has lower cascade priority than unlayered SVG presentation attributes. So the fill-gray-500 CSS class on the parent <g> was being overridden by the empty fill attribute on each <text> element, causing text to fall back to the SVG default fill (black).

Fix by passing fill directly through the tick prop object, which recharts applies as an SVG attribute on each <text> element. Uses var(--muted-foreground) so the color follows the light/dark theme automatically.


PR generated with Coder Agents

The XAxis and YAxis tick labels on the /usage page charts were
rendering as black instead of the intended gray/muted color.

Recharts propagates the fill="" prop as an inline SVG attribute
on <text> elements. In Tailwind v4, utility classes live in a CSS
layer, which has lower cascade priority than unlayered SVG
presentation attributes. So the fill-gray-500 CSS class was being
overridden by the empty fill attribute, causing text to fall back
to the SVG default (black).

Fix by passing fill directly through the tick prop object, which
sets fill on each <text> element as an SVG attribute. Use
var(--muted-foreground) so the color follows the light/dark theme
automatically.
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 30, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
blink Ready Ready Preview, Comment Apr 30, 2026 2:34pm

Request Review

@mattvollmer mattvollmer requested a review from hugodutka April 30, 2026 14:41
@mattvollmer mattvollmer marked this pull request as ready for review April 30, 2026 14:44
@mattvollmer mattvollmer merged commit 17ae2ed into main Apr 30, 2026
6 checks passed
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.

1 participant