Skip to content

Commit

Permalink
Enable light mode and OLED mode as options (#936)
Browse files Browse the repository at this point in the history
Will eventually need the new component from knossos to be ported, but this will suffice for now
  • Loading branch information
triphora authored Dec 12, 2023
1 parent c1518c5 commit 1bd721d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions theseus_gui/src/store/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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`)
},
},
Expand Down

0 comments on commit 1bd721d

Please sign in to comment.