mirror of
https://github.com/owntone/owntone-server.git
synced 2025-10-29 15:55:02 -04:00
[web] Simplify appearance switching
This commit is contained in:
parent
482a5bdafc
commit
939dab6a48
File diff suppressed because one or more lines are too long
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user