Skip to content

Commit a6ea634

Browse files
committed
chore: make vlt benchmarks white in the dark theme
1 parent efae2ef commit a6ea634

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

app/src/components/variation/chart.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
} from "@/components/ui/chart";
99
import type { ChartConfig } from "@/components/ui/chart";
1010
import { Button } from "@/components/ui/button";
11+
import { useTheme } from "@/components/theme-provider";
1112
import { CHART_DEFAULTS } from "@/constants";
1213
import type {
1314
BenchmarkChartData,
@@ -49,6 +50,13 @@ export const VariationChart = ({
4950
colors,
5051
isPerPackage,
5152
}: VariationChartProps) => {
53+
const { theme } = useTheme();
54+
55+
// Resolve the actual theme (dark/light) when user selects "system"
56+
const resolvedTheme = theme === "system"
57+
? (window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light")
58+
: theme;
59+
5260
const [selectedPackageManagers, setSelectedPackageManagers] = useState<
5361
Set<string>
5462
>(new Set(packageManagers));
@@ -213,7 +221,7 @@ export const VariationChart = ({
213221
.map((pm) => ({
214222
name: pm,
215223
value: chartData[pm],
216-
fill: colors[pm],
224+
fill: (pm === "vlt" && resolvedTheme === "dark") ? "white" : colors[pm],
217225
}));
218226

219227
return (

0 commit comments

Comments
 (0)