[web] Simplify appearance switching

This commit is contained in:
Alain Nussbaumer 2025-06-09 09:13:14 +02:00
parent 482a5bdafc
commit 939dab6a48
2 changed files with 5 additions and 6 deletions

File diff suppressed because one or more lines are too long

View File

@ -36,12 +36,11 @@ export const useSettingsStore = defineStore('SettingsStore', {
},
setAppearance(appearance) {
this.$state.appearance = appearance
if (appearance === 'dark') {
document.documentElement.setAttribute('data-theme', 'dark')
} else if (appearance === 'light') {
document.documentElement.setAttribute('data-theme', 'light')
const element = document.documentElement
if (appearance === 'auto') {
element.removeAttribute('data-theme')
} else {
document.documentElement.removeAttribute('data-theme')
element.setAttribute('data-theme', appearance)
}
},
setLocale(locale) {