v6.8.0: light theme

The palette lived as ~620 hex literals in inline styles plus a few hundred more in
the stylesheets, so there was no single thing to change. It is now 113 custom
properties in src/styles/theme.css, in two blocks.

src/scripts/theme-boot.js decides the theme before first paint — blocking, in <head>,
above the stylesheet, because a deferred script paints dark first and corrects itself.
It stores the mode ('system' | 'light' | 'dark'), never the colour it resolved to, and
stamps data-theme so an explicit choice can beat the media query. The switcher in the
header is a view onto it.

A filled accent stays the brand colour in both themes — the ink on it is near-black
either way — while an accent used as text darkens to clear 4.5:1 on white. A colour
reaches a fill by four routes (a style property, a constant, a helper argument, an SVG
source string), and tests/theme-switching.test.mjs covers all four.

The dark theme is unchanged: every colour declaration the previous build produced comes
out of this one identically once the properties are resolved.

Also: the roadmap drops its status chips on mobile, and Roadmap.jsx no longer splits a
colour with parseInt at runtime, which a var() reference cannot survive.
This commit is contained in:
lockbitchat
2026-09-04 17:38:41 -04:00
parent 1c153b290a
commit 9e63cf65a4
109 changed files with 4320 additions and 1910 deletions
+7 -1
View File
@@ -11,7 +11,7 @@ let DYNAMIC_CACHE = 'securebit-pwa-dynamic-v4.7.56';
// Build stamp — rewritten by scripts/post-build.js on every release so this file's
// bytes change each deploy. That is what makes the browser detect a new Service Worker,
// reinstall it, drop stale caches and (via controllerchange) prompt the page to update.
const SW_BUILD_VERSION = '1788496655816';
const SW_BUILD_VERSION = '1788557187846';
// Locale subdirectories, rewritten by scripts/build-i18n.js. Each localized page is a
// separate document at its own URL, so the shell has to be cached and served per
@@ -84,8 +84,12 @@ const STATIC_ASSETS = [
// PWA components only
'/src/pwa/pwa-manager.js',
'/src/pwa/install-prompt.js',
'/src/scripts/pwa-install-capture.js',
'/src/scripts/pwa-register.js',
'/src/scripts/pwa-offline-test.js',
// Blocking in <head> and decides the theme before first paint, so an offline load
// that misses it paints dark and then corrects itself once the network returns.
'/src/scripts/theme-boot.js',
// The install prompt is precached and imports these at runtime; without them it
// would fail to load offline, which is exactly when it is most likely to be shown.
@@ -139,8 +143,10 @@ const CACHEABLE_PATHS = new Set([
'/logo/favicon.ico',
'/src/pwa/pwa-manager.js',
'/src/pwa/install-prompt.js',
'/src/scripts/pwa-install-capture.js',
'/src/scripts/pwa-register.js',
'/src/scripts/pwa-offline-test.js',
'/src/scripts/theme-boot.js',
'/src/i18n/index.js',
'/src/i18n/generated.js',
...SW_DICTS,