Add admin HK color customization fields to theme editor
Local Build and Deploy / deploy (push) Successful in 58s

- Add 6 new admin color DB keys (admin_canvas, admin_surface, admin_text,
  admin_text_muted, admin_border, admin_sidebar_bg) that override the
  derived admin palette
- Extract adminPaletteCss() from themePaletteCss() for reuse
- Generate admin CSS variables in both :root and html.dark with overrides
- Persist admin color settings via saveTheme action
- Add Admin panel (HK) section to /admin/theme with color pickers
This commit is contained in:
openhands committed 2026-07-13 19:49:19 +02:00
1 parent 4dcf6fdce8
commit a16d9859e8
5 files changed
+134 -57

No files matched your search

+6
View File
@@ -34,6 +34,12 @@ export async function saveTheme(formData: FormData): Promise<void> {
if (raw && COLOR_RE.test(raw)) await writeSetting(dbKey, raw);
}
}
const ADMIN_KEYS = ["admin_canvas", "admin_surface", "admin_text", "admin_text_muted", "admin_border", "admin_sidebar_bg"];
for (const key of ADMIN_KEYS) {
const raw = String(formData.get(key) ?? "").normalize("NFC").trim();
if (raw && COLOR_RE.test(raw)) await writeSetting(key, raw);
}
const radius = String(formData.get("border_radius") ?? "").normalize("NFC").trim();
if (/^\d{1,3}$/.test(radius)) await writeSetting("border_radius", radius);