Skip to content

Commit

Permalink
Use system default for theme IF not overridden
Browse files Browse the repository at this point in the history
  • Loading branch information
LordRalex committed May 14, 2021
1 parent 7f29cac commit 62e5dbb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ export default {
},
beforeCreate() {
const t = localStorage.getItem("dark-theme");
if (t === "dark") {
//if the storage doesn't indicate one, and the system is dark, use dark
if ((window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches && !t) || t === 'dark') {
this.$vuetify.theme.dark = true;
}
},
Expand Down

0 comments on commit 62e5dbb

Please sign in to comment.