themes-coffee/blocks/loyalty_card.ninjatpl
Alex Dunmow beca13796d fix(coffee): pin explicit width/height on all <use> icon SVGs + Wave B gallery screenshots
Root cause: featured_pour's empty-media placeholder used an external <use>
SVG (svg class=h-24 w-24 + use href=/icons/lucide.svg#coffee) sized ONLY by
Tailwind utilities. The host Tailwind JIT does not reliably emit utility
classes used solely in a theme block template, so h-24/w-24 could be dropped
from the generated stylesheet; the SVG (no viewBox, no intrinsic size) then
ballooned to fill its aspect-square parent (~350-500px cup silhouettes over
the hero/blog cards). Fix pins width/height geometry attributes on every
<use> icon SVG so size is CSS-independent and deterministic.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-06 10:34:17 +08:00

25 lines
3.0 KiB
Plaintext

{% with filled=filled|default:0 %}
<section data-block="coffee:loyalty_card" class="py-12 md:py-16 bg-background text-foreground{% if class %} {{ class }}{% endif %}">
<div class="mx-auto max-w-md px-4">
<div class="coffee-card coffee-torn-top coffee-torn-bottom relative p-6 text-center">
{% if title %}<h3 class="coffee-display text-2xl text-primary">{{ title }}</h3>{% endif %}
{% if subtitle %}<p class="coffee-hand mt-1 text-xl text-accent">{{ subtitle }}</p>{% endif %}
<div class="mt-6 grid grid-cols-5 gap-3">
<span class="coffee-punch{% if filled >= 1 %} coffee-punch-on{% endif %}">{% if filled >= 1 %}<svg width="20" height="20" class="h-5 w-5" aria-hidden="true"><use href="/icons/lucide.svg#coffee"></use></svg>{% endif %}</span>
<span class="coffee-punch{% if filled >= 2 %} coffee-punch-on{% endif %}">{% if filled >= 2 %}<svg width="20" height="20" class="h-5 w-5" aria-hidden="true"><use href="/icons/lucide.svg#coffee"></use></svg>{% endif %}</span>
<span class="coffee-punch{% if filled >= 3 %} coffee-punch-on{% endif %}">{% if filled >= 3 %}<svg width="20" height="20" class="h-5 w-5" aria-hidden="true"><use href="/icons/lucide.svg#coffee"></use></svg>{% endif %}</span>
<span class="coffee-punch{% if filled >= 4 %} coffee-punch-on{% endif %}">{% if filled >= 4 %}<svg width="20" height="20" class="h-5 w-5" aria-hidden="true"><use href="/icons/lucide.svg#coffee"></use></svg>{% endif %}</span>
<span class="coffee-punch{% if filled >= 5 %} coffee-punch-on{% endif %}">{% if filled >= 5 %}<svg width="20" height="20" class="h-5 w-5" aria-hidden="true"><use href="/icons/lucide.svg#coffee"></use></svg>{% endif %}</span>
<span class="coffee-punch{% if filled >= 6 %} coffee-punch-on{% endif %}">{% if filled >= 6 %}<svg width="20" height="20" class="h-5 w-5" aria-hidden="true"><use href="/icons/lucide.svg#coffee"></use></svg>{% endif %}</span>
<span class="coffee-punch{% if filled >= 7 %} coffee-punch-on{% endif %}">{% if filled >= 7 %}<svg width="20" height="20" class="h-5 w-5" aria-hidden="true"><use href="/icons/lucide.svg#coffee"></use></svg>{% endif %}</span>
<span class="coffee-punch{% if filled >= 8 %} coffee-punch-on{% endif %}">{% if filled >= 8 %}<svg width="20" height="20" class="h-5 w-5" aria-hidden="true"><use href="/icons/lucide.svg#coffee"></use></svg>{% endif %}</span>
<span class="coffee-punch{% if filled >= 9 %} coffee-punch-on{% endif %}">{% if filled >= 9 %}<svg width="20" height="20" class="h-5 w-5" aria-hidden="true"><use href="/icons/lucide.svg#coffee"></use></svg>{% endif %}</span>
<span class="coffee-punch{% if filled >= 10 %} coffee-punch-on coffee-punch-reward{% endif %}"><svg width="20" height="20" class="h-5 w-5" aria-hidden="true"><use href="/icons/lucide.svg#gift"></use></svg></span>
</div>
{% if reward %}<p class="coffee-body mt-6 text-sm text-muted-foreground">{{ reward }}</p>{% endif %}
{% if footnote %}<p class="coffee-hand mt-2 text-lg text-accent">{{ footnote }}</p>{% endif %}
</div>
</div>
</section>
{% endwith %}