From 0b18a16a2d246da93b365d5c1b8ab82cbe823599 Mon Sep 17 00:00:00 2001 From: openhands Date: Mon, 13 Jul 2026 20:24:02 +0200 Subject: [PATCH] Make entire HK admin panel cohesive and always readable - Remap shared shadcn semantic tokens (--color-primary, --color-popover, --color-card, --color-border, --color-ring, --color-muted-foreground, --color-destructive, ...) onto the admin palette for any page scoped with body:has([data-admin]); this themes every embedded Button, Badge, Input, Select, Card, Table, Tabs, Dialog, Switch, Checkbox with the admin theme and guaranteed contrast, without editing component files. Gated so the public site is untouched and Radix portals (dialogs/selects) are covered. - Tag the admin layout/sidebar with data-admin and give the admin content area the admin canvas background so the whole HK is one cohesive dark UI. - Fix hardcoded colors in catalog shop preview and favicon form to use admin variables; fix white text on a light warning tint (low contrast). --- src/app/admin/favicon/favicon-form.tsx | 2 +- src/app/admin/layout.tsx | 8 +++-- src/app/globals.css | 34 +++++++++++++++++++ .../admin/catalog/items-shop-preview.tsx | 14 ++++---- 4 files changed, 48 insertions(+), 10 deletions(-) diff --git a/src/app/admin/favicon/favicon-form.tsx b/src/app/admin/favicon/favicon-form.tsx index 21368255..40f95e11 100644 --- a/src/app/admin/favicon/favicon-form.tsx +++ b/src/app/admin/favicon/favicon-form.tsx @@ -76,7 +76,7 @@ export function FaviconForm({ currentUrl }: { currentUrl: string | null }) { alt="Favicon preview" width={64} height={64} - className="rounded-lg border-2 border-[var(--admin-border)] object-contain bg-white" + className="rounded-lg border-2 border-[var(--admin-border)] object-contain bg-[var(--admin-surface)]" unoptimized />
{preview}
diff --git a/src/app/admin/layout.tsx b/src/app/admin/layout.tsx index 28d030e2..d54e0d09 100644 --- a/src/app/admin/layout.tsx +++ b/src/app/admin/layout.tsx @@ -165,7 +165,11 @@ export default async function AdminLayout({ children }: { children: ReactNode }) return ( }> -
+
{children}
@@ -179,7 +183,7 @@ async function Sidebar({ staff }: { staff: { id: number; username: string; rank: const navGroups = getNavGroups(t); return ( -