Skip to content

fix(v4-charts): fix dark mode support for custom pie label#11013

Open
amalgio wants to merge 1 commit into
shadcn-ui:mainfrom
amalgio:fix/chart-pie-dark-mode
Open

fix(v4-charts): fix dark mode support for custom pie label#11013
amalgio wants to merge 1 commit into
shadcn-ui:mainfrom
amalgio:fix/chart-pie-dark-mode

Conversation

@amalgio

@amalgio amalgio commented Jun 25, 2026

Copy link
Copy Markdown

Description

Fixes a bug where the custom pie chart labels in chart-pie-label-custom are invisible in dark mode (they remain static black).

Why this happens

The component used fill="var(--foreground)" directly on the <text> element. In shadcn themes, --foreground holds raw HSL numbers (e.g., 240 10% 3.9%) without the hsl() wrapper. This results in an invalid SVG fill property, causing the browser to fall back to default black text in both light and dark modes.

The Fix

Changed fill="var(--foreground)" to className="fill-foreground". This allows Tailwind to correctly apply the CSS rule fill: hsl(var(--foreground)), enabling proper theme-aware styling.

@vercel

vercel Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

@amalgio is attempting to deploy a commit to the shadcn-pro Team on Vercel.

A member of the Team first needs to authorize it.

@amalgio amalgio force-pushed the fix/chart-pie-dark-mode branch from 4c2c0f7 to f17f7ab Compare June 25, 2026 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant