docs: define admin theme isolation

This commit is contained in:
Simo committed 2026-07-12 18:44:24 +02:00
1 parent 2606092337
commit 907ac9bf5b
1 file changed
+31
@@ -0,0 +1,31 @@
# Admin theme isolation
## Objective
Keep every administration page readable and visually coherent in light and dark mode, independently of the public website palette. The audit covers the whole `/admin` tree, including every `/admin/import/*` workflow.
## Root cause
Administration components currently consume public theme variables such as `--color-primary`, `--color-background`, `--color-text`, and `--color-navbar`. A valid public preset can therefore produce poor contrast in the administration panel. A smaller set of pages also contains literal Tailwind colors, hexadecimal colors, and fixed overlays.
## Design
Define a semantic admin palette under the admin layout using `--admin-*` variables. Derive accessible foregrounds for light and dark surfaces, then migrate administration components and shared admin CSS to these semantic variables. Public pages continue using the existing public palette.
Admin colors represent roles rather than specific hues: canvas, surface, elevated surface, text, muted text, border, accent, accent foreground, success, warning, error, info, sidebar, input, overlay, and focus ring. Presets may influence the admin accent, but may not override readable foregrounds or structural surfaces with unsafe combinations.
## Import pages
The same rules apply to badge, clone, clothing, effects, furni, pets, and repair imports. Status text, selection state, borders, shadows, gradients, tooltips, dialogs, and overlays use admin semantic tokens. Colors that are part of imported content or asset previews remain unchanged because they represent data rather than interface chrome.
## Intentional color values
Literal values remain allowed only for user-editable data and faithful previews, including banner colors, prefix colors, favicon generation, event-type colors, tag/team configuration, and image-preview backdrops where a neutral checker or black canvas is required. Each exception must be explicit in the audit test.
## Verification
Extend the admin source audit so it fails when an administration UI introduces public structural theme variables, unapproved literal colors, or unapproved palette utilities. Run the focused audit test, all tests, TypeScript checking, and the production build. Manually inspect representative light and dark pages, including one dense import workflow and one modal.
## Scope boundary
This change does not port missing routes or alter database behavior. After theme isolation is complete, the next route-porting block is moderation, detailed logs, analytics, and DevOps.