mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-16 03:40:37 +08:00
Detect changes to system theme on first load
This commit is contained in:
+11
-1
@@ -2,7 +2,12 @@
|
||||
import * as router from "@app/lib/router";
|
||||
import { unreachable } from "@app/lib/utils";
|
||||
|
||||
import { codeFont, followSystemTheme, theme } from "@app/lib/appearance";
|
||||
import {
|
||||
codeFont,
|
||||
followSystemTheme,
|
||||
loadTheme,
|
||||
theme,
|
||||
} from "@app/lib/appearance";
|
||||
|
||||
import FullscreenModalPortal from "./App/FullscreenModalPortal.svelte";
|
||||
import Hotkeys from "./App/Hotkeys.svelte";
|
||||
@@ -32,6 +37,11 @@
|
||||
}
|
||||
});
|
||||
|
||||
// Detect any change to the system theme on first load.
|
||||
if ($followSystemTheme) {
|
||||
theme.set(loadTheme());
|
||||
}
|
||||
|
||||
void router.loadFromLocation();
|
||||
|
||||
$: document.documentElement.setAttribute("data-codefont", $codeFont);
|
||||
|
||||
Reference in New Issue
Block a user