Files
hms/apps/web/src/hooks/useThemeMode.ts
iven e56cd73e49 feat(web): 多主题系统 — 4 套主题 + CSS 变量 + Ant Design 动态主题
- CSS 变量层: :root 默认 blue, [data-theme] 覆盖 warm/dark/emerald
- Ant Design: ConfigProvider 按 ThemeName 切换 token + algorithm
- ThemeSwitcher: 下拉面板含 4 主题色块预览 + localStorage 持久化
- useThemeMode: 从 store 读取主题名替代色值比对(修复 33 页面暗色失效)
- index.html: 添加 Noto Serif SC 字体(warm 主题衬线标题)
2026-04-28 00:20:02 +08:00

12 lines
336 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { useAppStore } from '../stores/app';
/**
* 判断当前是否处于暗色主题模式。
*
* 通过 store 的主题名称判断,替代旧的 token 色值检测,
* 支持多主题系统blue / warm / dark / emerald
*/
export function useThemeMode(): boolean {
return useAppStore((s) => s.theme) === 'dark';
}