Apply color theme to HTML page itself (#2132)

This commit is contained in:
Eric Bailey 2023-12-07 13:00:44 -06:00 committed by GitHub
parent 17c27581b6
commit cdc1d08267
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 0 deletions

View file

@ -23,6 +23,7 @@ export function Provider({children}: React.PropsWithChildren<{}>) {
)
React.useEffect(() => {
updateDocument(persisted.get('colorMode')) // set on load
return persisted.onUpdate(() => {
setState(persisted.get('colorMode'))
updateDocument(persisted.get('colorMode'))