Skip to content

feat: add unified dark mode with system preference detection#58

Open
Mou7s wants to merge 4 commits into
wmpeng:mainfrom
Mou7s:dark-mode
Open

feat: add unified dark mode with system preference detection#58
Mou7s wants to merge 4 commits into
wmpeng:mainfrom
Mou7s:dark-mode

Conversation

@Mou7s

@Mou7s Mou7s commented Jul 6, 2026

Copy link
Copy Markdown

为全站添加统一的深色模式支持。

架构

  • \styles/dark-mode.css\ — 统一暗色覆盖文件(所有页面公共引入)
  • \styles/shared.css\ — 基础 CSS 变量 + 通用组件暗色适配
  • \scripts/shared.js\ — 设置面板深色模式开关

覆盖页面(12个)

  • index.html — 主对比页
  • plan-usage.html — 用量提交页
  • coding-agents.html — 编程 Agent 页
  • relays.html — 中转站页
  • relay-detect.html — 中转检测页
  • 7 篇 articles 文章页

行为

  • 首次访问自动跟随系统 prefers-color-scheme
  • 手动切换后记住用户选择(localStorage)
  • 设置面板内与超宽屏开关并列

Mou7s added 4 commits July 6, 2026 10:28
- Add CSS variables for dark mode in shared.css and plan-usage.css
- Add dark mode toggle in settings panel (shared.js)
- Auto-follow system prefers-color-scheme when user hasn't manually toggled
- Persist manual choice in localStorage
- Adapt table, filter, recommendation card, feedback panel for dark mode
- Cover index.html, coding-agents.html inline styles
- Fix dark mode for form inputs, selects, textareas in all pages
- Fix dark mode for records table in plan-usage.html
- Fix dark mode for relay cards, matrix tables, filter inputs
- Fix dark mode for result cards, toast, lightbox components
- Add styles/dark-mode.css as single source of dark mode overrides
- Generic table styles (th/td/tr) cover .records-table, .comparison-table,
  .models-mini-table across all pages
- Page-specific overrides for index, plan-usage, coding-agents, relays,
  relay-detect, and article pages
- Auto-follow system prefers-color-scheme on first visit
- Manual toggle saved to localStorage for subsequent visits
- Clean up ~500 lines of scattered inline dark mode blocks from HTML files
- Add serve.ts to .gitignore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant