We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d360290 commit 514ed5eCopy full SHA for 514ed5e
resources/views/components/theme-switcher.blade.php
@@ -1,6 +1,6 @@
1
<script>
2
setDarkClass = () => {
3
- if (localStorage.theme === 'dark' || (!('theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
+ if (localStorage.theme === 'dark' || ((!('theme' in localStorage) || !['light', 'dark'].includes(localStorage.theme)) && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
4
document.documentElement.classList.add('dark')
5
} else {
6
document.documentElement.classList.remove('dark')
0 commit comments