Files
overleaf-cep/services/web/frontend/stylesheets/base/initial-theme.scss
T
Domagoj Kriskovic 6c802c03a6 Fix dark-mode white flash when navigating between dashboard and library (#36785)
* Fix dark-mode white flash when navigating between dashboard and library

* Use userSettings object in layout-base.pug

* Move initial theme styles in a new file

* Sanitize data-initial-theme with a generic getInitialTheme helper

* Add getInitialTheme stub

GitOrigin-RevId: 80812093bbf75dc2a6f6f24710324a31a1930265
2026-09-17 12:04:10 +00:00

14 lines
498 B
SCSS

// Match body's background so the first paint isn't white in dark mode.
// Background only: color-scheme is set per container (e.g. .project-ds-nav-page)
[data-initial-theme='dark'] {
background-color: var(--bg-dark-primary);
}
[data-initial-theme='system'] {
// The 'system' theme is resolved client-side (useThemedPage), which also
// removes this attribute; until then, follow the OS preference.
@media (prefers-color-scheme: dark) {
background-color: var(--bg-dark-primary);
}
}