Use the Dark / Light button in the top-right corner. The preference
persists across all pages via localStorage.
How It Works
-
Inline
<script>in<head>readslocalStoragebefore paint — no flash - Click toggles
.darkclass on<html> -
CSS custom properties in
@theme/.darkhandle all colors -
Respects
prefers-color-schemeas default when no preference is stored
Sample Content
Surface — bg-surface + border-border
Surface Alt — bg-surface-alt
Primary — bg-primary
Danger — bg-danger
Success — bg-success
All these colors switch automatically based on the .dark class.
No per-component logic needed.