🐛 修复潜在的ssg问题

This commit is contained in:
li-chx
2025-10-05 03:01:52 +08:00
parent 51a39d498b
commit 1cefa4c661
7 changed files with 56 additions and 44 deletions
+1 -3
View File
@@ -1,8 +1,6 @@
// darkVerify.js
if (
localStorage.getItem('system-theme-mode') === "dark" ||
(!localStorage.getItem('system-theme-mode') &&
window.matchMedia("(prefers-color-scheme: dark)").matches)
window.matchMedia("(prefers-color-scheme: dark)").matches
) {
document.querySelector('html').classList.add('dark');
document.querySelector('html').classList.remove('light');