release: v0.2.1 — bug修复、代码去重、功能增强、覆盖率88.57%

This commit is contained in:
2026-07-25 13:01:59 +08:00
parent cca2675fb4
commit bc1128bd1f
23 changed files with 1703 additions and 320 deletions
+2 -5
View File
@@ -1,7 +1,7 @@
/**
* MetonaToast Themes — 主题管理
* @module themes
* @version 0.2.0
* @version 0.2.1
*/
import { THEMES } from './constants.js';
@@ -30,13 +30,10 @@ export const getTheme = (theme: string): string => {
};
/**
* 解析主题
* 解析主题 — 'auto' 始终按系统主题检测,不依赖当前手动选择的主题
*/
export const resolveTheme = (theme: string): string => {
if (theme === 'auto') {
if (currentTheme && currentTheme !== 'auto') {
return currentTheme;
}
return getSystemTheme();
}
return theme;