Load theme in top-level App.svelte

Previously the theme was only loaded when the <ThemeSettings> component
was loaded in the footer. This stopped working since we removed the
layout around the loading spinner.
This commit is contained in:
Rūdolfs Ošiņš
2024-01-02 14:25:59 +00:00
parent d4ca379245
commit b3e212ff5b
3 changed files with 26 additions and 34 deletions
+5
View File
@@ -5,6 +5,8 @@
import * as httpd from "@app/lib/httpd";
import { unreachable } from "@app/lib/utils";
import { codeFont, theme } from "@app/lib/appearance";
import FullscreenModalPortal from "./App/FullscreenModalPortal.svelte";
import Hotkeys from "./App/Hotkeys.svelte";
import LoadingBar from "./App/LoadingBar.svelte";
@@ -37,6 +39,9 @@
plausible.enableAutoPageviews();
}
$: document.documentElement.setAttribute("data-codefont", $codeFont);
$: document.documentElement.setAttribute("data-theme", $theme);
</script>
<style>