Radish alpha
r
rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5
Radicle web interface
Radicle
Git
add event listener to hot reload theme
Jappie3 committed 1 year ago
commit 032b269cb9fbaee0306a4fba31ff7c09da54e1a1
parent b050924
1 file changed +7 -0
modified src/App.svelte
@@ -24,6 +24,13 @@

  const activeRouteStore = router.activeRouteStore;

+
  window
+
    .matchMedia("(prefers-color-scheme: dark)")
+
    .addEventListener("change", ({ matches }) => {
+
      theme.set(matches ? "dark" : "light");
+
      followSystemTheme.set(true);
+
    });
+

  void router.loadFromLocation();

  $: document.documentElement.setAttribute("data-codefont", $codeFont);