From 107647f7a5117ab5363faf0dd822cf7a66d024ce Mon Sep 17 00:00:00 2001 From: Sluijsens Date: Sun, 15 Nov 2026 17:15:04 +0100 Subject: [PATCH] Local only: Cormorant Garamond and Mulish instead of Marcellus and Jost Not pushed: Bryan compares it with the current test version first. Co-Authored-By: Claude Sonnet 5.5 --- docs/assets-and-licenses.md | 7 +++++- web/package.json | 2 ++ web/pnpm-lock.yaml | 16 +++++++++++++ web/src/components/FaqList/FaqList.tsx | 1 + .../components/NavigationBar/MobileNav.tsx | 1 + .../NavigationBar/MobileNavGroup.tsx | 2 ++ .../components/PackageBlock/PackageBlock.tsx | 2 ++ .../ProcessTimeline/ProcessTimeline.tsx | 1 + web/src/components/home/Pricing/PriceCard.tsx | 2 ++ .../components/home/Pricing/PriceTopBar.tsx | 1 + .../home/Testimonials/TestimonialCarousel.tsx | 1 + .../home/Testimonials/TestimonialSlide.tsx | 1 + web/src/fonts.css | 23 +++++++++++++++++++ web/src/routes/__root.tsx | 12 ++++++---- web/src/theme.ts | 19 +++++++++++---- 15 files changed, 81 insertions(+), 10 deletions(-) create mode 100644 web/src/fonts.css diff --git a/docs/assets-and-licenses.md b/docs/assets-and-licenses.md index 1ade220..f97a148 100644 --- a/docs/assets-and-licenses.md +++ b/docs/assets-and-licenses.md @@ -78,7 +78,12 @@ Conclusion for Bryan to confirm: the twigs are images from the theme and fall un ## Fonts -Marcellus (headings) and Jost (text) via the npm packages `@fontsource/marcellus` and `@fontsource/jost`, both under the SIL Open Font License 1.1, served from the site itself (no Google Fonts request). +Cormorant Garamond (headings, weights 500 and 600) and Mulish (text, nav and buttons, weights 300, 400 and 500), the main fonts of the live site, self-hosted through the npm packages `@fontsource/cormorant-garamond` and `@fontsource/mulish` (version 5.3.0). Both fonts are Google Fonts under the SIL Open Font License 1.1 (free for commercial use and for self-hosting; the licence text ships in the packages), so there is no theme licence involved. Only the latin subset and the weights in use are loaded (about 100 KB of WOFF2 in total), with no request to Google. The previous fonts, Marcellus and Jost, were replaced. + +- Layout shift: `src/fonts.css` defines two fallback faces ("Cormorant Garamond Fallback" on Georgia, "Mulish Fallback" on Arial) with `size-adjust`, `ascent-override` and `descent-override` computed from the font files, so the text barely moves when the web fonts arrive (measured layout shift of the pages: 0.001 to 0.016 on desktop and phone, as before). +- Size: Cormorant Garamond has a smaller x-height than Marcellus (0.386 against 0.50), so every use of the heading font carries `font-size-adjust: 0.43` (about 12% larger letters; browsers that do not know the property show the font at its natural size). Prices use lining numerals (`font-variant-numeric: lining-nums`), because the default figures of Cormorant Garamond are old-style. Headings use weight 500 instead of 400 (Cormorant is thin at 400). +- No font preload is used (the images are the largest content of the first screen); the fallback metrics keep the first paint stable. +- The CSP is unchanged (`font-src 'self'`). ## When you add an image diff --git a/web/package.json b/web/package.json index 77c700c..47b02d7 100644 --- a/web/package.json +++ b/web/package.json @@ -54,8 +54,10 @@ "dependencies": { "@chakra-ui/react": "^3.37.0", "@emotion/react": "^11.14.0", + "@fontsource/cormorant-garamond": "^5.3.0", "@fontsource/jost": "^5.3.0", "@fontsource/marcellus": "^5.3.0", + "@fontsource/mulish": "^5.3.0", "@friendlycaptcha/sdk": "^1.1.3", "@sentry/react": "^11.8.0", "@tanstack/react-router": "1.170.46", diff --git a/web/pnpm-lock.yaml b/web/pnpm-lock.yaml index 4f04632..aeed4d1 100644 --- a/web/pnpm-lock.yaml +++ b/web/pnpm-lock.yaml @@ -178,12 +178,18 @@ importers: '@emotion/react': specifier: ^11.14.0 version: 11.14.0(@types/react@19.3.0)(react@19.3.0)(supports-color@5.5.0) + '@fontsource/cormorant-garamond': + specifier: ^5.3.0 + version: 5.3.0 '@fontsource/jost': specifier: ^5.3.0 version: 5.3.0 '@fontsource/marcellus': specifier: ^5.3.0 version: 5.3.0 + '@fontsource/mulish': + specifier: ^5.3.0 + version: 5.3.0 '@friendlycaptcha/sdk': specifier: ^1.1.3 version: 1.1.3 @@ -740,12 +746,18 @@ packages: '@floating-ui/utils@0.2.12': resolution: {integrity: sha512-HpCo8tmWzLVad5s2d19EhAz5zqrrQ6s69qd6moPMQvkOuSwDT1YgRfWSVuc4ennqrgv3OHppiOGMQ7oC13yIww==} + '@fontsource/cormorant-garamond@5.3.0': + resolution: {integrity: sha512-weuGsCirGVWBWqpt6YUp0yLThTe4G8YO45noq8wxeJCRvEpq5lFrxNMFSTxcyOyV5k5otzJ8guDzYegdYlcLMQ==} + '@fontsource/jost@5.3.0': resolution: {integrity: sha512-lORv5y49hSoLVxjGb0qNuBzXvnaNYI3B94200uGPGJFei8fao6d6LLz2ziWbOZubGfZnibzuT6GVNX8fBw8WQQ==} '@fontsource/marcellus@5.3.0': resolution: {integrity: sha512-cMnanjpiPIC7Rq4GXIA/Zal5WLSoDV5Mc681tMkWsWfKHXnRnLGlhuGeBnLF6HrqtFkiSdiuy4NCSPfOrz266w==} + '@fontsource/mulish@5.3.0': + resolution: {integrity: sha512-Fru/fmJwg4ZlKUU4jELz6/guZhba6Lz1vraAROqooYnUbtj1iMi7BXFkQU7AkB6QP5swpvwRnO5chUp6mNh5mA==} + '@formatjs/ecma402-abstract@2.3.6': resolution: {integrity: sha512-HJnTFeRM2kVFVr5gr5kH1XP6K0JcJtE7Lzvtr3FS/so5f1kpsqqqxy5JF+FRaO6H2qmcMfAUIox7AJteieRtVw==} @@ -4706,10 +4718,14 @@ snapshots: '@floating-ui/utils@0.2.12': {} + '@fontsource/cormorant-garamond@5.3.0': {} + '@fontsource/jost@5.3.0': {} '@fontsource/marcellus@5.3.0': {} + '@fontsource/mulish@5.3.0': {} + '@formatjs/ecma402-abstract@2.3.6': dependencies: '@formatjs/fast-memoize': 2.2.7 diff --git a/web/src/components/FaqList/FaqList.tsx b/web/src/components/FaqList/FaqList.tsx index 128705b..3856cb2 100644 --- a/web/src/components/FaqList/FaqList.tsx +++ b/web/src/components/FaqList/FaqList.tsx @@ -60,6 +60,7 @@ export default function FaqList({ minH="2.75rem" py={5} fontFamily="heading" + fontSizeAdjust="0.43" fontSize="1.25rem" color="ink" cursor="pointer" diff --git a/web/src/components/NavigationBar/MobileNav.tsx b/web/src/components/NavigationBar/MobileNav.tsx index 80bc65b..af7c674 100644 --- a/web/src/components/NavigationBar/MobileNav.tsx +++ b/web/src/components/NavigationBar/MobileNav.tsx @@ -105,6 +105,7 @@ export default function MobileNav({ } display="block" fontFamily="heading" + fontSizeAdjust="0.43" fontSize="1.9rem" color="ink" _currentPage={{ color: 'accent' }} diff --git a/web/src/components/NavigationBar/MobileNavGroup.tsx b/web/src/components/NavigationBar/MobileNavGroup.tsx index 5b5a98b..c5427d9 100644 --- a/web/src/components/NavigationBar/MobileNavGroup.tsx +++ b/web/src/components/NavigationBar/MobileNavGroup.tsx @@ -38,6 +38,7 @@ export default function MobileNavGroup({ onClick={() => dispatch({ type: 'linkChosen' })} display="block" fontFamily="heading" + fontSizeAdjust="0.43" fontSize="1.9rem" color={isSectionCurrent(item, pathname) ? 'accent' : 'ink'} _currentPage={{ color: 'accent' }} @@ -97,6 +98,7 @@ export default function MobileNavGroup({ alignItems="center" minH="44px" fontFamily="heading" + fontSizeAdjust="0.43" fontSize="1.4rem" color="ink" // accent.deep: 1.4rem is not large text diff --git a/web/src/components/PackageBlock/PackageBlock.tsx b/web/src/components/PackageBlock/PackageBlock.tsx index 6ea5d7c..3b96e82 100644 --- a/web/src/components/PackageBlock/PackageBlock.tsx +++ b/web/src/components/PackageBlock/PackageBlock.tsx @@ -51,6 +51,8 @@ export default function PackageBlock({