feat(theme): 新增主题模式配置,支持跟随系统

- 新增 site.theme.mode 配置(dark/light/system)
- 支持 prefers-color-scheme 系统主题跟随
- 用户手动切换后停止跟随并持久化

ref #36
This commit is contained in:
rbetree
2026-01-17 00:59:05 +08:00
parent d19c4da51d
commit 1049566937
4 changed files with 138 additions and 29 deletions

View File

@@ -34,6 +34,13 @@ security:
# 示例:
# allowedSchemes: [http, https, mailto, tel, obsidian, vscode]
# 主题设置:默认明暗模式(可选)
# - mode: dark | light | system
# - dark/light首屏默认主题用户点击按钮切换后会写入 localStorage 并覆盖该默认值
# - system跟随系统 prefers-color-scheme用户手动切换后同样会写入 localStorage 并停止跟随
theme:
mode: dark # 可选: dark | light | system默认 dark
# 字体设置:全站基础字体
# - source: css | google | system
# - css: 通过 cssUrl 引入第三方字体 CSS