From 9bc38ec4d9f75bcbfa111ed7bf5c9d810b62b86d Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Tue, 9 Sep 2025 15:15:24 -0700 Subject: dark mode fix --- src/app.css | 10 +++++++++- src/routes/(app)/settings/nostr/+page.svelte | 3 ++- src/routes/+layout.svelte | 14 +++++++++++--- 3 files changed, 22 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/app.css b/src/app.css index fca47b23..901893b9 100644 --- a/src/app.css +++ b/src/app.css @@ -48,7 +48,15 @@ html { font-family: PublicSans, sans-serif; } .input { @apply input-lg input-primary h-16 px-4; } /* If you want to *turn* native inputs into DaisyUI inputs via @apply: */ -input:not([type="range"]) { @apply input input-lg input-primary h-16 px-4; } +input[type="text"], +input[type="email"], +input[type="password"], +input[type="number"], +input[type="search"], +input[type="url"], +input[type="tel"] { + @apply input input-lg input-primary h-16 px-4; +} textarea { @apply textarea textarea-lg textarea-primary py-4; } select { @apply select select-lg select-primary h-16 px-4; } diff --git a/src/routes/(app)/settings/nostr/+page.svelte b/src/routes/(app)/settings/nostr/+page.svelte index 9129e8f3..7168f4f7 100644 --- a/src/routes/(app)/settings/nostr/+page.svelte +++ b/src/routes/(app)/settings/nostr/+page.svelte @@ -172,7 +172,7 @@ onclick={() => copy(npub)} aria-label="Copy" > {$t("accounts.copy")} +{$t("accounts.qr")} diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 8ae31608..7653e05a 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -7,13 +7,21 @@ import { onMount } from "svelte"; import { installPrompt, theme as themeStore } from "$lib/store"; + +const map = { light: 'lofi', dark: 'black', system: 'system' }; + let { data, children } = $props(); let { pathname, theme } = $state(data); $effect(() => ($themeStore = data.theme)); $effect(() => (theme = $themeStore)); - $effect(() => { - document.documentElement.setAttribute("data-theme", theme); - }); +$effect(() => { + const v = map[theme] ?? theme; + if (!v || v === 'system') { + document.documentElement.removeAttribute('data-theme'); + } else { + document.documentElement.setAttribute('data-theme', v); + } +}); let host = PUBLIC_DOMAIN.includes("localhost") ? `http://${PUBLIC_DOMAIN}` -- cgit v1.2.3