theme: erststart (auch einrichtung) immer hell, statt windows-modus
Kein gespeicherter Wert -> 'light' (vorher 'system'). Inline-Skript im head setzt das Theme flackerfrei vor dem ersten Paint; gespeicherte Wahl bleibt. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -3635,7 +3635,7 @@ function closeBackup() {
|
||||
|
||||
// Theme mode: 'light', 'dark' or 'system' (follows Windows, also live when it changes).
|
||||
const systemDark = matchMedia('(prefers-color-scheme: dark)')
|
||||
let themeMode = 'system'
|
||||
let themeMode = 'light' // default until initTheme reads the saved choice (first start = light)
|
||||
|
||||
function applyTheme() {
|
||||
const theme = themeMode === 'system' ? (systemDark.matches ? 'dark' : 'light') : themeMode
|
||||
@@ -3690,7 +3690,7 @@ function initTheme() {
|
||||
let saved = null
|
||||
try { saved = localStorage.getItem('dash.theme') } catch {}
|
||||
saved = new URLSearchParams(location.search).get('theme') ?? saved
|
||||
themeMode = ['light', 'dark', 'system'].includes(saved) ? saved : 'system'
|
||||
themeMode = ['light', 'dark', 'system'].includes(saved) ? saved : 'light' // first start (also setup): light
|
||||
applyTheme()
|
||||
}
|
||||
systemDark.addEventListener('change', () => { if (themeMode === 'system') applyTheme() })
|
||||
|
||||
Reference in New Issue
Block a user