Files
MC-SurvivalWiki-Tips/tips/2026-06-20-009-a11y-dark-mode-toggle-per-user.md
T

1.2 KiB

Tip #9 — Dark-Mode-Toggle (per-user)

Date: 2026-06-20
Category: a11y
Source: MC-Survival Wiki Daily Tip (backfilled from state.json)
Note: Title was truncated in the original state.json log. Body matches the 'Search-Synonyms alias table' variant of the same idea.

Dark-Mode-Toggle (per-user)

Add a per-user dark/light/system theme toggle using next-themes or the shadcn theme provider, persisted in localStorage and synced through Better Auth so the choice follows the user across devices. It solves the rigid current behavior where the wiki follows the system preference and users with a strong personal preference have no way to override it. The signal is the user feedback we already get: 'can we get a dark mode?' appears in every feedback thread, and a visible sun/moon toggle in the header is the universally expected pattern. Syncing across devices is the small touch that makes the feature feel polished — it is what users expect from a 'preference' rather than a 'setting'.

Implementation tips

  1. Use next-themes or shadcn's built-in theme provider — already in the stack if shadcn is used.
  2. Persist in localStorage and Better Auth user preferences (sync across devices).
  3. Add a small sun/moon icon in the header.