themes-noir/templates/overrides/noir/feature-grid.ninjatpl
Alex Dunmow 2f7239b76a fix(noir): reveal race, light-mode legibility, spacing, media, SVG guard
- Reveal: shorten scroll-reveal safety timeout below the capture settle and
  reveal-all when viewport height is unknown (headless), so main content is no
  longer stranded mid-fade at ~0.25 opacity in both modes; give the article
  template the robust reveal script it was missing. Fixes the washed-out
  light-mode body/quote copy AND the H1-over-first-line overlap (the translateY
  mid-transition was dropping the heading onto the body).
- Headings: add bottom margin per level so H1 no longer butts the first paragraph.
- Article: collapse the aside rail (and its divider border) when empty; populate
  each case article's aside with case-file marginalia.
- Light mode: bump muted-foreground contrast across all five presets (~L38->L30)
  for comfortable AA on secondary text; dark palettes untouched.
- Media: wire 6 licensed noir stock shots as seed media — harbour-night hero
  (with readable light-on-scrim hero text in both modes), per-article lead
  photos, typewriter on About.
- SVG geometry guard: explicit width/height on 26 <use> icon SVGs; replace 15
  unsized ::icon:: shortcodes with sized <svg><use> markup.
- Declare required_icon_packs (lucide, simple-icons).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-06 19:47:59 +08:00

19 lines
2.1 KiB
Plaintext

{# noir override — feature-grid; preserves eyebrow, heading, intro, columns, layout, items[].icon/.title/.text/.linkUrl/.linkLabel, icon split markup verbatim. #}
<section data-block-override="noir:feature-grid" class="py-12 md:py-16 bg-background text-foreground{% if class %} {{ class }}{% endif %}">
<div class="mx-auto max-w-6xl px-4">
{% if eyebrow %}<p class="text-center noir-label" style="color:hsl(var(--primary));">{{ eyebrow }}</p>{% endif %}
{% if heading %}<h2 class="noir-heading mt-2 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 %}
<div class="mt-10 grid grid-cols-1 gap-6 sm:grid-cols-2 {% if columns == 2 %}lg:grid-cols-2{% elif columns == 4 %}lg:grid-cols-4{% else %}lg:grid-cols-3{% endif %}">
{% for item in items %}
<div class="{% if layout == "card" %}noir-file p-6 text-card-foreground transition-colors{% elif layout == "centered" %}text-center{% endif %}">
{% if item.icon %}<div class="mb-3 text-primary{% if layout == "centered" %} flex justify-center{% endif %}"><svg width="28" height="28" class="h-7 w-7" aria-hidden="true"><use href="/icons/{{ item.icon|split:":"|first }}.svg#{{ item.icon|split:":"|last }}"></use></svg></div>{% endif %}
<h3 class="noir-heading text-lg" style="color:hsl(var(--foreground));">{% if item.linkUrl %}<a href="{{ item.linkUrl }}" class="transition-colors hover:text-primary">{{ item.title }}</a>{% else %}{{ item.title }}{% endif %}</h3>
{% if item.text %}<p class="noir-body mt-2" style="color:hsl(var(--muted-foreground));">{{ item.text }}</p>{% endif %}
{% if item.linkUrl and item.linkLabel %}<a href="{{ item.linkUrl }}" class="noir-link mt-3 inline-flex items-center gap-1 text-sm">{{ item.linkLabel }}<svg width="16" height="16" class="h-4 w-4" aria-hidden="true"><use href="/icons/lucide.svg#arrow-right"></use></svg></a>{% endif %}
</div>
{% endfor %}
</div>
</div>
</section>