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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y42TyF8Zu7NGRR2893vNcZ
This commit is contained in:
co-authored by
Claude Fable 5
parent
b08e1af139
commit
99b29bb09f
Generated
+1
-1
@@ -2948,7 +2948,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "portal"
|
name = "portal"
|
||||||
version = "0.3.25"
|
version = "0.3.26"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"arc-swap",
|
"arc-swap",
|
||||||
|
|||||||
+4
-8
@@ -587,14 +587,10 @@ fn Hero(title: String, description: String, landing: bool, site: SiteConfig, cur
|
|||||||
None
|
None
|
||||||
};
|
};
|
||||||
let has_module = module.is_some();
|
let has_module = module.is_some();
|
||||||
// Light theme inverts white-stroke wordmarks to ink. The house
|
// Light theme can invert a white-stroke wordmark to ink. Default:
|
||||||
// mark and the sibling-site marks are all white-stroke SVGs; a
|
// only the built-in house mark inverts; a content-shipped logo
|
||||||
// raster logo is a client brand and keeps its colors.
|
// keeps its colours unless site.yaml opts in with wordmark_invert.
|
||||||
let house_wordmark = site
|
let house_wordmark = site.wordmark_invert.unwrap_or(site.wordmark.is_none());
|
||||||
.wordmark
|
|
||||||
.as_deref()
|
|
||||||
.map(|w| w.ends_with(".svg"))
|
|
||||||
.unwrap_or(true);
|
|
||||||
let wordmark = site.wordmark.clone().unwrap_or_else(|| "/wordmark.svg".to_string());
|
let wordmark = site.wordmark.clone().unwrap_or_else(|| "/wordmark.svg".to_string());
|
||||||
// Clamped server-side too, but belt and braces for the inline style.
|
// Clamped server-side too, but belt and braces for the inline style.
|
||||||
let wordmark_style = site
|
let wordmark_style = site
|
||||||
|
|||||||
@@ -523,6 +523,12 @@ pub struct SiteConfig {
|
|||||||
/// `None` falls back to `/wordmark.svg`.
|
/// `None` falls back to `/wordmark.svg`.
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub wordmark: Option<String>,
|
pub wordmark: Option<String>,
|
||||||
|
/// 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<bool>,
|
||||||
/// Wordmark display height in rem (0.5–6.0). `None` keeps the
|
/// Wordmark display height in rem (0.5–6.0). `None` keeps the
|
||||||
/// stylesheet's default. Raster logos look best at or below their
|
/// stylesheet's default. Raster logos look best at or below their
|
||||||
/// intrinsic pixel height.
|
/// intrinsic pixel height.
|
||||||
|
|||||||
Reference in New Issue
Block a user