Skip to content

Commit

Permalink
Addressing light mode flicker issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxim Shelepov committed Dec 13, 2023
1 parent a7cace0 commit 392ee7e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/views/MainView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,12 @@ const useDark = () => {
// credit: https://tailwindcss.com/docs/dark-mode#supporting-system-preference-and-manual-selection
if (localStorage.theme === 'dark' || (!('theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
document.documentElement.classList.add('dark')
document.documentElement.classList.remove('bg-white')
darkModeActive.value = true
console.log("using dark")
} else {
document.documentElement.classList.remove('dark')
document.documentElement.classList.add('bg-white')
darkModeActive.value = false
console.log("no longer using dark")
}
}
Expand Down

0 comments on commit 392ee7e

Please sign in to comment.