From c53aee712385f3e9b6da7e81a16ac6ae8aea26be Mon Sep 17 00:00:00 2001 From: Alexander Bocken Date: Mon, 16 Feb 2026 18:46:59 +0100 Subject: [PATCH] recipes: replace Card with CompactCard + CSS grid on all sub-pages Migrate all recipe sub-pages from the old fixed-size Card component inside flex-wrap Recipes wrapper to CompactCard with responsive CSS grid for visual consistency with the main recipes page. --- src/app.css | 25 +++++++++ src/lib/components/recipes/CompactCard.svelte | 3 +- .../components/recipes/RecipeEditor.svelte | 1 - .../[recipeLang=recipeLang]/+page.svelte | 21 ------- .../admin/untranslated/+page.svelte | 56 +++++++++++++++---- .../category/[category]/+page.svelte | 13 ++--- .../favorites/+page.svelte | 11 ++-- .../[recipeLang=recipeLang]/icon/+page.svelte | 5 -- .../icon/[icon]/+page.svelte | 13 ++--- .../search/+page.svelte | 11 ++-- .../season/+page.svelte | 13 ++--- .../season/[month]/+page.svelte | 13 ++--- .../tag/[tag]/+page.svelte | 13 ++--- 13 files changed, 107 insertions(+), 91 deletions(-) diff --git a/src/app.css b/src/app.css index c5039b5..d661373 100644 --- a/src/app.css +++ b/src/app.css @@ -344,3 +344,28 @@ a:focus-visible { color: var(--nord0); } } + +/* ============================================ + RECIPE GRID + Responsive card grid used across recipe pages + ============================================ */ + +.recipe-grid { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); + gap: 1.5em; + padding: 0 1.5em; + max-width: 1400px; + margin: 0 auto 2em; +} +@media (min-width: 600px) { + .recipe-grid { + grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); + } +} +@media (min-width: 1024px) { + .recipe-grid { + grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); + gap: 1.8em; + } +} diff --git a/src/lib/components/recipes/CompactCard.svelte b/src/lib/components/recipes/CompactCard.svelte index b78b713..53bafc2 100644 --- a/src/lib/components/recipes/CompactCard.svelte +++ b/src/lib/components/recipes/CompactCard.svelte @@ -4,6 +4,7 @@ let { recipe, current_month = 0, + icon_override = false, isFavorite = false, showFavoriteIndicator = false, loading_strat = "lazy", @@ -19,7 +20,7 @@ recipe.images?.[0]?.alt || recipe.name ); - const isInSeason = $derived(recipe.season?.includes(current_month)); + const isInSeason = $derived(icon_override || recipe.season?.includes(current_month));