mirror of
https://github.com/l0ng-ai/openidea.git
synced 2026-11-06 16:08:05 +00:00
12 lines
524 B
JavaScript
12 lines
524 B
JavaScript
/* global document, localStorage */
|
|
// Runs before the app's CSS loads: restores the last theme (theme.ts stores it)
|
|
// so a new window starts in it instead of flashing the light default.
|
|
// An external file because the CSP forbids inline scripts.
|
|
try {
|
|
const last = JSON.parse(localStorage.getItem("openidea.theme") ?? "null");
|
|
if (last?.theme) document.documentElement.dataset.theme = last.theme;
|
|
if (last?.contrast) document.documentElement.dataset.contrast = last.contrast;
|
|
} catch {
|
|
/* storage unavailable */
|
|
}
|