From 5221b310ff3dd40f3ea106a9e236a69f21c6fbb7 Mon Sep 17 00:00:00 2001 From: Alex Dunmow Date: Sun, 5 Jul 2026 17:58:34 +0800 Subject: [PATCH] fix(cyberpunk): repair blank-hero .text bug + move responsive layout to Tailwind MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hero blank-hero bug: eyebrow/headline/subheadline/description read field.text|default:field, which hard-errors in the ninjatpl engine on bare-string seed values (attribute access on a string), blanking the whole hero. Switch to field|get:"text"|default:field — the process-global `get` filter degrades gracefully on both {text,...} objects and bare strings. Responsive layout back to Tailwind (supersedes the prior CSS-class approach in 6787a01): the host Tailwind build now scans theme .ninjatpl, so the cp-grid / cp-cols / cp-span / cp-split / cp-article-grid classes were exact reimplementations of stock utilities. Restore plain Tailwind in the templates (grid grid-cols-1 sm:/md:/lg:grid-cols-*, gap-*, columns-*, col-span-*, before:* timeline connector) across feature-grid, pricing, stats, team, testimonial, contact-card, featured/related-posts, blog-hero, menu-list, event-list, hours-location, timeline, footer, gallery, rich-section, roster_grid, article + hero split section, and delete the duplicate CSS from manifest css.input_css_append. Kept as genuinely bespoke design CSS: cp-hero-* bounded clamp() min-heights (the anti-balloon whitespace fix — not a stock min-h-* utility; restoring min-h-screen would reintroduce the empty neon void) and the reduced-motion / high-contrast blocks. Scroll-reveal: cyberpunk ships no opacity-hidden .reveal content — its two IntersectionObservers (hero digital-rain, stats countUp) fire on the IO initial callback when already in view and both have static, visible no-JS / reduced-motion fallbacks, so content is never hidden behind JS. make (codeless .bnp) OK; check-safety 32 checks 19 ok 13 skip -> OK. No version bump. No push. Co-Authored-By: Claude Opus 4.8 --- blocks/roster_grid.ninjatpl | 2 +- manifest.yaml | 72 ++----------------- templates/cyberpunk/article.ninjatpl | 2 +- .../overrides/cyberpunk/blog-hero.ninjatpl | 2 +- .../overrides/cyberpunk/contact-card.ninjatpl | 2 +- .../overrides/cyberpunk/event-list.ninjatpl | 2 +- .../overrides/cyberpunk/feature-grid.ninjatpl | 2 +- .../cyberpunk/featured-posts.ninjatpl | 2 +- templates/overrides/cyberpunk/footer.ninjatpl | 6 +- .../overrides/cyberpunk/gallery.ninjatpl | 2 +- templates/overrides/cyberpunk/hero.ninjatpl | 10 +-- .../cyberpunk/hours-location.ninjatpl | 2 +- .../overrides/cyberpunk/menu-list.ninjatpl | 2 +- .../overrides/cyberpunk/pricing.ninjatpl | 2 +- .../cyberpunk/related-posts.ninjatpl | 2 +- .../overrides/cyberpunk/rich-section.ninjatpl | 2 +- templates/overrides/cyberpunk/stats.ninjatpl | 2 +- templates/overrides/cyberpunk/team.ninjatpl | 2 +- .../overrides/cyberpunk/testimonial.ninjatpl | 2 +- .../overrides/cyberpunk/timeline.ninjatpl | 2 +- 20 files changed, 32 insertions(+), 90 deletions(-) diff --git a/blocks/roster_grid.ninjatpl b/blocks/roster_grid.ninjatpl index 1429edf..c2f279d 100644 --- a/blocks/roster_grid.ninjatpl +++ b/blocks/roster_grid.ninjatpl @@ -4,7 +4,7 @@ {% if eyebrow %}

{{ eyebrow }}

{% endif %} {% if heading %}

{{ heading }}

{% endif %} {% if intro %}

{{ intro }}

{% endif %} -
+
{% for member in members %}
{% if member.avatar %}{% img member.avatar alt=member.name class="h-full w-full object-cover" %}{% else %}{% endif %} diff --git a/manifest.yaml b/manifest.yaml index 03225af..4fa5471 100644 --- a/manifest.yaml +++ b/manifest.yaml @@ -351,77 +351,19 @@ css: linear-gradient(to bottom, transparent, hsl(var(--background) / 0.6)); } - /* --- Responsive layout utilities (theme-owned, media-query driven) ---- */ - /* The host Tailwind build does NOT reliably compile responsive utility - variants (sm:/md:/lg:grid-cols-*, min-h-screen, arbitrary values) that - appear only in this theme's templates, so multi-column grids collapse - to a single column at every width and heroes lose their min-height. - Drive the load-bearing responsive layout from explicit CSS instead. - Layout only — no colour literals (colours stay on semantic tokens). */ - - .cp-grid { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1fr); } - .cp-grid.cp-g-none { gap: 0; } - .cp-grid.cp-g-tight { gap: 1rem; } - .cp-grid.cp-g-wide { gap: 2rem; } - .cp-grid.cp-g-xl { gap: 2.5rem; } - .cp-grid.cp-m2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } - @media (min-width: 640px) { - .cp-grid.cp-s2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } - } - @media (min-width: 768px) { - .cp-grid.cp-md2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } - .cp-grid.cp-md3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } - .cp-grid.cp-md4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } - } - @media (min-width: 1024px) { - .cp-grid.cp-lg2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } - .cp-grid.cp-lg3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } - .cp-grid.cp-lg4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } - .cp-grid.cp-lg5 { grid-template-columns: repeat(5, minmax(0, 1fr)); } - } - .cp-span2 { grid-column: span 2; } - @media (min-width: 1024px) { .cp-lg-span1 { grid-column: span 1; } } - - /* Masonry column-count (gallery) with the same reliability guarantee. */ - .cp-cols { column-gap: 1rem; } - .cp-cols.cp-c2 { columns: 2; } - @media (min-width: 768px) { - .cp-cols.cp-md-c2 { columns: 2; } - .cp-cols.cp-md-c3 { columns: 3; } - .cp-cols.cp-md-c4 { columns: 4; } - } - - /* Two-column content split (rich-section, hours-location) + article aside. */ - .cp-split { display: grid; gap: 2.5rem; grid-template-columns: minmax(0, 1fr); } - @media (min-width: 768px) { - .cp-split.cp-split-md { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4rem; } - } - .cp-article-grid { display: grid; gap: 2.5rem; grid-template-columns: minmax(0, 1fr); } - @media (min-width: 1024px) { - .cp-article-grid { grid-template-columns: minmax(0, 1fr) 260px; } - } - - /* --- Hero heights (bounded; host drops min-h-screen / arbitrary vh) ---- */ - /* Capped so a sparse hero never balloons into an empty neon void, while a - populated hero still reads full-bleed. */ + /* --- Hero heights (bespoke bounded clamp — anti-balloon) -------------- */ + /* Responsive grids/columns/spans/splits are plain Tailwind utilities in the + templates (grid-cols-*, columns-*, col-span-*, gap-*) — the host build + scans theme .ninjatpl, so no CSS reimplementation of those. + These hero min-heights stay CSS: a bespoke clamp() that caps a sparse + hero so it never balloons into an empty neon void while a populated hero + still reads full-bleed — not a stock min-h-* utility. */ .cp-hero-tall { min-height: clamp(32rem, 82vh, 50rem); } .cp-hero-mid { min-height: clamp(28rem, 70vh, 44rem); } .cp-hero-short { min-height: clamp(20rem, 50vh, 30rem); } .cp-hero-auto { min-height: 22rem; } .cp-hero-split { min-height: clamp(20rem, 46vh, 28rem); } - /* Vertical-timeline connector line (arbitrary before:* utilities dropped). */ - .cp-timeline { position: relative; } - .cp-timeline::before { - content: ""; - position: absolute; - left: 1rem; - top: 0.5rem; - width: 1px; - height: calc(100% - 1rem); - background: hsl(var(--primary) / 0.5); - } - /* --- Reduced motion: kill all motion --------------------- */ @media (prefers-reduced-motion: reduce) { diff --git a/templates/cyberpunk/article.ninjatpl b/templates/cyberpunk/article.ninjatpl index dc73894..42eae26 100644 --- a/templates/cyberpunk/article.ninjatpl +++ b/templates/cyberpunk/article.ninjatpl @@ -5,7 +5,7 @@ {{ admin_banner_html|safe }}
{{ slots.header|safe }}
-
+
{{ slots.main|safe }}
{% if slots.aside %}{% endif %}
diff --git a/templates/overrides/cyberpunk/blog-hero.ninjatpl b/templates/overrides/cyberpunk/blog-hero.ninjatpl index c92b02f..b4578be 100644 --- a/templates/overrides/cyberpunk/blog-hero.ninjatpl +++ b/templates/overrides/cyberpunk/blog-hero.ninjatpl @@ -7,7 +7,7 @@ {% if subtitle %}

{{ subtitle }}

{% endif %}
{% if posts %} -
+
{% for post in posts %}
{% if post.featured_image_url %}{% img post.featured_image_url alt=post.title class="aspect-video h-full w-full object-cover transition-transform duration-300 group-hover:scale-105" %}{% endif %} diff --git a/templates/overrides/cyberpunk/contact-card.ninjatpl b/templates/overrides/cyberpunk/contact-card.ninjatpl index 0517a66..be0d7b3 100644 --- a/templates/overrides/cyberpunk/contact-card.ninjatpl +++ b/templates/overrides/cyberpunk/contact-card.ninjatpl @@ -3,7 +3,7 @@
{% if heading %}

{{ heading }}

{% endif %} {% if description %}

{{ description }}

{% endif %} -
+
{% for channel in channels %}
{% if channel.icon %}{% endif %} diff --git a/templates/overrides/cyberpunk/event-list.ninjatpl b/templates/overrides/cyberpunk/event-list.ninjatpl index 30f5480..01c4ded 100644 --- a/templates/overrides/cyberpunk/event-list.ninjatpl +++ b/templates/overrides/cyberpunk/event-list.ninjatpl @@ -4,7 +4,7 @@ {% if heading %}

{{ heading }}

{% endif %} {% if intro %}

{{ intro }}

{% endif %} {% if layout == "cards" %} -
+
{% for event in events %}{% if not (hidePast and event.past) %}
{% if event.media %}
{% img event.media alt=event.title class="h-full w-full object-cover" %}
{% endif %} diff --git a/templates/overrides/cyberpunk/feature-grid.ninjatpl b/templates/overrides/cyberpunk/feature-grid.ninjatpl index b01336f..3a16038 100644 --- a/templates/overrides/cyberpunk/feature-grid.ninjatpl +++ b/templates/overrides/cyberpunk/feature-grid.ninjatpl @@ -5,7 +5,7 @@ {% if eyebrow %}

{{ eyebrow }}

{% endif %} {% if heading %}

{{ heading }}

{% endif %} {% if intro %}

{{ intro }}

{% endif %} -
+
{% for item in items %}
{% if item.icon %}
{% endif %} diff --git a/templates/overrides/cyberpunk/featured-posts.ninjatpl b/templates/overrides/cyberpunk/featured-posts.ninjatpl index 49767ed..efd5af9 100644 --- a/templates/overrides/cyberpunk/featured-posts.ninjatpl +++ b/templates/overrides/cyberpunk/featured-posts.ninjatpl @@ -3,7 +3,7 @@
{% if heading %}

{{ heading }}

{% endif %} -
+
{% for post in posts %}
{{ legalbar() }} {% else %} -
-
+
+
{% if logo %}{{ companyName }}{% elif companyName %}{{ companyName }}{% endif %} {% if tagline %}

{{ tagline }}

{% endif %} {% if address or email or phone %}
{% if address %}
{{ address }}
{% endif %}{% if email %}{% endif %}{% if phone %}{% endif %}
{% endif %} {{ sociallinks("mt-5") }}
{% for col in columns %}

{{ col.header }}

{% endfor %} -{% if showNewsletter %}
{{ newsletter() }}
{% endif %} +{% if showNewsletter %}
{{ newsletter() }}
{% endif %}
{{ legalbar() }} {% endif %} diff --git a/templates/overrides/cyberpunk/gallery.ninjatpl b/templates/overrides/cyberpunk/gallery.ninjatpl index 8e0261d..75b2f61 100644 --- a/templates/overrides/cyberpunk/gallery.ninjatpl +++ b/templates/overrides/cyberpunk/gallery.ninjatpl @@ -1,5 +1,5 @@ {# gallery cyberpunk override: neon-edged tiles. Lightbox script + data-bn-* attributes + {% img %} preserved byte-for-byte. #} -{% with layout=layout|default:"grid" gap=gap|default:"md" cols=columns|default:3 %}{% if lightbox %}