Prevent flash of wrong theme on startup (web) (#9577)
* prevent flash of wrong theme on startup * move bg color to #root * Update and use existing system * Darken slightly, better contrast --------- Co-authored-by: Eric Bailey <git@esb.lol>
This commit is contained in:
@@ -51,6 +51,7 @@ function updateDocument(theme: ThemeName) {
|
||||
html.classList.add(`theme--${theme}`)
|
||||
// set color to 'theme-color' meta tag
|
||||
meta?.setAttribute('content', getBackgroundColor(theme))
|
||||
window.localStorage.setItem('ALF_THEME', theme)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user