themes
ci / docker_image (push) Successful in 58s
ci / deploy (push) Successful in 16s

This commit is contained in:
2025-01-01 18:59:01 -06:00
parent 1ba1c25c84
commit 327ba53b69
7 changed files with 23 additions and 38 deletions
-9
View File
@@ -1,9 +0,0 @@
const saved_theme = localStorage.getItem('theme');
if (saved_theme) {
document.body.setAttribute('data-theme', saved_theme);
} else {
const prefers_dark = window.matchMedia('(prefers-color-scheme: dark)').matches;
const theme = prefers_dark ? 'dark' : 'light';
document.body.setAttribute('data-theme', theme);
localStorage.setItem('theme', theme);
}