fix(gotham): hero text forced light over image scrims — light-mode hero was dark-on-dark

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Alex Dunmow 2026-07-06 19:39:37 +08:00
parent f3328a9ae9
commit 539b4a5302

View File

@ -9,12 +9,13 @@
{% set sUrl = ctaSecondary|get:"url" %}
{% set variant = template|default:"centered" %}
{% set hasImage = backgroundImage %}
{% set heroOnImage = "" %}{% if hasImage and overlayColor != "light" %}{% set heroOnImage = "on" %}{% endif %}
{% set showOverlay = hasImage and overlayColor != "none" and overlayColor != "" %}
{% macro herocontent(align) %}
{% macro herocontent(align, onImage) %}
{% if eyebrowText %}<div class="mb-5 flex items-center gap-4 {% if align == "center" %}justify-center{% endif %}"><span class="reel-rule w-10"></span><span class="reel-caps text-xs text-primary">{{ eyebrowText }}</span><span class="reel-rule w-10"></span></div>{% endif %}
{% if headlineText %}<h1 class="reel-caps text-4xl sm:text-5xl lg:text-6xl leading-tight" style="font-family:var(--font-heading, 'Antonio', 'Oswald', 'Bebas Neue', sans-serif);color:hsl(var(--foreground));">{{ headlineText }}</h1>{% endif %}
{% if subText %}<h2 class="mt-5 text-xl sm:text-2xl italic max-w-2xl{% if align == "center" %} mx-auto{% endif %}" style="color:hsl(var(--muted-foreground));font-family:var(--font-body, 'Cormorant Garamond', Georgia, serif);">{{ subText }}</h2>{% endif %}
{% if descText %}<p class="mt-4 max-w-xl leading-relaxed{% if align == "center" %} mx-auto{% endif %}" style="color:hsl(var(--muted-foreground));">{{ descText }}</p>{% endif %}
{% if headlineText %}<h1 class="reel-caps text-4xl sm:text-5xl lg:text-6xl leading-tight" style="font-family:var(--font-heading, 'Antonio', 'Oswald', 'Bebas Neue', sans-serif);color:{% if onImage == "on" %}hsl(40 30% 97%){% else %}hsl(var(--foreground)){% endif %};">{{ headlineText }}</h1>{% endif %}
{% if subText %}<h2 class="mt-5 text-xl sm:text-2xl italic max-w-2xl{% if align == "center" %} mx-auto{% endif %}" style="color:{% if onImage == "on" %}hsl(40 22% 88% / 0.92){% else %}hsl(var(--muted-foreground)){% endif %};font-family:var(--font-body, 'Cormorant Garamond', Georgia, serif);">{{ subText }}</h2>{% endif %}
{% if descText %}<p class="mt-4 max-w-xl leading-relaxed{% if align == "center" %} mx-auto{% endif %}" style="color:{% if onImage == "on" %}hsl(40 20% 85% / 0.9){% else %}hsl(var(--muted-foreground)){% endif %};">{{ descText }}</p>{% endif %}
{% if pText or sText %}<div class="mt-8 flex flex-col sm:flex-row gap-4{% if align == "center" %} justify-center{% endif %}">
{% if pText and pUrl %}<a href="{{ pUrl }}" class="reel-btn inline-flex items-center justify-center gap-2">{{ pText }}</a>{% endif %}
{% if sText and sUrl %}<a href="{{ sUrl }}" class="reel-link inline-flex items-center justify-center">{{ sText }}</a>{% endif %}
@ -27,7 +28,7 @@
{% if variant == "split" %}
<section data-block-override="gotham:hero" class="hero grid grid-cols-1 lg:grid-cols-2 overflow-hidden bg-background text-foreground border-y border-[hsl(var(--primary)/0.5)]{% if class %} {{ class }}{% endif %}">
<div class="relative min-h-[320px] bg-muted film-grain {% if mediaPosition == "left" %}order-1 lg:order-1{% else %}order-1 lg:order-2{% endif %}">{% if hasImage %}{% img backgroundImage alt=headlineText class="absolute inset-0 h-full w-full object-cover" layout="hero" %}<div class="absolute inset-0 letterbox-scrim" aria-hidden="true"></div>{% endif %}</div>
<div class="flex flex-col justify-center px-6 py-16 lg:px-12 {% if mediaPosition == "left" %}order-2 lg:order-2{% else %}order-2 lg:order-1{% endif %}"><div class="reveal max-w-lg text-left">{{ herocontent("left") }}</div></div>
<div class="flex flex-col justify-center px-6 py-16 lg:px-12 {% if mediaPosition == "left" %}order-2 lg:order-2{% else %}order-2 lg:order-1{% endif %}"><div class="reveal max-w-lg text-left">{{ herocontent("left", "") }}</div></div>
</section>
{% else %}
{% set align = "center" %}
@ -37,6 +38,6 @@
<div class="pointer-events-none absolute inset-x-0 top-0 z-[2] h-px bg-[hsl(var(--primary))]" aria-hidden="true"></div>
<div class="pointer-events-none absolute inset-x-0 bottom-0 z-[2] h-px bg-[hsl(var(--primary))]" aria-hidden="true"></div>
<div class="pointer-events-none absolute inset-0 z-[1]" aria-hidden="true" style="background-image:radial-gradient(circle at var(--sx,50%) var(--sy,42%), hsl(var(--primary) / 0.14), transparent 60%);"></div>
<div class="reveal relative z-10 mx-auto w-full max-w-4xl px-6 py-16 sm:px-10 sm:py-20 {% if variant == "left-aligned" %}text-left{% else %}text-center{% endif %}">{{ herocontent(align) }}</div>
<div class="reveal relative z-10 mx-auto w-full max-w-4xl px-6 py-16 sm:px-10 sm:py-20 {% if variant == "left-aligned" %}text-left{% else %}text-center{% endif %}">{{ herocontent(align, heroOnImage) }}</div>
</section>
{% endif %}