Refine admin PWA dark theme controls
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
tests / ui (push) Has been cancelled

This commit is contained in:
Codex Agent
2026-02-04 13:50:59 +01:00
parent 239f55f9c5
commit 66c7131d79
22 changed files with 999 additions and 110 deletions

View File

@@ -110,8 +110,8 @@ export function useAdminTheme() {
// Muted/Subtle should NOT use theme.muted (which is a background color in Tamagui standard)
// Instead, we derive them from Text with opacity or use specific palette values if available
// But safer is Alpha since it works in both Light (Dark Text) and Dark (Light Text) modes.
const muted = withAlpha(text, 0.65);
const subtle = withAlpha(text, 0.45);
const muted = resolveThemeValue((theme as any).colorMuted?.val, withAlpha(text, 0.65));
const subtle = resolveThemeValue((theme as any).colorSubtle?.val, withAlpha(text, 0.45));
const surfaceMuted = resolveThemeValue(theme.muted?.val, isDark ? '#121F3D' : ADMIN_COLORS.surfaceMuted);
const glassSurface = withAlpha(surface, isDark ? 0.90 : 0.85);
@@ -122,6 +122,7 @@ export function useAdminTheme() {
return {
theme,
isDark,
background,
surface,
surfaceMuted,
@@ -134,7 +135,7 @@ export function useAdminTheme() {
subtle, // Now properly derived from text color
primary,
accent: resolveThemeValue(theme.accent?.val, ADMIN_COLORS.accent),
accentSoft: resolveThemeValue(theme.blue3?.val, ADMIN_COLORS.accentSoft),
accentSoft: resolveThemeValue((theme as any).accentSoft?.val ?? theme.blue3?.val, ADMIN_COLORS.accentSoft),
accentStrong: resolveThemeValue(theme.blue11?.val, ADMIN_COLORS.primaryStrong),
successBg: resolveThemeValue(theme.backgroundStrong?.val, '#DCFCE7'),
successText: resolveThemeValue(theme.green10?.val, ADMIN_COLORS.success),