UI: dark mode following system preference #6
Loading…
Reference in a new issue
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?
Problem
The UI is light-theme only. Reading in the evening means a glaring white page, and there is no way to darken it.
Goal
A dark theme that activates automatically by following the OS/browser preference (
prefers-color-scheme), with no manual toggle required for the common case.Findings
src/yunjin/web/static/style.css(567 lines) is already fully variable-driven — colours live in a:rootblock as--color-*custom properties (blue/orange/yellow accent palette, chosen for deuteranopia safety).prefers-color-schememedia query anywhere.@media (prefers-color-scheme: dark)block redefining the custom properties, consistent with the project's minimal-JS rule.Plan of attack
@media (prefers-color-scheme: dark)redefining all--color-*variables (backgrounds, surfaces, text, accents, alerts).Scope update (Marvin8)
Dark mode will ship together with #8 (settings infrastructure) in one branch/PR, and gains a third mode: the theme is user-settable — system / light / dark — with an explicit user choice overriding the system preference. Default remains "follow system". Implementation will use a
data-themeattribute on<html>combined with aprefers-color-schememedia query, all server-rendered (no JS), persisted via the new settings store.Resolved by PR #27 (merged): dark theme with three modes — Follow system (default), Light, Dark (user choice overrides the OS preference). Pure CSS via prefers-color-scheme + data-theme attribute; all colour literals swept into variables with dark variants and contrast-checked on-accent text colours, guarded by static stylesheet tests.