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 <noreply@anthropic.com>
This commit is contained in:
Alex Dunmow 2026-07-06 21:02:16 +08:00
parent 0212c79ea5
commit fed5f50823
2 changed files with 35 additions and 1 deletions

View File

@ -115,6 +115,20 @@ css:
* 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:<Family> 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;

View File

@ -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%",