Skip to main content

How to Change the Font in Your Weaverse Theme

Weaverse themes use modern font loading techniques for performance and flexibility. The default Pilot theme uses Fontsource for Google Fonts, but you can use any web font provider or upload custom fonts. This guide covers all approaches with practical examples.
Pilot uses Tailwind CSS v4, which is configured CSS-first through the @theme directive. There is no tailwind.config.js file — the Tailwind plugin is registered in vite.config.ts and all design tokens live in app/styles/theme.css.
Fontsource provides npm packages for hundreds of Google Fonts and more, including support for variable fonts.

a. Install the Fontsource Package

Pilot ships with two variable fonts:
To use a different font (for example the variable font Nunito Sans):
Find the package for your font at fontsource.org.

b. Import Font Files in root.tsx

Pilot imports its fonts at the very top of app/root.tsx:
Replace those imports with your own:
For static-weight packages, import only the weights you actually use:

c. Update the @theme Font Variables

Tailwind v4 derives font-sans, font-serif, and font-mono utilities from CSS variables. Pilot declares them at the top of app/styles/theme.css:
Point them at your new font:
Tip: The first value must match the font-family name published by the font provider (Fontsource variable packages append Variable to the family name) or the name in your own @font-face declaration. app/styles/theme.css is pulled in by app/styles/app.css, which is where Tailwind itself is imported:

d. Set a Base Font in Global CSS (if needed)

Utilities such as font-sans already resolve to your @theme value, so this is only needed if you want a default outside of Tailwind utilities:
For variable fonts you can also pin a default weight axis:

2. Using Google Fonts CDN

For a quick setup, add a <link> to the document head in app/root.tsx (or through the links export):
Then point the theme variable at it in app/styles/theme.css:
CSP Reminder: If you load fonts from an external CDN (such as Google Fonts), make sure to update your Content Security Policy (CSP) to allow the font and stylesheet sources. See the CSP guide for details and examples.

3. Uploading a Custom Font

a. Add Font Files to the Public Folder

Place .woff2, .woff, or .ttf files in public/fonts/.

b. Declare @font-face in CSS

c. Register It in @theme

4. Switching Fonts Dynamically (Optional)

To let merchants select fonts in Weaverse Studio:
  • Add a font selector input in your theme schema (see app/weaverse/schema.server.ts).
  • Use the selected value to set the font-family dynamically in your global style component, which writes CSS custom properties into the document.
See Styling & Theming for how Pilot injects theme settings as CSS variables.

5. Best Practices

  • Only load the weights/styles you use.
  • Use font-display: swap for performance.
  • Prefer .woff2 for custom fonts.
  • Test on all devices and browsers.
  • Respect font licensing for custom fonts.

6. Example: Changing to Inter Using Fontsource

7. Example: Using a Variable Font

8. Further Reading