Fluorescent
Cornerstone
Cornerstone
  • Cornerstone Help Center
    • Start using Cornerstone
      • Migrate your theme
      • Theme licenses
    • FAQs
    • Video tutorials
    • Changelog
  • General
    • Editing themes
      • Adding sections
      • Using templates
      • Accessibility
      • Customizing your site
      • H1 heading tags
      • SEO for Shopify themes
      • Online store speed
    • Image guide
      • Web ready photography
      • Image sizes
      • File formats
      • Theme image settings
    • Adapting theme content
      • Edit default theme content
      • Multiple languages
      • Dynamic content with metafields
      • Unique content for markets
    • Update your theme
  • Theme styles
    • Theme settings
    • Style presets
      • Demo layouts
    • Colors
    • Fonts
    • Animation
  • Pages
    • Templates
      • Home page
      • Blog page
      • Blog posts
      • Collections list page
      • Contact page
      • Customer accounts
      • Password page
      • Search page
      • 404 page
    • Sections
      • Section styles
      • Content blocks
      • Blog posts
      • Collapsible row list
      • Collection list
      • Collection list buttons
      • Contact form
      • Countdown banner
      • Countdown bar
      • Featured collection
      • Featured collection with media
      • Featured product
      • Grid
      • Icon with text columns
      • Image hero
      • Media with content split
      • Multi-column
      • Newsletter
      • Newsletter compact
      • Overlapping media with content
      • Promotion grid
      • Quick links
      • Rich text
      • Sales banner
      • Scrolling content
      • Slideshow
      • Tabbed collections
      • Testimonials
      • Video hero
    • Popups
      • Sign up popup
      • Age verification
      • Countdown signup popup
      • Promotional popup
  • Header
    • Announcement bar
      • Language selector
      • Country selector
      • Social media icons
      • Announcements
    • Header
      • Logo
      • Layout and style
      • Mega navigation
      • Transparent header
    • Mobile menu
    • Search bar
  • Footer
    • Footer
      • Contact and social block
      • Links block
      • Logo block
      • Newsletter and social block
      • Text and image block
      • Language and currency
      • Payment icons
      • Custom liquid
  • Products
    • Product listings
      • Layout and style
      • Product card details
    • Product badges
    • Quick shop
  • Product pages
    • Product template
    • Layout and style
      • Media gallery
      • Sticky product details
      • Recommended products sidebar
      • Breadcrumbs
      • Navigation buttons
      • Gift card recipient form
    • Overview blocks
      • Product header
      • Description
      • Variant selector
      • Buy buttons
      • Share icons
      • Collapsible rows block
      • Complementary products
      • Custom option
      • Customer support block
      • Image block
      • Image with text block
      • Information popup
      • Product labels
      • Payments and trust
      • Stock level indicator
      • Text block
      • Text columns with icons
      • Text list with icons
      • App blocks
    • Variant options
      • Chips
      • Swatches
        • Enable swatches
        • Use default colors
        • Use custom colors
        • Use custom images
        • Change swatch styles
        • Show on product cards
        • Dynamic option availability
      • Sibling product swatches
      • Media grouping
    • Product recommendations
  • Collection pages
    • Collection template
    • Banner
    • Product grid
    • Filters and sorting
  • Cart
    • Cart page
    • Quick cart
      • Added to cart popup
    • Free shipping bar
    • Low inventory warning
    • Cross sells
  • Support
    • Support policy
    • Shopify vs Theme issues
    • Store access requests
  • For developers
    • Custom CSS
    • Custom fonts
    • Custom Liquid
    • Custom JavaScript events
    • Edit Theme JavaScript
Powered by GitBook
On this page
  • Watch video tutorial
  • Upload fonts to Shopify Files
  • Add fonts with Custom CSS in theme editor
  • Apply fonts to theme text
  • Logo, Headings, and Body text
  • Navigation menus and Buttons
  • Apply fonts to specific elements
  • Add fonts with custom.css file
  • Enable useCustomCSS

Was this helpful?

  1. For developers

Custom fonts

Advanced

Last updated 3 months ago

Was this helpful?

We do not support code customizations. This guide offers a basic reference for advanced users familiar with HTML and CSS. Always test code changes on unpublished theme copies. For assistance, we recommend reaching out to a .

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.

Before deciding to use a custom font, we highly recommend considering one of the hundreds of fonts in as your first choice, since they are fully supported by all our themes.

Custom fonts will not appear as an option in the Theme Editor's font selector.

Watch video tutorial

Upload fonts to Shopify Files


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:

  1. Go to Content > Files and click Upload files to add your WOFF and WOFF2 files.

  2. 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:

  1. Click Duplicate on your current theme.

  2. Click Customize on the duplicated, unpublished theme version.

In your theme editor (Customize):

  1. Go to Theme settings > Advanced.

  2. Click to open the Custom CSS tab.

  3. Copy and paste the following code on a new line:

    @font-face {
      font-family: "FONT NAME";
      src: url("FONT URL") format("woff"),
      url("FONT URL") format("woff2");
    }
  4. Replace FONT NAME with the exact name of your font. Example:

    @font-face {
      font-family: "Custom Font Name";
      src: url("FONT URL") format("woff"),
      url("FONT URL") format("woff2");
    }
  5. In your Shopify files, click the link icon to copy the URL and replace FONT URL for both the WOFF and WOFF2 formats. Example:

    @font-face {
      font-family: "Custom Font Name";
      src: url("https://cdn.shopify.com/s/files/1/0518/6692/7292/files/DMSans-Regular.woff?v=1663348292") format("woff"),
      url("https://cdn.shopify.com/s/files/1/0518/6692/7292/files/DMSans-Regular.woff2?v=1663348302") format("woff2");
    }
    
  6. Click Save.

  7. Enter or paste the CSS code into the Custom styles box.

  8. Click Save.

  9. Click Preview to review your changes.

    Use the preview link to further test your changes on multiple browsers and devices.

  10. After testing, you can go to your Theme library to Publish the duplicated theme with your changes.

Apply fonts to theme text


Once you've added your font, you can apply it manually to elements of your theme with the CSS code below.

Apply fonts globally to Logo, Headings, and Body text and apply fonts specifically to Navigation menus Buttons.

Logo, Headings, and Body text

Cornerstone groups theme text into 3 categories: Logo, Headings, and Body. Use the code below to override the font settings in your theme editor.

STEPS

In your theme editor (Customize):

  1. Copy and paste the code below on a new line in the Custom CSS field of your theme settings.

    :root {
    /*
      --font-logo: unset;
      --font-logo-weight: unset;
      --font-logo-style: unset;
      */
    /*
      --font-heading: unset;
      --font-heading-weight: unset;
      --font-heading-style: unset;
      */
    /*
      --font-body: unset;
      --font-body-weight: unset;
      --font-body-style: unset;
      */
    }

    --font-logo applies to the site title (when no logo image is used).

    --font-heading applies to headings and subheadings for pages and sections.

    --font-body applies to paragraph, navigation, product listing, and button text.

  2. 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-logo: Custom Font Name;
    --font-logo-weight: unset;
    --font-style: unset;
    }
  3. (Optional.) If your font has multiple weights or styles, replace unset with the values for those properties. Example:

    :root {
      --font-logo: Custom Font Name;
      --font-logo-weight: 400;
      --font-style: italic;
    }
  4. Click Save.

    Click Preview Store to test and troubleshoot your code before publishing the theme.

Navigation menus and Buttons

The Body font applies to navigation and button text. However, you can apply fonts specifically to the Menu items and Buttons

STEPS

In your theme editor (Customize):

  1. To apply fonts only to menu items, paste and edit the following code on a separate line:

    .header__links-list,.navigation__submenu-list {
      font-family: "Custom Font Name" !important;
    }
    
  2. To apply fonts only to Buttons, paste and the following code on a separate line:

    .btn {
      font-family: "Custom Font Name" !important;
    }
    
  3. Click Save.

    Click Preview Store to test and troubleshoot your code before publishing the theme.

Apply fonts to specific elements

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;
}

Add fonts with custom.css file

While we recommend using the available Custom CSS settings in the theme editor, you can use Cornerstone’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
  1. Open the theme-globals.liquid file in the Snippets folder.

  2. Find the useCustomCSS variable and set it to true.

    
    
    
    
    
    {% assign useCustomCSS = false %}
    
    
    
    
    
  3. Open the custom.css file in the Assets folder.

  4. Add your custom code to import font files and apply them to your theme text.


Related links

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 .

Note If your require assistance, we recommend contacting or .

Applying fonts to specific elements requires knowing how to use your browser's and familiarity with .

CloudConvert
Shopify Experts ↗
Task Husky ↗
Inspector tool ↗
CSS selectors ↗
Edit theme JavaScript
Custom JavaScript events
Custom Liquid
Custom CSS
Custom fonts
verified Fluorescent partner
Shopify's Font Picker