Files
waggle-os/apps/web/public/theme-init.js
shumeiko.it 5163f3dd48 feat(web): add the calm redesign as a sidebar switch
The redesign proposed after the anti-slop audit (anti-slop/audit-001) is now
an opt-in design layer. The "New design" switch at the bottom of the sidebar
sets data-design="calm" on <html> and remembers it; theme-init.js applies the
stored choice before the first paint. The classic look stays the default and
is unchanged.

styles/calm.css, scoped to that attribute, keeps the Hive DS colors and:
bundles Hanken Grotesk and JetBrains Mono (@fontsource-variable, OFL-1.1);
uses three radii (6 / 10 / 14 px); drops the honeycomb wallpaper, gradient
fills, glass, glows and pulsing dots; keeps shadows only on menus and
dialogs; shows labels as written instead of tracked capitals; and marks the
active sidebar item with fill, a 1px line and weight instead of a stripe.
Screen layouts are unchanged.
2026-10-26 21:01:27 +01:00

16 lines
646 B
JavaScript

(function () {
try {
var value = localStorage.getItem('waggle-theme');
var useLightTheme = value === 'light' ||
(value === 'system' && window.matchMedia &&
!window.matchMedia('(prefers-color-scheme: dark)').matches);
if (useLightTheme) document.documentElement.setAttribute('data-theme', 'light');
// The calm redesign (src/lib/design-mode.ts) is opt-in from the sidebar.
if (localStorage.getItem('waggle-design') === 'calm') {
document.documentElement.setAttribute('data-design', 'calm');
}
} catch (_error) {
// Storage can be unavailable in hardened webviews; dark is the default.
}
})();