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
+6
View File
@@ -33,6 +33,10 @@
"language.suggest.text": "本页面也有简体中文版本。",
"language.suggest.cta": "阅读简体中文",
"language.suggest.dismiss": "关闭",
"theme.label": "主题",
"theme.system": "跟随系统",
"theme.light": "浅色",
"theme.dark": "深色",
"community.title": "一起构筑隐私的未来",
"community.description": "SecureBit 因社区而成长。你的想法与反馈塑造着安全通讯的未来 —— 开放开发,全程完整的 ASN.1 校验。",
"community.github": "GitHub 仓库",
@@ -317,6 +321,8 @@
"pwa.iosStep3Hint": "确认以安装 SecureBit.chat",
"pwa.genericTitle": "安装 SecureBit",
"pwa.genericDesc": "每种浏览器的安装方式都不一样。请选择与你的浏览器相符的步骤。",
"pwa.androidChromeHint": "点击右上角的 ⋮ ,选择“安装应用”",
"pwa.androidOtherHint": "打开菜单,选择“添加到主屏幕”",
"pwa.gotIt": "知道了",
"pwa.installedTitle": "应用已安装!",
"pwa.installedIos": "iOS 应用已安装!请从主屏幕打开。",