8356
Wx
www-xonecas-io / files
www-xonecas-io / tickets / 1025-need-a-light-dark-toggel.md
1.5 KB
1--- 2id: 1025 3title: Need a light/dark toggle 4type: feature 5status: done 6priority: p2 7created: 2026-11-08T04:14:52Z 8updated: 2026-11-08T04:28:46Z 9source: human 10moves: 2026-11-08T04:14:56Z inbox doing drag; 2026-11-08T04:23:05Z doing review agent; 2026-11-08T04:28:46Z review done drag 11area: site 12--- 13 14 15## Notes 16 17- 2026-11-08 04:23Z (agent): Done. A theme button (half-filled circle) sits in the header on every page, left of the search box. Clicking it switches between light and dark from what is showing, and remembers the choice in localStorage across pages and visits. Until it is clicked, the site follows the system setting as before. Fixed the title typo 'toggel'. 18 19 - layout.html: a small inline script in <head> applies the saved theme before the first paint (no flash) and handles the click. It sets data-theme on <html>, which site.css already supported. 20 - components.html (nav): the button. The search form lost its own sm:ml-auto; the button's ml-auto pushes both right. 21 22 CHECKED: go vet, go test pass. Rebuilt. agent-browser: with nothing saved, no data-theme and the light background (system light). Click: data-theme=dark, saved, background #15140f. Next page (/projects/) loads dark. Click again: light, saved. Screenshots: dark /projects at 1280px; light at 390px phone width (button on the first row, search on its own row). 23 24 NOT CHECKED: going back to 'follow the system' after a click (two states only; clearing site data resets it). No-JS: the button shows but does nothing.