make appearance consistent

This commit is contained in:
Cory Dransfeldt 2023-03-15 19:52:53 -07:00
parent a80789dc41
commit 6057eb7065
No known key found for this signature in database
2 changed files with 11 additions and 0 deletions

View file

@ -0,0 +1,10 @@
;(function () {
const isDarkMode = () =>
localStorage.theme === 'dark' ||
(!('theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)
if (isDarkMode()) {
document.documentElement.classList.add('dark')
} else {
document.documentElement.classList.remove('dark')
}
})()