diff --git a/php/public/toggle-dark-mode.js b/php/public/toggle-dark-mode.js index 9fc17193..773a9f18 100644 --- a/php/public/toggle-dark-mode.js +++ b/php/public/toggle-dark-mode.js @@ -22,5 +22,5 @@ function applySavedTheme() { } } -// Immediately apply the saved theme -applySavedTheme(); +// Apply theme when the page loads +document.addEventListener('DOMContentLoaded', applySavedTheme);