From f4e9f6d0bace85e22a7ac8e140d4a1ac9dfd7f69 Mon Sep 17 00:00:00 2001 From: Bendik Aagaard Lynghaug Date: Tue, 1 Sep 2026 17:17:11 +0200 Subject: [PATCH] site.yaml wordmark_height; raster logos keep their colors Custom wordmark sizing per site (0.5-6 rem, clamped at render), and the light-theme invert now applies only to .svg wordmarks - the white-stroke house style - so a client's raster logo is never recolored. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01Y42TyF8Zu7NGRR2893vNcZ --- src/app.rs | 18 ++++++++++++++++-- src/content.rs | 5 +++++ style/main.css | 8 ++++---- 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/src/app.rs b/src/app.rs index ffa784a..14e6b46 100644 --- a/src/app.rs +++ b/src/app.rs @@ -555,7 +555,21 @@ fn Hero(title: String, description: String, landing: bool, site: SiteConfig, cur None }; let has_module = module.is_some(); + // Light theme inverts white-stroke wordmarks to ink. The house + // mark and the sibling-site marks are all white-stroke SVGs; a + // raster logo is a client brand and keeps its colors. + let house_wordmark = site + .wordmark + .as_deref() + .map(|w| w.ends_with(".svg")) + .unwrap_or(true); let wordmark = site.wordmark.clone().unwrap_or_else(|| "/wordmark.svg".to_string()); + // Clamped server-side too, but belt and braces for the inline style. + let wordmark_style = site + .wordmark_height + .filter(|h| (0.5..=6.0).contains(h)) + .map(|h| format!("height: {h}rem")) + .unwrap_or_default(); let site_title = site.title.clone().unwrap_or_else(|| SITE_NAME.to_string()); let piece_ref: NodeRef = NodeRef::new(); @@ -641,8 +655,8 @@ fn Hero(title: String, description: String, landing: bool, site: SiteConfig, cur } })}
- - site_title/ + + site_title

{title}

{description}

diff --git a/src/content.rs b/src/content.rs index db3b2c2..68740ef 100644 --- a/src/content.rs +++ b/src/content.rs @@ -513,6 +513,11 @@ pub struct SiteConfig { /// `None` falls back to `/wordmark.svg`. #[serde(default)] pub wordmark: Option, + /// Wordmark display height in rem (0.5–6.0). `None` keeps the + /// stylesheet's default. Raster logos look best at or below their + /// intrinsic pixel height. + #[serde(default)] + pub wordmark_height: Option, #[serde(default)] pub hero: HeroConfig, } diff --git a/style/main.css b/style/main.css index 2814b05..04f9383 100644 --- a/style/main.css +++ b/style/main.css @@ -99,10 +99,10 @@ --hero-glow: rgba(246, 245, 241, 0.85); } - /* The wordmark SVG is a hardcoded white stroke (also used raw in - dark contexts elsewhere) - flip it to ink here rather than fork - the asset. */ - .wordmark img { + /* The house wordmark SVG is a hardcoded white stroke (also used + raw in dark contexts elsewhere) - flip it to ink here rather + than fork the asset. A content-provided logo keeps its colors. */ + .wordmark-house img { filter: invert(0.92); }