Theme font guide
Custom font not showing on your Shopify store? Here’s why
What you’ll need
Your font files (TTF, OTF, WOFF or WOFF2, one file per weight and style, with a license that allows web use)
Somewhere to upload the converted files
How to get this: Somewhere to upload the converted files
In your Shopify admin: Content › Files › Upload files.
The theme editor (to add a Custom Liquid block; no code editing)
How to get this: The theme editor
- Online Store › Themes › Edit theme (on a copy of your theme if you want to test first).
- Add section or Add block › Custom Liquid, paste the code, then Save.
A duplicate of your theme to test on (optional, recommended, to preview the new font before customers see it)
How to get this: A duplicate of your theme to test on
- Online Store › Themes › … on your theme › Duplicate.
- Make the change on the copy, preview it, and publish only when it works.
Check these in order
- File name: when a file with the same name already exists, Shopify adds a unique ID to the new file’s name. Compare the name in Content › Files with the name inside file_url in your code, and delete the old copy before uploading again.
- The file loads: in the browser’s developer tools, Network tab, filter by Font and reload. A 404 means the name is wrong; nothing at all means no rule on the page uses the font.
- Variables: Dawn uses --font-heading-family and --font-body-family; Horizon uses --font-heading--family and --font-body--family. Setting the wrong theme’s variable does nothing.
- Weight: if your file is declared as font-weight 400 but the theme draws headings at 700, the browser fakes a bold or uses another file. Add the bold file, or set the weight to match.
- Section order: the Custom Liquid section must be on every page. The Header area is shared by all templates; a section added only to the home page applies only there.
- Cache: the editor preview updates at once; the live store can take a minute. Reload with Shift held down.
- Format: format() must match the file type: woff2 for .woff2, woff for .woff, truetype for .ttf and opentype for .otf.
Fonts from another domain
Files uploaded to Content › Files are served from your store’s own domain and Shopify’s CDN with the CORS header browsers require for fonts. A font hosted on another site without that header is blocked by the browser, even though the URL opens fine in a new tab.
Text flashes in another font first
That’s font-display: swap, which shows text in the fallback font until yours loads, so nothing is invisible on a slow connection. WOFF2 files load fastest; keeping to the two or three weights you actually use helps more than anything else.
Related tools and guides
- How to add a custom font to Shopify
Custom Font Installer