Enable light mode and OLED mode as options (#936)

Will eventually need the new component from knossos to be ported, but this will suffice for now
This commit is contained in:
Emma Alexia 2023-12-11 22:51:29 -05:00 committed by GitHub
parent c1518c52f3
commit 1bd721d523
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,10 +2,9 @@ import { defineStore } from 'pinia'
export const useTheming = defineStore('themeStore', {
state: () => ({
themeOptions: ['dark'],
themeOptions: ['dark', 'light', 'oled'],
advancedRendering: true,
selectedTheme: 'dark',
darkTheme: true,
}),
actions: {
setThemeState(newTheme) {
@ -15,8 +14,9 @@ export const useTheming = defineStore('themeStore', {
this.setThemeClass()
},
setThemeClass() {
document.getElementsByTagName('html')[0].classList.remove('dark-mode')
document.getElementsByTagName('html')[0].classList.remove('light-mode')
for (const theme of this.themeOptions) {
document.getElementsByTagName('html')[0].classList.remove(`${theme}-mode`)
}
document.getElementsByTagName('html')[0].classList.add(`${this.selectedTheme}-mode`)
},
},