Skip to content

Commit

Permalink
Fix: Toggle class in listener prefer-color-scheme: dark
Browse files Browse the repository at this point in the history
  • Loading branch information
ktquez committed May 8, 2020
1 parent 706b823 commit 5177f4b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/vue-dark-mode.vue
Expand Up @@ -130,14 +130,14 @@ export default {
}
},
handleColorModeClass (action, cls) {
handleColorModeClass (action) {
return document.documentElement.classList[action](`${this.currentMode}-mode`)
},
handlePreferColorScheme (e) {
if (this.isSystem) {
this.currentMode = e.matches ? 'dark' : 'light'
this.handleColorModeClass('remove')
this.currentMode = e.matches ? 'dark' : 'light'
this.setMode('system')
}
},
Expand Down

0 comments on commit 5177f4b

Please sign in to comment.