From b3e212ff5bea3bf07069812df89e4ae67db93e4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C5=ABdolfs=20O=C5=A1i=C5=86=C5=A1?= Date: Tue, 2 Jan 2024 14:25:59 +0000 Subject: [PATCH] Load theme in top-level App.svelte Previously the theme was only loaded when the component was loaded in the footer. This stopped working since we removed the layout around the loading spinner. --- src/App.svelte | 5 +++++ src/App/Header/ThemeSettings.svelte | 21 +++--------------- src/lib/appearance.ts | 34 +++++++++++++++-------------- 3 files changed, 26 insertions(+), 34 deletions(-) diff --git a/src/App.svelte b/src/App.svelte index de0dd1138..fae1137b3 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -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);