added theme checking if localstorage is empty
11ty build and deploy for ${{ gitea.repository }} / build-deploy (push) Successful in 21s
Details
11ty build and deploy for ${{ gitea.repository }} / build-deploy (push) Successful in 21s
Details
This commit is contained in:
parent
dff1fa475b
commit
9055bf392f
|
@ -28,6 +28,9 @@ customElements.define('theme-switcher', class extends HTMLElement {
|
||||||
} else if (this.currentTheme == 'light') {
|
} else if (this.currentTheme == 'light') {
|
||||||
checkbox.checked = false
|
checkbox.checked = false
|
||||||
document.body.classList.toggle('light')
|
document.body.classList.toggle('light')
|
||||||
|
} else {
|
||||||
|
console.log(this.preferDark)
|
||||||
|
checkbox.checked = this.preferDark
|
||||||
}
|
}
|
||||||
|
|
||||||
checkbox.addEventListener('click', () => {
|
checkbox.addEventListener('click', () => {
|
||||||
|
|
Loading…
Reference in New Issue