From 91f67058992ae8e767bb48a11143744a307be9e1 Mon Sep 17 00:00:00 2001 From: agent Date: Mon, 26 Oct 2026 19:00:37 +0000 Subject: [PATCH] =?UTF-8?q?Site=20design=20=E2=86=92=20Style:=20fonts,=20c?= =?UTF-8?q?orners,=20text=20size,=20shadows,=20page=20width?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A new Style card in Site design (a `style` global) chooses the heading and body fonts from 15 bundled ones, corners (sharp/soft/round), text size, shadow strength and page width, with a live sample. The choices become --site-* CSS variables that the @theme radius, shadow, container and font tokens scale, so blocks keep using rounded-xl, shadow-sm, max-w-6xl and follow the setting. Buttons and chips use rounded-button; the defaults are the site's current look. Fonts are @fontsource-variable packages (replacing the static DM Sans and Playfair ones): still served by the site, and a browser downloads only the fonts a page uses. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Hy2vMnHJYP7QGsiH21zHxW --- AGENTS.md | 6 +- README.md | 2 +- app-admin/package-lock.json | 159 +++++++++++++++++- app-admin/package.json | 17 +- app-admin/src/app.css | 31 +++- app-admin/src/lib/fonts.ts | 19 +++ app-admin/src/routes/+layout.server.ts | 9 +- app-admin/src/routes/+layout.svelte | 9 +- app-admin/src/routes/globals/+page.server.ts | 11 +- app-admin/src/routes/globals/+page.svelte | 58 ++++++- app-admin/src/routes/preview/+page.svelte | 4 +- app-public/package-lock.json | 159 +++++++++++++++++- app-public/package.json | 17 +- app-public/src/app.css | 31 +++- app-public/src/lib/components/Header.svelte | 10 +- app-public/src/lib/fonts.ts | 19 +++ app-public/src/routes/+layout.server.ts | 9 +- app-public/src/routes/+layout.svelte | 13 +- .../src/routes/checkout/return/+page.svelte | 10 +- packages/shared/src/blocks/ButtonBlock.svelte | 2 +- packages/shared/src/blocks/CardsBlock.svelte | 2 +- .../shared/src/blocks/CheckoutBlock.svelte | 16 +- packages/shared/src/blocks/HeroBlock.svelte | 4 +- .../shared/src/blocks/ImageTextBlock.svelte | 2 +- packages/shared/src/blocks/ShopBlock.svelte | 26 +-- .../src/blocks/TestimonialsBlock.svelte | 4 +- .../src/blocks/UpcomingCalendarBlock.svelte | 4 +- packages/shared/src/theme.ts | 65 ++++++- packages/shared/src/types.ts | 20 +++ 29 files changed, 628 insertions(+), 110 deletions(-) create mode 100644 app-admin/src/lib/fonts.ts create mode 100644 app-public/src/lib/fonts.ts diff --git a/AGENTS.md b/AGENTS.md index 6bab9db..c5b8cf0 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -34,7 +34,7 @@ app-admin/ # SvelteKit admin app (serves admin.) │ │ ├── orders/ # Order list + booking-email status/resend │ │ ├── customers/ # Customer personal data (GDPR): search, export, correct, erase, retention settings │ │ ├── emails/ # Block-based booking email editor (live preview, test send) -│ │ ├── globals/ # Header/footer/colors editor (menu label: Site design) +│ │ ├── globals/ # Header/footer/colors/style editor (menu label: Site design) │ │ ├── backup/ # Export/import UI (calls api/export, api/import) │ │ ├── preview/ # Draft preview via sessionStorage (same-origin) │ │ └── api/ # upload, export, import, slots (Shop block times in /preview) endpoints @@ -141,7 +141,9 @@ To add an email block type: add to `EmailBlockType` in `packages/shared/src/type - **Shop / payments**: all basket, slot-hold, Stripe and order logic lives in the PocketBase hooks (JSVM: synchronous, each handler `require()`s the lib; see the header comment). The public app must stay unprivileged — no superuser login, no Stripe secret key; its routes only proxy to `/api/shop/*` and manage the `basket_id` cookie (`app-public/src/lib/server/shop.ts`). Booking emails are rendered and sent by the public app from data the webhook hook returns (`OrderEmailData`, `sendOrderEmailsFromData`); keep `orderEmailData()` in the hook and `loadOrderEmailData()` in `packages/shared/src/server/email` returning the same shape. Local testing uses `stripe-mock` (`STRIPE_API_BASE`, local compose only). ### Styling -- **Public site**: Custom theme via `@theme` in `app.css` — colors: `warm`, `charcoal`, `sage`, `sage-dark`, `terracotta`. Fonts: `DM Sans` (body), `Playfair Display` (headings). +- **Public site**: Custom theme via `@theme` in `app.css` — colors: `warm`, `charcoal`, `sage`, `sage-dark`, `terracotta`. Fonts: `font-sans` (body), `font-serif` (headings), chosen in Site design → Style (default DM Sans / Playfair Display). + - **Site design → Style** (`style` global: fonts, corners, text size, shadows, page width) becomes `--site-*` variables (`siteStyleVars` in `$shared/theme`) that the `@theme` tokens in both `app.css` files scale. So in public-site markup use the tokens — `rounded-xl`/`rounded-2xl`/`rounded-card`/`rounded-panel`, `shadow-sm`…`shadow-xl`, `max-w-3xl`/`6xl`/`7xl` — never `rounded-[2rem]` or an arbitrary `shadow-[…]`, which ignore the settings. Buttons, chips and icon buttons are `rounded-button` (a pill when Round, square when Sharp); only dots, avatars and badges stay `rounded-full`. + - Fonts are bundled `@fontsource-variable/*` packages, imported in each app's `src/lib/fonts.ts` and listed in `SITE_FONTS`; a new one goes in all three places. - **Admin area**: DaisyUI **5** (no `form-control` / `label-text` / `*-bordered` — those are v4). Colours come from Site design via `$shared/theme`, rendered as a `