width of the cards is the same now

This commit is contained in:
Priec
2026-06-26 20:30:34 +02:00
parent 1fc8796389
commit ba02930454
3 changed files with 9 additions and 3 deletions

View File

@@ -66,7 +66,10 @@
</div>
<div x-data="{ view: localStorage.getItem('shopView') === 'grid' ? 'grid' : 'list' }"
x-init="$watch('view', v => localStorage.setItem('shopView', v))"
:class="view === 'list' ? 'flex flex-col gap-4' : 'grid grid-cols-2 gap-4 sm:grid-cols-3'">
{# Fixed-width cards (14rem), identical to the shop. Cards never stretch;
the column just fits as many as it can (home fewer, shop more), so a
card is the exact same width on both pages regardless of column count. #}
:class="view === 'list' ? 'flex flex-col gap-5' : 'grid grid-cols-2 gap-5 sm:grid-cols-[repeat(auto-fill,14rem)] sm:justify-center'">
{% for product in products %}
{% include "shop/_card.html" %}
{% endfor %}