Thema-fundament: variant (B/E) x modus (licht/donker), tijdreis-knop en overgang

Vervangt rood/paars door tokens per variant en modus, voegt ModeToggle en
icoon-knop VariantToggle toe, VariantRenderer met lazy E-chunk, dither-overgang
(uit bij minder beweging), theme-init.js tegen themaflits en tests.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-09 21:14:11 +01:00
co-authored by Claude Sonnet 5.5
parent 1047c738b5
commit 0854e3a096
37 changed files with 1389 additions and 269 deletions
+23
View File
@@ -0,0 +1,23 @@
/*
* Runs (blocking, same origin, no inline script) before first paint so the page never flashes the
* wrong theme. Mirrors resolveInitialMode() in src/theme/tokens.ts (BR-U1-2, BR-U1-5):
* variant is always "b"; mode = valid stored mode, else the system preference.
*/
(function () {
var mode = 'light';
try {
var stored = window.localStorage.getItem('slp-software-mode');
if (stored === 'light' || stored === 'dark') {
mode = stored;
} else if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
mode = 'dark';
}
} catch (e) {
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
mode = 'dark';
}
}
var root = document.documentElement;
root.setAttribute('data-variant', 'b');
root.setAttribute('data-mode', mode);
})();