Dark mode — auto + manual toggle, system-preference default #2
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Paliad has zero dark-mode support today (no
prefers-color-scheme, nodata-theme, no toggle). Out of scope on t-paliad-063 (brand palette) but worth picking up now since the HLC palette already anticipates it:--hlc-midnight(#002236) is the natural dark-bg,--hlc-cream(#EEE5E1) is the light-bg,--hlc-limeaccent works on both.Approach
Two palette sets at
:rootand:root[data-theme="dark"]. Toggle stored inlocalStorage; default =prefers-color-schemefrom the browser. Add a small toggle button in the sidebar (sun/moon icon) and persist user preference.Scope
:root(light) and:root[data-theme="dark"](dark). Components that already read from--hlc-*tokens get dark mode for free. Components that hardcoded white / light grey / shadows need an audit.#fff,#f...,rgba(0,0,0,...),box-shadowbrightness assumptions. Replace with theme-aware tokens (--surface-bg,--surface-fg,--border,--shadow).localStorage["paliad-theme"]. Apply on initial render via inline<script>in<head>to avoid FOUC.Acceptance
cd frontend && bun run buildcleanTest creds
tester@hlc.de/xdMmC7iCeDSTFmPXAlAyY0.Out of scope
Files (likely)
frontend/src/styles/global.css(palette swap + audit)frontend/src/components/Sidebar.tsx(toggle UI)frontend/src/client/theme.ts(new — load/persist + apply preference)frontend/src/index.htmlhead inline script (FOUC-prevention)Shipped — merged to main as
8ddfb94(feature commitfee6afd).What landed:
:rootand:root[data-theme="dark"]. New tokens:--color-surface-{2,muted},--color-input-bg,--color-overlay-{faint,subtle,strong,modal},--color-border-strong,--shadow-{lg,xl},--status-{red,amber,green,blue,neutral}-{bg,fg,border,...},--tree-icon-{client,litigation,patent,case,project},--sidebar-scrollbar-*.<script>inPWAHead.tsxruns synchronously in<head>BEFORE the stylesheet loads. Readspaliad-theme,paliad-sidebar-pinned, andpaliad-sidebar-widthfromlocalStorage; sets<html data-theme="dark">,<html class="sidebar-pinned">(desktop only) and--sidebar-width.client/theme.tsowns the runtime side: cycle auto → light → dark → auto, listen toprefers-color-schemewhile pref=auto, broadcast change events to the sidebar toggle so the icon/label tracks live state (incl. OS-level theme flips).theme.toggle.{auto,light,dark}for the label,theme.toggle.cycle.{auto,light,dark}for the aria-label/tooltip describing the next click).<html>so layout doesnt flicker on navigation.client/sidebar.tsmirrors the class on<html>on every pin toggle so the new selector:root.sidebar-pinned .has-sidebarstays in sync with the existing.has-sidebar.sidebar-pinned(body) selector.scrollbar-gutter: stable..sidebar-iconwidth shrinks byvar(--sidebar-scrollbar-width)so the collapsed icon column doesnt shift left when the nav overflows on tall (admin) layouts.--color-input-bg—#ffffffin light mode (m: 2026-04-30 — the cream--color-bgmade inputs blur into the body) and#00192a(slightly below--color-surface) in dark mode so the well stays depressed below the card panel.global.css.Smoke (Playwright on local server):
/loginin both modes — body bg/fg/cards/inputs read from the right tokens, FOUC script lands in<head>before the stylesheet, light-mode inputs render#ffffff, dark-mode inputs render#00192awith lime focus border.Build:
cd frontend && bun run buildclean (1224 i18n keys, 36 pages).Close this once verified in prod after the auto-deploy.
Followup: m flagged that agenda cards still rendered light-grey in dark mode. Root cause was several rules referencing non-existent fallback tokens (
--color-surface-subtle,--color-surface-0) — the CSS resolved to the hardcoded#f3f4f6/#f9fafb/#fffffffallbacks in both themes. Swept those plus a long tail of remaining#fef3c7/#fee2e2/#dcfce7/#dbeafe/#f3f4f6literals across agenda, dashboard cards, dashboard urgency, frist-due-chip, akten-status, projekt-tree, admin-audit, akten-chip, team-office-badge, form-warn, akten-unavailable, dashboard-unavailable, frist-cal — they now read--status-*and--color-*tokens directly so the dark swap is automatic. Bottom-of-file dark override block trimmed (was duplicate work).Merged followup
22156f0→ main31afab0.Smoke (Playwright): agenda card link reads
rgb(10,48,71)in dark /#ffffffin light; urgency-overdue chip reads alpha-tinted red in dark / saturated pastel-red in light. No more light-grey leakage.