mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-02 02:00:31 +08:00
add event listener to hot reload theme
This commit is contained in:
committed by
Sebastian Martinez
parent
b050924caa
commit
032b269cb9
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user