Site design → Style: fonts, corners, text size, shadows, page width #17

Merged
reudy merged 1 commit from site-design-fonts-corners into main 2026-10-26 20:06:59 +01:00
Member

Adds a Style card to Site design for the look of the public site:

  • Fonts: separate choices for headings and body text, from 15 fonts (6 serif, 9 sans-serif). The fonts are bundled @fontsource-variable packages served by the site itself, so they don't contact Google (GDPR). A browser downloads only the fonts a page uses.
  • Corners: Sharp, Soft or Round. Cards, panels and inputs scale their radius. Buttons, chips and icon buttons use rounded-button, which is a pill when Round and square when Sharp.
  • Text size: Small, Normal or Large. This sets the root font size, so spacing scales along with the text.
  • Shadows: None, Soft or Strong.
  • Page width: Narrow, Normal or Wide. This sets how wide content sections get on big screens.

The card has a live sample. The defaults reproduce the current look.

How it works

  • The choices are stored in a style global, the same as the header, footer and colors.
  • siteStyleVars() in $shared/theme turns the choices into --site-* variables in the <style> that is already rendered in <head>. This applies on the public site and in the admin /preview.
  • The @theme tokens in both app.css files scale with those variables: --radius-*, --shadow-*, --container-3xl/6xl/7xl and --font-*. Blocks keep their existing classes. The admin's own pages don't set the variables, so they look the same as before.
  • Arbitrary values were swapped for tokens, since they ignore the variables:
    • rounded-[2rem] → rounded-panel
    • Cards' rounded-[1.25rem] → rounded-card, and their arbitrary shadow → shadow-sm
    • The Hero's inline Playfair font was removed.
  • No schema change is needed. Backups already include every global.

Visible change: the Button block's buttons now follow the corner setting, like every other button on the site. With the default Round setting they become pills; before, they had DaisyUI's small radius.

Tested

  • svelte-check: admin has 0 errors; its warnings go from 15 to 16, and the new one follows the page's existing pattern. app-public has 0 errors and 3 warnings, the same as main.
  • On the test stack, I set Cormorant Garamond with Montserrat, Sharp, Large, Strong and Wide in the admin, saved, and checked the public site.
    • Headings, body text and the root size of 18px were correct.
    • Only those two fonts were downloaded.
    • At phone width, scrollWidth was 412 for both the public page and Site design.
  • After resetting to the defaults, the site showed Playfair, DM Sans and 16px again.
  • Not tried on a real phone. Stripe's card field and booking emails keep their own fonts.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Hy2vMnHJYP7QGsiH21zHxW

Adds a **Style** card to Site design for the look of the public site: - **Fonts:** separate choices for headings and body text, from 15 fonts (6 serif, 9 sans-serif). The fonts are bundled `@fontsource-variable` packages served by the site itself, so they don't contact Google (GDPR). A browser downloads only the fonts a page uses. - **Corners:** Sharp, Soft or Round. Cards, panels and inputs scale their radius. Buttons, chips and icon buttons use `rounded-button`, which is a pill when Round and square when Sharp. - **Text size:** Small, Normal or Large. This sets the root font size, so spacing scales along with the text. - **Shadows:** None, Soft or Strong. - **Page width:** Narrow, Normal or Wide. This sets how wide content sections get on big screens. The card has a live sample. The defaults reproduce the current look. ## How it works - The choices are stored in a `style` global, the same as the header, footer and colors. - `siteStyleVars()` in `$shared/theme` turns the choices into `--site-*` variables in the `<style>` that is already rendered in `<head>`. This applies on the public site and in the admin `/preview`. - The `@theme` tokens in both `app.css` files scale with those variables: `--radius-*`, `--shadow-*`, `--container-3xl/6xl/7xl` and `--font-*`. Blocks keep their existing classes. The admin's own pages don't set the variables, so they look the same as before. - Arbitrary values were swapped for tokens, since they ignore the variables: - `rounded-[2rem]` → `rounded-panel` - Cards' `rounded-[1.25rem]` → `rounded-card`, and their arbitrary shadow → `shadow-sm` - The Hero's inline Playfair font was removed. - No schema change is needed. Backups already include every global. **Visible change:** the Button block's buttons now follow the corner setting, like every other button on the site. With the default Round setting they become pills; before, they had DaisyUI's small radius. ## Tested - svelte-check: admin has 0 errors; its warnings go from 15 to 16, and the new one follows the page's existing pattern. app-public has 0 errors and 3 warnings, the same as main. - On the test stack, I set Cormorant Garamond with Montserrat, Sharp, Large, Strong and Wide in the admin, saved, and checked the public site. - Headings, body text and the root size of 18px were correct. - Only those two fonts were downloaded. - At phone width, `scrollWidth` was 412 for both the public page and Site design. - After resetting to the defaults, the site showed Playfair, DM Sans and 16px again. - Not tried on a real phone. Stripe's card field and booking emails keep their own fonts. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01Hy2vMnHJYP7QGsiH21zHxW
agent added 1 commit 2026-10-26 20:00:52 +01:00
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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hy2vMnHJYP7QGsiH21zHxW
reudy merged commit f1ef0162d7 into main 2026-10-26 20:06:59 +01:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: reudy-net/domaino#17
No description provided.