fix(pastel-dream): load bundled fonts via @font-face + preset typography

Bundled fonts are inert (host does not consume LoadedPlugin.BundledFonts),
so Fraunces and Quicksand were rendering system-font fallbacks. Declare
@font-face against the served /templates/pastel-dream/fonts/*.woff2 paths
and set typography.fontHeading=Fraunces / fontBody=Quicksand 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 19:58:37 +08:00
parent 8adbe8c64c
commit 7e6bd7d81d
2 changed files with 33 additions and 1 deletions

View File

@ -127,7 +127,19 @@ css:
--pd-mono-fallback: "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace;
--pd-radius: 1.5rem;
}
/* --- Bundled display faces ---------------------------------------------- */
/* The host does not yet emit @font-face for bundled_fonts
* (LoadedPlugin.BundledFonts is unconsumed), so the theme declares them
* itself against the served asset paths (/templates/pastel-dream/fonts/...).
* Presets set typography.fontHeading/fontBody to template:pastel-dream:<Family>
* so --font-heading (Fraunces display + accents) and --font-body (Quicksand)
* resolve to the bundled families instead of falling through to system fonts. */
@font-face { font-family: 'Fraunces'; src: url('/templates/pastel-dream/fonts/fraunces-latin-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url('/templates/pastel-dream/fonts/fraunces-latin-600.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Quicksand'; src: url('/templates/pastel-dream/fonts/quicksand-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Quicksand'; src: url('/templates/pastel-dream/fonts/quicksand-700.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
/* --- Watercolor wash background ----------------------------------------- */
/* The signature "morning haze": soft radial pastel washes tinted from the
* active palette, drifting slowly. Reads as watercolor on cream in light mode

View File

@ -5,6 +5,10 @@
"description": "Blush rose on warm cream with a mint accent. The default patisserie counter at opening.",
"theme": {
"mode": "both",
"typography": {
"fontHeading": "template:pastel-dream:Fraunces",
"fontBody": "template:pastel-dream:Quicksand"
},
"lightColors": {
"background": "30 44% 97%",
"foreground": "335 25% 22%",
@ -55,6 +59,10 @@
"description": "Raspberry on ivory with a plum accent. Jam pots and fruit tarts.",
"theme": {
"mode": "both",
"typography": {
"fontHeading": "template:pastel-dream:Fraunces",
"fontBody": "template:pastel-dream:Quicksand"
},
"lightColors": {
"background": "350 40% 97%",
"foreground": "345 30% 20%",
@ -105,6 +113,10 @@
"description": "Soft sage on oat cream with an apricot accent. Green tea cakes and mochi.",
"theme": {
"mode": "both",
"typography": {
"fontHeading": "template:pastel-dream:Fraunces",
"fontBody": "template:pastel-dream:Quicksand"
},
"lightColors": {
"background": "44 36% 96%",
"foreground": "150 22% 18%",
@ -155,6 +167,10 @@
"description": "Lilac on cream with a warm honey accent. Lavender shortbread and glaze.",
"theme": {
"mode": "both",
"typography": {
"fontHeading": "template:pastel-dream:Fraunces",
"fontBody": "template:pastel-dream:Quicksand"
},
"lightColors": {
"background": "40 40% 97%",
"foreground": "270 24% 22%",
@ -205,6 +221,10 @@
"description": "Warm peach on blossom cream with a rose accent. Stone-fruit galettes in spring.",
"theme": {
"mode": "both",
"typography": {
"fontHeading": "template:pastel-dream:Fraunces",
"fontBody": "template:pastel-dream:Quicksand"
},
"lightColors": {
"background": "26 50% 97%",
"foreground": "15 30% 22%",