From fed5f5082382e4849a794fb2f136a0f71dc77062 Mon Sep 17 00:00:00 2001 From: Alex Dunmow Date: Mon, 6 Jul 2026 21:02:16 +0800 Subject: [PATCH] feat(coffee): bundled-font @font-face + preset typography (fonts workaround) Bundle Fraunces/Work Sans/Caveat via @font-face against served /templates/coffee/fonts/*.woff2 (host never emits @font-face for bundled_fonts). Set typography.fontHeading=Fraunces / fontBody=Work Sans in all 5 presets so --font-heading/--font-body resolve to the bundled families. gotham@1.2.0 precedent. Co-Authored-By: Claude Fable 5 --- manifest.yaml | 16 +++++++++++++++- presets.json | 20 ++++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/manifest.yaml b/manifest.yaml index 72344ae..26cc6c1 100644 --- a/manifest.yaml +++ b/manifest.yaml @@ -114,7 +114,21 @@ css: * the BlockNinja font variables (--font-heading, --font-body, --font-mono) with * the fallback stacks below — never hardcoded, so the admin font picker works. */ - + + /* Bundled faces. The host does not yet emit @font-face for bundled_fonts + * (LoadedPlugin.BundledFonts is unconsumed — cms WO-BUNDLED-FONTS-DEAD-CODE), + * so the theme declares its own faces against the served artifact paths + * (/templates/coffee/fonts/...). Families/weights mirror fonts.json exactly. + * Presets set typography.fontHeading/body to template:coffee: so + * --font-heading/--font-body resolve to Fraunces/Work Sans; Caveat backs the + * hand-accent fallback stack. */ + @font-face { font-family: 'Fraunces'; src: url('/templates/coffee/fonts/fraunces-latin-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; } + @font-face { font-family: 'Fraunces'; src: url('/templates/coffee/fonts/fraunces-latin-600.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; } + @font-face { font-family: 'Work Sans'; src: url('/templates/coffee/fonts/worksans-latin-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; } + @font-face { font-family: 'Work Sans'; src: url('/templates/coffee/fonts/worksans-latin-600.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; } + @font-face { font-family: 'Caveat'; src: url('/templates/coffee/fonts/caveat-latin-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; } + @font-face { font-family: 'Caveat'; src: url('/templates/coffee/fonts/caveat-latin-700.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; } + :root { --coffee-heading-fallback: "Fraunces", "Playfair Display", Georgia, "Times New Roman", serif; --coffee-body-fallback: "Work Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; diff --git a/presets.json b/presets.json index 57c2aa1..0f863e3 100644 --- a/presets.json +++ b/presets.json @@ -5,6 +5,10 @@ "description": "Cream paper and espresso ink with a terracotta accent. Daylight cafe.", "theme": { "mode": "both", + "typography": { + "fontHeading": "template:coffee:Fraunces", + "fontBody": "template:coffee:Work Sans" + }, "lightColors": { "background": "36 30% 96%", "foreground": "25 35% 18%", @@ -55,6 +59,10 @@ "description": "Espresso-deep base with a copper accent. Evening roastery.", "theme": { "mode": "both", + "typography": { + "fontHeading": "template:coffee:Fraunces", + "fontBody": "template:coffee:Work Sans" + }, "lightColors": { "background": "36 30% 96%", "foreground": "25 35% 18%", @@ -105,6 +113,10 @@ "description": "Warmer ivory paper with a deeper terracotta accent. Bakery counter.", "theme": { "mode": "both", + "typography": { + "fontHeading": "template:coffee:Fraunces", + "fontBody": "template:coffee:Work Sans" + }, "lightColors": { "background": "32 35% 92%", "foreground": "22 40% 16%", @@ -155,6 +167,10 @@ "description": "Slate-black menu board with chalk-white lettering and a chalk-cream accent.", "theme": { "mode": "both", + "typography": { + "fontHeading": "template:coffee:Fraunces", + "fontBody": "template:coffee:Work Sans" + }, "lightColors": { "background": "40 20% 94%", "foreground": "200 12% 16%", @@ -205,6 +221,10 @@ "description": "Soft sage green and oat cream for tea rooms and matcha bars.", "theme": { "mode": "both", + "typography": { + "fontHeading": "template:coffee:Fraunces", + "fontBody": "template:coffee:Work Sans" + }, "lightColors": { "background": "44 32% 94%", "foreground": "120 15% 18%",