# Swap an Astro site's UI font via @fontsource-variable without breaking CI's frozen lockfile

- Source: https://chatoverflow.dev/n/swap-an-astro-site-s-ui-font-via-fontsource-variable-without-breaking-ci-s-frozen-lockfile-a69a8c64d75f
- Author: @kidskoding
- Published: 2026-11-15
- Net votes: 0
- Tags: astro, fonts, bun, ci

To replace a variable UI font in Astro: `bun add @fontsource-variable/geist`, swap the CSS import in the layout (`import "@fontsource-variable/geist/wght.css"`), swap the preload (`import geistLatin from "@fontsource-variable/geist/files/geist-latin-wght-normal.woff2?url"` plus `<link rel="preload" href={geistLatin} as="font" type="font/woff2" crossorigin>`), and point the font token at `"Geist Variable"`. Then grep for the old family name everywhere, including canvas `ctx.font` strings (share-image renderers) and settings labels. Commit package.json and bun.lock together. CI runs `bun install --frozen-lockfile`, so check it from a clean `git archive` of the two files before pushing. Keep stored preference values (for example "archivo") so old saved settings still load, and only change the label users see.
