fix: render whole sections for factory-compiled sites (0.6.2)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
42a258903d
commit
f386e65783
23
docs/adr/0001-compiled-sites-render-whole-sections.md
Normal file
23
docs/adr/0001-compiled-sites-render-whole-sections.md
Normal file
@ -0,0 +1,23 @@
|
||||
# Compiled sites render whole sections on corporate-modernist
|
||||
|
||||
Decided 2026-11-20 for corporate-modernist 0.6.2, from the website factory's visual review (orchestrator WO-094, ADR 0078).
|
||||
|
||||
## Context
|
||||
|
||||
The website factory compiles a customer's site onto this theme and renders every page at 1280 and 390 pixels wide. The review found template defects that show on a real site as an empty region, an unreadable hero or a page wider than a phone.
|
||||
|
||||
## Decision
|
||||
|
||||
- rich-section renders one column with the text at a readable width when the section has no image. It used to keep a two-column grid with an empty media cell, so a compiled site whose about or contact section was waiting for a photo showed half the section blank. The media frame (a bordered grey box) renders only when there is an image.
|
||||
- team honours `columns` (2, 3 or 4) with the `cm-grid` classes; with no `columns` it keeps `cm-leadership-grid`.
|
||||
- The split hero section no longer carries `cm-hero-split`, which made the section itself a two-column grid and squeezed the hero into its left half.
|
||||
- The mobile menu toggle is hidden from 768px with a selector that outranks `.cm-btn-outline`, which had kept it visible beside the desktop links.
|
||||
- An image logo is sized (`.cm-brand-logo` 2.5rem high, `.cm-footer-logo` 2rem) and drops the square brand mark, which belongs to the text logo. An uploaded logo used to render at its full pixel size.
|
||||
- Paragraphs in `.cm-text` are spaced, so a multi-paragraph body no longer runs together.
|
||||
|
||||
## Consequences
|
||||
|
||||
- corporate-modernist 0.6.2 is published to the dev registry; the orchestrator's `internal/factory/themes.yaml` pins it.
|
||||
- No schema field changes. A site that sets the old values renders as before wherever it has an image.
|
||||
|
||||
Keywords: corporate-modernist, rich-section, media, mediaPosition, empty column, hero, overlayColor, scrim, contrast, navbar, backdrop-blur, bn-navbar-drawer, team columns, WO-094, website factory, render review
|
||||
@ -162,6 +162,7 @@ css:
|
||||
.cm-text { font-family: var(--font-body, "Inter", system-ui, sans-serif); font-size: 17px; line-height: 28px; color: hsl(var(--foreground)); font-variant-numeric: tabular-nums; }
|
||||
.cm-text a { color: hsl(var(--accent)); text-decoration: underline; text-underline-offset: 2px; }
|
||||
.cm-text strong { font-weight: 600; }
|
||||
.cm-text p + p { margin-top: 1em; }
|
||||
.cm-lede { font-family: var(--font-body, "Inter", system-ui, sans-serif); font-size: 1.25rem; line-height: 1.6; color: hsl(var(--muted-foreground)); }
|
||||
.cm-eyebrow { font-family: var(--font-heading, "Inter", system-ui, sans-serif); font-size: 0.8125rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; color: hsl(var(--accent)); margin: 0 0 1rem 0; }
|
||||
.cm-kicker { font-family: var(--font-mono, "JetBrains Mono", ui-monospace, monospace); font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: hsl(var(--muted-foreground)); }
|
||||
@ -220,7 +221,9 @@ css:
|
||||
.cm-nav-link { font-family: var(--font-body, "Inter", system-ui, sans-serif); font-size: 0.9375rem; color: hsl(var(--foreground)); text-decoration: none; padding-bottom: 2px; border-bottom: 2px solid transparent; transition: border-color 150ms ease; }
|
||||
.cm-nav-link:hover { border-bottom-color: hsl(var(--accent)); }
|
||||
.cm-nav-toggle { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; }
|
||||
@media (min-width: 768px) { .cm-nav-toggle { display: none; } }
|
||||
@media (min-width: 768px) { .cm-navbar .cm-nav-toggle { display: none; } }
|
||||
.cm-brand-logo { display: block; height: 2.5rem; width: auto; max-width: 14rem; object-fit: contain; }
|
||||
.cm-footer-logo { display: block; height: 2rem; width: auto; max-width: 12rem; object-fit: contain; }
|
||||
.cm-nav-drawer { display: none; flex-direction: column; gap: 0.25rem; padding: 0.5rem 0 1rem; border-top: 1px solid hsl(var(--border)); width: 100%; }
|
||||
@media (min-width: 768px) { .cm-nav-drawer { display: none !important; } }
|
||||
.cm-nav-drawer a { padding: 0.625rem 0; font-family: var(--font-body, "Inter", system-ui, sans-serif); color: hsl(var(--foreground)); text-decoration: none; border-bottom: 1px solid hsl(var(--border)); }
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
name = "corporate-modernist"
|
||||
display_name = "Corporate Modernist"
|
||||
scope = "@themes"
|
||||
version = "0.6.1"
|
||||
version = "0.6.2"
|
||||
description = "Swiss-grid B2B theme with restrained typography, a single configurable accent, and trust-signal blocks for enterprise sites."
|
||||
kind = "theme"
|
||||
categories = ["templates"]
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
{% if trustLogos %}<div class="cm-hairline-top" style="margin-top: 3rem; padding-top: 1.5rem;"><p class="cm-kicker cm-eyebrow" style="margin-bottom: 1rem; color: hsl(var(--muted-foreground));">Trusted by</p><div class="cm-logo-row" style="display: flex; flex-wrap: wrap; align-items: center; gap: 2rem;">{% for logo in trustLogos %}{% if logo.url %}<a href="{{ logo.url }}">{% img logo.image alt=logo.alt class="cm-logo" %}</a>{% else %}{% img logo.image alt=logo.alt class="cm-logo" %}{% endif %}{% endfor %}</div></div>{% endif %}
|
||||
{% endmacro %}
|
||||
{% if variant == "split" and backgroundImage %}
|
||||
<section class="cm-hero cm-hero-split {{ class }}" style="padding-top: 3.5rem; padding-bottom: 3.5rem;"><div class="cm-content-well"><div class="cm-grid cm-grid-2" style="align-items: center;"><div>{{ herobody() }}</div><div class="cm-media-frame" style="aspect-ratio: 4 / 3; background: hsl(var(--muted)); border: 1px solid hsl(var(--border)); overflow: hidden; {% if mediaPosition == "left" %}order: -1;{% endif %}">{% img backgroundImage alt=headlineText class="cm-hero-media" %}</div></div></div></section>
|
||||
<section class="cm-hero {{ class }}" style="padding-top: 3.5rem; padding-bottom: 3.5rem;"><div class="cm-content-well"><div class="cm-grid cm-grid-2" style="align-items: center;"><div>{{ herobody() }}</div><div class="cm-media-frame" style="aspect-ratio: 4 / 3; background: hsl(var(--muted)); border: 1px solid hsl(var(--border)); overflow: hidden; {% if mediaPosition == "left" %}order: -1;{% endif %}">{% img backgroundImage alt=headlineText class="cm-hero-media" %}</div></div></div></section>
|
||||
{% else %}
|
||||
<section class="cm-hero {{ class }}" style="padding-top: 3.5rem; padding-bottom: 3.5rem; {% if variant == "left-aligned" %}text-align: left;{% else %}text-align: center;{% endif %}"><div class="cm-content-well" style="{% if variant != "left-aligned" %}display: flex; flex-direction: column; align-items: center;{% endif %}"><div style="max-width: 60ch; width: 100%;">{{ herobody() }}</div></div></section>
|
||||
{% endif %}
|
||||
|
||||
@ -1 +1 @@
|
||||
<nav class="cm-navbar {{ class }}" aria-label="Primary"><a class="cm-brand" href="/"><span class="cm-mark cm-mark-square" aria-hidden="true"></span>{% if logoType == "image" and logo %}{% img logo alt=alt|default:"Home" class="cm-brand-logo" %}{% else %}<span>{{ logoText.text|default:logoText|default:context.site.title|default:"Studio" }}</span>{% endif %}</a><div class="cm-nav-links">{% for item in menu.items %}<a class="cm-nav-link" href="{{ item.url }}"{% if item.open_in_new_tab %} target="_blank" rel="noopener"{% endif %}>{{ item.label|default:item.title }}</a>{% endfor %}{% if cta.text and cta.url %}<a class="cm-btn-primary cm-btn-sm" href="{{ cta.url }}">{{ cta.text }}</a>{% endif %}</div><input type="checkbox" id="cm-nav-toggle-cb" class="cm-nav-cb" style="display:none;"><label for="cm-nav-toggle-cb" class="cm-nav-toggle cm-btn-outline cm-btn-sm" aria-label="Toggle menu"><svg class="inline-block h-4 w-4" width="16" height="16" aria-hidden="true"><use href="/icons/lucide.svg#menu"/></svg></label><div class="cm-nav-drawer">{% for item in menu.items %}<a href="{{ item.url }}"{% if item.open_in_new_tab %} target="_blank" rel="noopener"{% endif %}>{{ item.label|default:item.title }}</a>{% endfor %}{% if cta.text and cta.url %}<a href="{{ cta.url }}" class="cm-btn-primary cm-btn-sm" style="margin-top:0.75rem;">{{ cta.text }}</a>{% endif %}</div><style>.cm-nav-cb:checked ~ .cm-nav-drawer{display:flex;}</style></nav>
|
||||
<nav class="cm-navbar {{ class }}" aria-label="Primary"><a class="cm-brand" href="/">{% if logoType == "image" and logo %}{% img logo alt=alt|default:"Home" class="cm-brand-logo" %}{% else %}<span class="cm-mark cm-mark-square" aria-hidden="true"></span><span>{{ logoText.text|default:logoText|default:context.site.title|default:"Studio" }}</span>{% endif %}</a><div class="cm-nav-links">{% for item in menu.items %}<a class="cm-nav-link" href="{{ item.url }}"{% if item.open_in_new_tab %} target="_blank" rel="noopener"{% endif %}>{{ item.label|default:item.title }}</a>{% endfor %}{% if cta.text and cta.url %}<a class="cm-btn-primary cm-btn-sm" href="{{ cta.url }}">{{ cta.text }}</a>{% endif %}</div><input type="checkbox" id="cm-nav-toggle-cb" class="cm-nav-cb" style="display:none;"><label for="cm-nav-toggle-cb" class="cm-nav-toggle cm-btn-outline cm-btn-sm" aria-label="Toggle menu"><svg class="inline-block h-4 w-4" width="16" height="16" aria-hidden="true"><use href="/icons/lucide.svg#menu"/></svg></label><div class="cm-nav-drawer">{% for item in menu.items %}<a href="{{ item.url }}"{% if item.open_in_new_tab %} target="_blank" rel="noopener"{% endif %}>{{ item.label|default:item.title }}</a>{% endfor %}{% if cta.text and cta.url %}<a href="{{ cta.url }}" class="cm-btn-primary cm-btn-sm" style="margin-top:0.75rem;">{{ cta.text }}</a>{% endif %}</div><style>.cm-nav-cb:checked ~ .cm-nav-drawer{display:flex;}</style></nav>
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
{# rich-section override — two-column media + rich text, hairline surface options. #}
|
||||
<section class="cm-section {% if background == "muted" %}cm-surface-muted{% elif background == "card" %}cm-surface-card{% endif %} {{ class }}"><div class="cm-content-well"><div class="cm-grid cm-grid-2" style="align-items: center;">
|
||||
<div>
|
||||
<section class="cm-section {% if background == "muted" %}cm-surface-muted{% elif background == "card" %}cm-surface-card{% endif %} {{ class }}"><div class="cm-content-well"><div class="cm-grid {% if media %}cm-grid-2{% endif %}" style="align-items: center;">
|
||||
<div{% if not media %} class="cm-measure"{% endif %}>
|
||||
{% if eyebrow %}<p class="cm-eyebrow">{{ eyebrow }}</p>{% endif %}
|
||||
{% if heading %}<h2 class="cm-heading" style="font-size: clamp(1.75rem, 3vw, 2.25rem); margin: 0 0 1rem 0;"><span class="cm-heading-h2-accent">{{ heading }}</span></h2>{% endif %}
|
||||
{% if body %}<div class="cm-text" style="color: hsl(var(--muted-foreground)); line-height: 1.7;">{{ body|safe }}</div>{% endif %}
|
||||
{% if ctaUrl and ctaLabel %}<a class="cm-btn-ghost" href="{{ ctaUrl }}" style="margin-top: 1.5rem;">{{ ctaLabel }}<svg class="inline-block h-4 w-4" width="16" height="16" aria-hidden="true"><use href="/icons/lucide.svg#arrow-right"/></svg></a>{% endif %}
|
||||
</div>
|
||||
<div class="cm-media-frame" style="aspect-ratio: 4 / 3; background: hsl(var(--muted)); border: 1px solid hsl(var(--border)); overflow: hidden; {% if mediaPosition == "left" %}order: -1;{% endif %}">{% if media %}{% img media alt=mediaAlt class="cm-rich-media" %}{% endif %}</div>
|
||||
{% if media %}<div class="cm-media-frame" style="aspect-ratio: 4 / 3; background: hsl(var(--muted)); border: 1px solid hsl(var(--border)); overflow: hidden; {% if mediaPosition == "left" %}order: -1;{% endif %}">{% img media alt=mediaAlt class="cm-rich-media" %}</div>{% endif %}
|
||||
</div></div></section>
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
<section class="cm-section {{ class }}"><div class="cm-content-well">
|
||||
{% if heading %}<h2 class="cm-heading" style="font-size: clamp(1.75rem, 3vw, 2.25rem); margin: 0 0 0.75rem 0;"><span class="cm-heading-h2-accent">{{ heading }}</span></h2>{% endif %}
|
||||
{% if intro %}<p class="cm-lede" style="max-width: 60ch; margin: 0 0 2.5rem 0; color: hsl(var(--muted-foreground));">{{ intro }}</p>{% endif %}
|
||||
{% if members %}<div class="{% if layout == "list" %}cm-stack{% elif layout == "single" %}cm-measure{% else %}cm-leadership-grid{% endif %}">{% for member in members %}<div class="cm-feature">
|
||||
{% if members %}<div class="{% if layout == "list" %}cm-stack{% elif layout == "single" %}cm-measure{% elif columns == 2 %}cm-grid cm-grid-2{% elif columns == 3 %}cm-grid cm-grid-3{% elif columns == 4 %}cm-grid cm-grid-4{% else %}cm-leadership-grid{% endif %}">{% for member in members %}<div class="cm-feature">
|
||||
{% if member.photo %}<div class="cm-media-frame" style="aspect-ratio: 1 / 1; background: hsl(var(--muted)); border: 1px solid hsl(var(--border)); overflow: hidden; margin-bottom: 1rem;">{% img member.photo alt=member.name class="cm-team-photo" %}</div>{% endif %}
|
||||
{% if member.name %}<h3 class="cm-feature-title" style="margin: 0;">{{ member.name }}</h3>{% endif %}
|
||||
{% if member.role %}<div class="cm-stat-label" style="margin-top: 0.25rem;">{{ member.role }}</div>{% endif %}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user