fix(grid): unify DataGrid theme backgrounds

This commit is contained in:
lxk955 authored and GitHub committed 2026-10-03 23:26:15 +08:00
1 parent 4c7f8e8196
commit 233f7f7716
3 files changed
+61 -19

No files matched your search

@@ -260,7 +260,9 @@ function paintToken(getVar: (name: string) => string, name: string, fallback: st
export function resolveDataGridPaintTheme(options: { getVar: (name: string) => string; isDark: boolean }): DataGridPaintTheme {
const { getVar, isDark } = options;
const background = cssVarColor(getVar, "--background", isDark ? "rgb(19, 20, 22)" : "rgb(255, 255, 255)");
const defaultBackground = isDark ? "rgb(19, 20, 22)" : "rgb(255, 255, 255)";
const solidBackground = cssVarColor(getVar, "--background-solid", cssVarColor(getVar, "--background", defaultBackground));
const background = paintToken(getVar, "--data-grid-background", solidBackground);
const foreground = cssVarColor(getVar, "--foreground", isDark ? "rgb(215, 215, 219)" : "rgb(10, 10, 10)");
const mutedForeground = cssVarColor(getVar, "--muted-foreground", isDark ? "rgb(151, 152, 157)" : "rgb(115, 115, 115)");
const primary = cssVarColor(getVar, "--primary", isDark ? "rgb(208, 208, 214)" : "rgb(23, 23, 23)");