File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
app/src/components/variation Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 8
8
} from "@/components/ui/chart" ;
9
9
import type { ChartConfig } from "@/components/ui/chart" ;
10
10
import { Button } from "@/components/ui/button" ;
11
+ import { useTheme } from "@/components/theme-provider" ;
11
12
import { CHART_DEFAULTS } from "@/constants" ;
12
13
import type {
13
14
BenchmarkChartData ,
@@ -49,6 +50,13 @@ export const VariationChart = ({
49
50
colors,
50
51
isPerPackage,
51
52
} : 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
+
52
60
const [ selectedPackageManagers , setSelectedPackageManagers ] = useState <
53
61
Set < string >
54
62
> ( new Set ( packageManagers ) ) ;
@@ -213,7 +221,7 @@ export const VariationChart = ({
213
221
. map ( ( pm ) => ( {
214
222
name : pm ,
215
223
value : chartData [ pm ] ,
216
- fill : colors [ pm ] ,
224
+ fill : ( pm === "vlt" && resolvedTheme === "dark" ) ? "white" : colors [ pm ] ,
217
225
} ) ) ;
218
226
219
227
return (
You can’t perform that action at this time.
0 commit comments