From c17fc68ea365847fd7a83ffca8ed653facbe909e Mon Sep 17 00:00:00 2001 From: Furrium Network Date: Sun, 9 Aug 2026 19:06:55 +0800 Subject: [PATCH] Update theme.js --- js/theme.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/js/theme.js b/js/theme.js index b205a3c..48c9209 100644 --- a/js/theme.js +++ b/js/theme.js @@ -38,4 +38,9 @@ function applyTheme() { const theme = getTheme(); document.documentElement.setAttribute('data-theme', theme); updateThemeUI(theme); -} \ No newline at end of file +} + +// 确保 DOM 加载完成后执行 +document.addEventListener('DOMContentLoaded', function() { + applyTheme(); +});