mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
feat: further reduce darkmode init flash (#5701)
* feat: further reduce darkmode init flash * fix lint * tweak doc * colocate code
This commit is contained in:
parent
7eaf47c9d4
commit
9cccac1458
3 changed files with 26 additions and 4 deletions
|
@ -34,6 +34,6 @@
|
|||
}
|
||||
|
||||
.LoadingMessage--dark {
|
||||
background-color: $oc-black;
|
||||
color: $oc-white;
|
||||
background-color: #121212;
|
||||
color: #ced4da;
|
||||
}
|
||||
|
|
|
@ -524,6 +524,9 @@ const ExcalidrawWrapper = () => {
|
|||
|
||||
useEffect(() => {
|
||||
localStorage.setItem(STORAGE_KEYS.LOCAL_STORAGE_THEME, theme);
|
||||
// currently only used for body styling during init (see public/index.html),
|
||||
// but may change in the future
|
||||
document.documentElement.classList.toggle("dark", theme === THEME.DARK);
|
||||
}, [theme]);
|
||||
|
||||
const onChange = (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue