优化白色主题渲染逻辑
This commit is contained in:
@@ -13,9 +13,18 @@
|
||||
// Prevent theme flicker
|
||||
(function() {
|
||||
const savedTheme = localStorage.getItem('theme');
|
||||
if (savedTheme === 'light') {
|
||||
const settings = window.SITE_SETTINGS || {};
|
||||
const defaultTheme = settings.default_theme || 'dark';
|
||||
const theme = savedTheme || defaultTheme;
|
||||
|
||||
if (theme === 'light') {
|
||||
document.documentElement.classList.add('light-theme');
|
||||
}
|
||||
|
||||
// Also apply title if available to prevent flicker
|
||||
if (settings.page_name) {
|
||||
document.title = settings.page_name;
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
</head>
|
||||
|
||||
Reference in New Issue
Block a user