themes-noir/templates/overrides/noir/timeline.ninjatpl
Alex Dunmow 65457ca821 fix(noir): hero .text seed-safe + revert layout CSS to Tailwind utilities
Third remediation pass, superseding the hand-rolled-CSS approach of 0b3013c
now that the host Tailwind build scans theme .ninjatpl files.

Hero blank-on-bare-string fix:
- The four styled-text fields read field.text|default:field, which
  HARD-ERRORS when the seed passes a bare string (no .text attribute) and
  blanks the whole hero. Switch to field|get:"text"|default:field so the
  process-global get filter degrades gracefully on strings.

Layout back to Tailwind (Alex rule: don't reimplement standard utilities):
- Revert the .noir-cols*/.noir-cols-2up*/.noir-split/.noir-gap-*/.noir-hero-pad
  class swaps in 15 override templates back to plain grid/gap/padding
  utilities (grid-cols-*, gap-*, sm:/md:/lg: variants, py-*), and delete the
  matching hand-rolled media-query block from manifest css.input_css_append.
- Hero split now uses grid grid-cols-1 lg:grid-cols-2 with a Tailwind
  min-h-80 media frame (guarded so empty seed media does not balloon); the
  centered hero uses py-16 md:py-20 lg:py-24 instead of min-h-[75vh], keeping
  the dead-vertical-band trim.

Kept from the prior pass: robust .noir-reveal (instant reveal when already in
view + load/1600ms safety nets + no-JS/reduced-motion visible), tightened
section padding, and the genuinely bespoke safety CSS (empty-media img guards,
overflow-wrap, block max-width) — none of which are Tailwind-utility duplicates.

No version bump. make + check-safety both exit 0.

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

23 lines
2.2 KiB
Plaintext

{# noir override — timeline; preserves heading, intro, orientation, marker, steps[].label/.title/.text/.media. Marker rank-circles keep rounded-full; flag svg + {% img %} verbatim. #}
<section data-block-override="noir:timeline" class="py-16 md:py-24 bg-background text-foreground{% if class %} {{ class }}{% endif %}">
<div class="mx-auto max-w-4xl px-4">
{% if heading %}<h2 class="noir-heading text-center text-3xl md:text-4xl" style="color:hsl(var(--foreground));">{{ heading }}</h2>{% endif %}
{% if intro %}<p class="noir-body mx-auto mt-4 max-w-2xl text-center text-lg" style="color:hsl(var(--muted-foreground));">{{ intro }}</p>{% endif %}
<ol class="mt-12 {% if orientation == "horizontal" %}grid grid-cols-1 gap-8 sm:grid-cols-2 lg:grid-cols-4{% else %}relative space-y-8 before:absolute before:left-4 before:top-2 before:h-[calc(100%-1rem)] before:w-px before:bg-border{% endif %}">
{% for step in steps %}
<li class="{% if orientation == "horizontal" %}text-center{% else %}relative pl-14{% endif %}">
<span class="noir-mono flex h-8 w-8 items-center justify-center rounded-full bg-primary text-sm font-semibold text-primary-foreground {% if orientation == "horizontal" %}mx-auto{% else %}absolute left-0 top-0 ring-4 ring-background{% endif %}">
{% if marker == "numbered" %}{{ forloop.counter }}{% elif marker == "dot" %}<span class="h-2 w-2 rounded-full bg-primary-foreground"></span>{% else %}<svg class="h-4 w-4" aria-hidden="true"><use href="/icons/lucide.svg#flag"></use></svg>{% endif %}
</span>
<div class="{% if orientation == "horizontal" %}mt-4{% else %}pt-1{% endif %}">
{% if step.label %}<p class="noir-label" style="color:hsl(var(--primary));">{{ step.label }}</p>{% endif %}
{% if step.title %}<h3 class="noir-heading mt-1 text-lg" style="color:hsl(var(--foreground));">{{ step.title }}</h3>{% endif %}
{% if step.text %}<p class="noir-body mt-1" style="color:hsl(var(--muted-foreground));">{{ step.text }}</p>{% endif %}
{% if step.media %}<div class="mt-3 overflow-hidden noir-hairline grayscale">{% img step.media alt=step.title class="w-full h-auto object-cover" %}</div>{% endif %}
</div>
</li>
{% endfor %}
</ol>
</div>
</section>