Skip to content

Commit

Permalink
Remove stateful dark
Browse files Browse the repository at this point in the history
  • Loading branch information
cagataycivici committed Mar 26, 2024
1 parent 9027b57 commit dc77753
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,6 @@
import EventBus from '@/layouts/AppEventBus';
export default {
beforeMount() {
const isDark = localStorage['primevue-theme'] === 'dark' || (!('primevue-theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches);
if (isDark) document.documentElement.classList.add('p-dark');
else document.documentElement.classList.remove('p-dark');
this.$appState.darkTheme = isDark;
},
mounted() {
EventBus.on('theme-change', this.themeChangeListener);
},
Expand All @@ -38,7 +30,6 @@ export default {
if (isDark) document.documentElement.classList.add('p-dark');
else document.documentElement.classList.remove('p-dark');
localStorage['primevue-theme'] = isDark ? 'dark' : 'light';
this.$appState.darkTheme = isDark;
}
}
Expand Down

0 comments on commit dc77753

Please sign in to comment.