From da57ad1ac8d853f70eb5afcd1d94d0e35b8594e0 Mon Sep 17 00:00:00 2001 From: Peter Meier Date: Sun, 19 Apr 2026 12:42:37 +0200 Subject: [PATCH] fix: update styling and structure in various components - Changed margin class from `my-6` to `mb-6` in ContentRows.svelte for consistent spacing. - Updated PostCard.svelte to use `$derived` for post properties, enhancing reactivity. - Refined DeadlineBannerBlock.svelte by removing unnecessary border classes and improving layout for better content alignment. - Modified Button.svelte to support rendering children directly, enhancing flexibility. - Added `tabindex="0"` to TabBar.svelte for improved accessibility. - Fixed textarea closing tag in Textarea.svelte for proper HTML structure. - Corrected span closing tag in Toggle.svelte for valid markup. --- src/lib/components/ContentRows.svelte | 2 +- src/lib/components/PostCard.svelte | 2 +- .../blocks/DeadlineBannerBlock.svelte | 64 +++++++++++-------- src/lib/ui/Button.svelte | 5 +- src/lib/ui/TabBar.svelte | 1 + src/lib/ui/Textarea.svelte | 2 +- src/lib/ui/Toggle.svelte | 2 +- 7 files changed, 47 insertions(+), 31 deletions(-) diff --git a/src/lib/components/ContentRows.svelte b/src/lib/components/ContentRows.svelte index b2487ee..f01333f 100644 --- a/src/lib/components/ContentRows.svelte +++ b/src/lib/components/ContentRows.svelte @@ -89,7 +89,7 @@ ]); -
+
{#each rows as row} {#if row.content.length > 0}
-
-
-
+ {/snippet} + {#if href} + + {@render inner()} + + {:else} +
+ {@render inner()} +
+ {/if}
{/if} diff --git a/src/lib/ui/Button.svelte b/src/lib/ui/Button.svelte index 3fec64d..f47a4f5 100644 --- a/src/lib/ui/Button.svelte +++ b/src/lib/ui/Button.svelte @@ -9,6 +9,7 @@ loading = false, type = 'button' as 'button' | 'submit' | 'reset', label = '', + children, } = $props(); const base = @@ -40,7 +41,9 @@ {#if loading} Laden... + {:else if children} + {@render children()} {:else} - {label} + {label} {/if} diff --git a/src/lib/ui/TabBar.svelte b/src/lib/ui/TabBar.svelte index 91b4204..1e0cc0e 100644 --- a/src/lib/ui/TabBar.svelte +++ b/src/lib/ui/TabBar.svelte @@ -30,6 +30,7 @@ role="tablist" aria-label={labelledBy || 'Tabs'} class="flex h-12 border-b border-stein-200" + tabindex="0" onkeydown={handleKeydown} > {#each tabs as tab} diff --git a/src/lib/ui/Textarea.svelte b/src/lib/ui/Textarea.svelte index 9928b6a..5da98fa 100644 --- a/src/lib/ui/Textarea.svelte +++ b/src/lib/ui/Textarea.svelte @@ -44,7 +44,7 @@ class="min-h-[120px] w-full resize-y rounded-lg border bg-white px-4 py-3 text-base text-stein-800 outline-none placeholder:text-stein-400 {error || invalid ? 'border-error ring-2 ring-error-subtle' : 'border-stein-300 hover:border-stein-400 focus:border-wald-500 focus:ring-2 focus:ring-wald-100'} disabled:bg-stein-100 disabled:opacity-60" - /> + > {#if error}