From 3bd6cae032bafbc9dea591028dc4de95dda3a602 Mon Sep 17 00:00:00 2001 From: William Laugesen Date: Tue, 28 Jul 2026 16:40:18 +1200 Subject: [PATCH 1/7] Rework the theme selector ahead of the design refresh Move theme handling onto a single contract in src/lib/theme.ts, shared by the pre-paint inline script, the client controller and the stylesheets. now always carries data-theme="light" or "dark" (never absent, never "system"), so incoming design token stylesheets can key off the attribute with no :root fallback. data-theme-preference records the raw choice, including "system", ready for a three-position control. Fixes along the way: - The two switchers each cached their own state, so toggling one left the other stale. Both now read the same attribute. - The knob position came from a JS-applied class, so it painted on the light side and slid across on every load. It is now driven by html[data-theme]. - tabindex="-1" on the input plus tabindex="0" on the label made the focusable element a bare