fix(web): prevent flashing white background in dark mode on page load/reload (#19934)

* prevent flashing white background in dark mode on page load/reload, tested with Safari and Chrome on macOS

* integrate into existing FOUC-prevention

---------

Co-authored-by: Evan <evan@MacBook-Pro.local>
This commit is contained in:
evan314159 2025-07-16 22:34:45 +08:00 committed by GitHub
parent 743b6644e9
commit 32f23b8d38
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -21,6 +21,11 @@
html { html {
height: 100%; height: 100%;
width: 100%; width: 100%;
background-color: rgb(255, 255, 255);
}
html.dark {
background-color: rgb(10, 10, 10);
} }
body, body,
@ -29,6 +34,10 @@
padding: 0; padding: 0;
} }
body {
transition: background-color 0.15s ease;
}
@keyframes delayedVisibility { @keyframes delayedVisibility {
to { to {
visibility: visible; visibility: visible;