+
mdi-white-balance-sunny
- 亮色
+ {{ tm("theme.customize.light")}}
mdi-moon-waning-crescent
- 暗色
+ {{ tm("theme.customize.dark")}}
+
+
+ mdi-sync
+ {{ tm("theme.customize.auto")}}
+
+
+ mdi-help-circle-outline
+
+ {{ tm("theme.customize.autoSwitchDesc") }}
+
-
+
{{ tm("theme.customize.colors") }}
@@ -344,14 +358,24 @@ const toastStore = useToastStore();
const theme = useTheme();
const customizer = useCustomizerStore();
-// Theme mode toggle (light/dark)
-const isDarkMode = ref(customizer.isDarkTheme ? "dark" : "light");
+// Theme mode toggle (light/dark/auto)
+const themeMode = computed({
+ get() {
+ if (customizer.autoSwitchTheme) return "auto";
+ return customizer.isDarkTheme ? "dark" : "light";
+ },
+ set(mode: string) {
+ if (mode === "auto") {
+ customizer.SET_AUTO_SYNC(true);
+ customizer.APPLY_SYSTEM_THEME();
+ return;
+ }
-const toggleThemeMode = (mode: string) => {
- const newTheme = mode === "dark" ? DARK_THEME_NAME : LIGHT_THEME_NAME;
- customizer.SET_UI_THEME(newTheme);
- vuetify.theme.change(newTheme);
-};
+ customizer.SET_AUTO_SYNC(false);
+ const newTheme = mode === "dark" ? DARK_THEME_NAME : LIGHT_THEME_NAME;
+ customizer.SET_UI_THEME(newTheme);
+ },
+});
const getStoredColor = (key, fallback) => {
const stored =