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:
Samuel Newman
2026-01-15 04:41:59 +02:00
committed by GitHub
parent 8f82ad66df
commit 10aa46aa9e
4 changed files with 88 additions and 60 deletions
+1
View File
@@ -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)
}
}