feat: 添加日间/夜间主题切换系统

- 新增 theme.js 主题管理模块(localStorage 持久化)
- variables.css 重构为亮色默认 + 暗色 data-theme 切换
- sidebar 底部添加主题切换按钮(sun/moon SVG 图标)
- 修复 scrollbar 硬编码颜色为 CSS 变量
- 修复 agents.js fallbacks 未定义时的空指针错误
This commit is contained in:
晴天
2026-02-26 23:08:21 +08:00
parent d32ce81547
commit 8bf2caf788
7 changed files with 110 additions and 22 deletions

View File

@@ -3,6 +3,7 @@
*/
import { registerRoute, initRouter } from './router.js'
import { renderSidebar } from './components/sidebar.js'
import { initTheme } from './lib/theme.js'
// 样式
import './style/variables.css'
@@ -22,6 +23,9 @@ registerRoute('/mcp', () => import('./pages/mcp.js'))
registerRoute('/memory', () => import('./pages/memory.js'))
registerRoute('/deploy', () => import('./pages/deploy.js'))
// 初始化主题
initTheme()
// 初始化
const sidebar = document.getElementById('sidebar')
const content = document.getElementById('content')