Add business dashboard dark mode from Super Admin theme setting.

Login and in-app surfaces follow tenant themeMode, matching customer dark tokens, with themed switches and tighter card/table chrome.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Alireza Hassani
2026-08-31 13:40:40 +03:30
co-authored by Cursor
parent 65012717d0
commit e9400c2281
83 changed files with 586 additions and 193 deletions
@@ -4,6 +4,25 @@ import {
type BusinessPrimaryColorId,
} from './businessPrimaryColors'
export type DashboardThemeMode = 'light' | 'dark'
export function applyThemeMode(mode: 'light' | 'dark' | undefined) {
document.documentElement.setAttribute(
'data-theme',
mode === 'dark' ? 'dark' : 'light',
)
}
export function pickThemedLogoUrl(
lightUrl: string | null | undefined,
darkUrl: string | null | undefined,
mode: DashboardThemeMode,
): string | null {
const light = lightUrl?.trim() || null
const dark = darkUrl?.trim() || null
return mode === 'dark' ? dark || light : light
}
const CSS_VAR_DEFAULTS: Record<string, string> = {
'--primary': '#3b82f6',
'--primary-glow': '#3b82f6',