We do not support code customizations. This article is a basic reference for advanced users familiar with HTML and CSS. Always test code changes on a duplicate, unpublished theme copy. If you need help from a developer, we recommend reaching out to a verified Fluorescent partner.
With Custom CSS, it's possible to add custom fonts with a few edits to your theme code. Custom fonts are uploaded to Shopify Files and then applied manually to different text elements in the Code editor. (Custom fonts will not appear as an option in the Theme Editor's font selector.)
Before deciding to use a custom font, we highly recommend considering one of the hundreds of fonts in Shopify's Font Picker as your first choice, since they are fully supported by all our themes.
Upload fonts to Shopify Files
All font files should be in WOFF and WOFF2 formats. While TTF and OTF can be used, they are not web-supported fonts and may cause issues. You can convert font formats with free tools like CloudConvert.
Using custom fonts may contribute to longer load-times. See our article about balancing features and customizations with your online store speed.
STEPS
In your Shopify Admin:
Go to Content > Files and click Upload files to add your WOFF and WOFF2 files.
Keep this window open for the next step.
Add fonts with Custom CSS in theme editor
After uploading your font files, you can import them in your Theme settings using the Custom CSS field.
STEPS
In your Shopify Admin:
Click Duplicate on your current theme.
Click Customize on the duplicated, unpublished theme version.
--font-heading applies to the store name, headings, and subheadings for pages and sections.
--font-body applies to lines of text and product listings.
For each font you want to change, replace unset with the custom font name and delete the comment tags (/* and / on either side) . Example:
:root {--font-family-heading:Custom Font Name;---font-weight-heading:unset;--font-style-heading:unset;}
(Optional.) If your font has multiple weights or styles, replace unset with the values for those properties. Example:
:root {--font-family-heading:Custom Font Name;--font-weight-heading:400;--font-style-heading:italic;}
Click Save.
Click Preview Store to test and troubleshoot your code before publishing the theme.
Apply fonts to specific elements
Applying fonts to specific elements requires knowing how to use your browser's Inspector tool ↗ and familiarity with CSS selectors ↗.
If that sounds like you, you can find and copy the CSS selector with the Inspector tool, then edit and use the following example below:
CSS-selector-name {font-family:"Custom Font Name"!important;}
Adding fonts with custom.css file
While we recommend using the available Custom CSS settings in the theme editor, you can use Eclipse’s custom.css file to organize your custom code in a single place.
Enable useCustomCSS
To import the custom.css file, you need to enable useCustomCSS in the theme-globals.liquid file.
STEPS
Open the theme-globals.liquid file in the Snippets folder.
Find the useCustomCSS variable and set it to true.
{% assign useCustomCSS =false%}
Open the custom.css file in the Assets folder.
Add your custom code to import font files and apply them to your theme text.