From 99b29bb09fa8b0493022b6fb9e69c79c73c3ccda Mon Sep 17 00:00:00 2001 From: Bendik Aagaard Lynghaug Date: Tue, 1 Sep 2026 20:26:34 +0200 Subject: [PATCH] wordmark_invert: explicit, not inferred from .svg A content-shipped colour logo (Klingenberg's red tile) was being inverted to teal in light theme by the .svg heuristic. Invert is now an explicit site.yaml flag defaulting to house-mark-only; content logos keep their colours unless they opt in. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01Y42TyF8Zu7NGRR2893vNcZ --- Cargo.lock | 2 +- src/app.rs | 12 ++++-------- src/content.rs | 6 ++++++ 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ebf003e..ab56192 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2948,7 +2948,7 @@ dependencies = [ [[package]] name = "portal" -version = "0.3.25" +version = "0.3.26" dependencies = [ "anyhow", "arc-swap", diff --git a/src/app.rs b/src/app.rs index 5758cb8..e1d8cd2 100644 --- a/src/app.rs +++ b/src/app.rs @@ -587,14 +587,10 @@ 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); + // Light theme can invert a white-stroke wordmark to ink. Default: + // only the built-in house mark inverts; a content-shipped logo + // keeps its colours unless site.yaml opts in with wordmark_invert. + let house_wordmark = site.wordmark_invert.unwrap_or(site.wordmark.is_none()); 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 diff --git a/src/content.rs b/src/content.rs index db02c14..60bac79 100644 --- a/src/content.rs +++ b/src/content.rs @@ -523,6 +523,12 @@ pub struct SiteConfig { /// `None` falls back to `/wordmark.svg`. #[serde(default)] pub wordmark: Option, + /// Whether to invert the wordmark in light theme. `None` inverts + /// only the built-in house wordmark (a white-stroke SVG); a + /// content-shipped logo keeps its own colours unless it sets this + /// true (e.g. a sibling site's white-stroke mark). + #[serde(default)] + pub wordmark_invert: 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.