themes-coffee/blocks/featured_pour.ninjatpl
Alex Dunmow c2dd751f6b fix(coffee): remediate torn-mask clipping, empty-media & JIT-dropped layout
Layout/whitespace bugs:
- .coffee-torn-top/bottom used mask-size:100% 100%, stretching the 12px torn
  SVG over the whole element and masking away ~40% of tall cards as a wavy
  transparent cut-out — the cause of the clipped hero region, featured_pour
  and footer. Reworked to a fixed ~13px deckled band per edge over a solid
  gradient (plus a combined top+bottom selector).
- featured_pour showed an editor-style "Add a hero image" placeholder to
  visitors when the demo seed ships no image; now a tasteful token-based coffee
  glyph on the secondary surface. Same for the image block ("Add an image").
- hours today-highlight was accent-foreground text over a 15% accent tint
  (light-on-light, unreadable "Sunday"); now a readable full-row band with an
  accent left edge (class moved from <th> to <tr>).

Mobile responsiveness / JIT robustness (host Tailwind does not reliably compile
arbitrary/responsive utilities out of theme templates):
- Replaced min-h-[50vh|75vh|400px|320px], md:grid-cols-[2fr_3fr] and
  md:grid-cols-2 in hero/featured_pour/menu-list/hours with explicit CSS helper
  classes carrying real media queries; base is single-column so every grid
  collapses to 1 col on mobile regardless of the JIT.

Semantic tokens only; no version bump.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-05 17:25:36 +08:00

15 lines
1.4 KiB
Plaintext

<section data-block="coffee:featured_pour" class="py-12 md:py-16 bg-background text-foreground{% if class %} {{ class }}{% endif %}">
<div class="coffee-card coffee-torn-bottom coffee-pour-grid relative mx-auto max-w-4xl p-6">
<span class="coffee-hand absolute -top-4 left-6 inline-flex rotate-[-3deg] items-center gap-1 rounded-full bg-accent px-4 py-1 text-lg text-accent-foreground shadow-sm">{{ label|default:"Featured pour" }}</span>
<div class="aspect-square overflow-hidden rounded-sm bg-secondary">
{% if image %}{% img image alt=name|default:"Featured pour" class="h-full w-full object-cover" %}{% else %}<div class="flex h-full w-full items-center justify-center bg-secondary text-primary/20"><svg class="h-24 w-24" aria-hidden="true"><use href="/icons/lucide.svg#coffee"></use></svg></div>{% endif %}
</div>
<div class="flex flex-col gap-3">
{% if origin %}<p class="coffee-hand text-xl text-accent">{{ origin }}</p>{% endif %}
{% if name %}<h3 class="coffee-display text-3xl text-primary"><span class="coffee-doodle-underline">{{ name }}</span></h3>{% else %}<h3 class="coffee-display text-3xl italic text-muted-foreground">Featured pour</h3>{% endif %}
{% if tasting %}<div class="coffee-body max-w-none text-foreground [&_strong]:text-primary">{{ tasting|safe }}</div>{% endif %}
{% if price %}<div class="coffee-price mt-1 text-2xl">{{ currency|default:"$" }}{{ price }}</div>{% endif %}
</div>
</div>
</section>