fix whitescreen when switching pages.
This commit is contained in:
1 parent
2533fc5f2a
commit
34c55fccb9
3 files changed
+26
-7
No files matched your search
@@ -140,6 +140,11 @@
|
||||
function apply(theme) {
|
||||
root.setAttribute('data-theme', theme);
|
||||
try { localStorage.setItem(STORAGE_KEY, theme); } catch (e) {}
|
||||
// Keep the inline html background/color-scheme in sync (set early
|
||||
// in head.php to prevent a white flash between page loads).
|
||||
var bg = window.BLOWDIT_THEME_BG || {};
|
||||
if (bg[theme]) { root.style.backgroundColor = bg[theme]; }
|
||||
root.style.colorScheme = (theme === 'light') ? 'light' : 'dark';
|
||||
syncIcon(theme);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user