From 05ccfc099700d1850a61a80555e2b485c4ff2c34 Mon Sep 17 00:00:00 2001 From: Luke Else Date: Thu, 26 Oct 2023 21:41:18 +0100 Subject: [PATCH] Added ability to switch between light and dark mode --- src/app.html | 45 +---------- src/lib/components/ThemeSwitcher.svelte | 102 ++++++++++++++++++++++++ src/lib/store.ts | 2 +- src/routes/+layout.svelte | 6 +- src/timeline.svelte | 4 +- static/themes/dark.css | 18 +++++ static/themes/light.css | 18 +++++ 7 files changed, 148 insertions(+), 47 deletions(-) create mode 100644 src/lib/components/ThemeSwitcher.svelte create mode 100644 static/themes/dark.css create mode 100644 static/themes/light.css diff --git a/src/app.html b/src/app.html index acd8655..b8bf4d4 100644 --- a/src/app.html +++ b/src/app.html @@ -10,56 +10,17 @@ %sveltekit.head% + + + + + + +
+ +
\ No newline at end of file diff --git a/src/lib/store.ts b/src/lib/store.ts index 543d65d..9d46f52 100644 --- a/src/lib/store.ts +++ b/src/lib/store.ts @@ -25,4 +25,4 @@ export const addToast = (toast: Toast) => { export const dismissToast = (id: number) => { toasts.update((all) => all.filter((t) => t.id !== id)); -}; +}; \ No newline at end of file diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 1b5f860..0cdcec1 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -1,5 +1,6 @@