Add light/dark mode toggle

This commit is contained in:
2024-01-08 18:06:36 +11:00
parent 941cbca8e8
commit 21131fba6b
6 changed files with 9962 additions and 494 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,10 @@
(function() {
if (localStorage.theme === 'dark' || (!('theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
document.documentElement.classList.add('dark')
} else {
document.documentElement.classList.remove('dark')
}
document.addEventListener('alpine:init', () => {
Alpine.magic('clipboard', () => {
return subject => navigator.clipboard.writeText(subject)