Sleek
Try Sleek freeResourcesOther solutions
  • What is Sleek theme
  • Changelog
  • Refund policy
  • Support policy
  • Getting started
    • Install Sleek theme
    • Set up my store as Sleek demo
    • Update Sleek theme
    • Theme license & Transfer
  • BUILD FOR SUCCESS SERIES
    • Homepage for Health & Beauty 🔥
  • Page's global sections
    • General settings
    • Announcement bar
    • Cart drawer
    • Header
      • Mega menu
      • Use Country/ Region selector
      • Use Language selector
    • Footer
    • Mobile navigation bar
    • Pop-up
    • Quick view
  • Theme sections
    • Before/ After image slider
    • Blog post
    • Card images
    • Collage tabs
    • Collapsible tabs
    • Collection image showcase
    • Collection list
    • Collections showcase
    • Collections slider
    • Contact form
    • Countdown timer
    • Custom content
    • Custom liquid
    • Email signup
    • Favorite products
    • Feature list
    • Featured product
    • Featured collection
    • Featured products tab
    • Highlight text with image
    • Image gallery
    • Image with text
    • Image with text columns
    • Image with text overlay
    • Layered images with text
    • Lookbook banner
    • Lookbook cards
    • Lookbook slider
    • Media with collection
    • Multicolumn
    • Press
    • Products bundle
    • Product tabs
    • Product showcase
    • Recently viewed products
    • Rich text
    • Scrolling promotion
    • Slideshow
    • Store locator
    • Testimonials
    • Video
    • Video hero
    • Video with text
  • Theme settings
    • General 🔥
    • Animations
    • Buttons
    • Custom CSS
    • Blog cards
    • Cart
    • Collection cards
    • Color swatches
    • Colors
    • Currency format
    • Layout
    • Logo
    • Product cards
    • Search behavior
    • Social media
    • Typography
  • Collections & Products
    • Product page
      • Product template
      • Page sections
        • Breadcrumbs
        • Product information
        • Related products
        • Sticky add to cart bar 🔥
    • Collection page
      • Collection template
      • Collection sections
        • Collection banner
        • Product grid
    • Collections list page
  • Other pages
    • 404 page
    • Blogs
    • Blog posts
    • Cart
    • Password
    • Search page
  • FAQs
    • Generic
      • Add gift wrap option to my cart
      • Combined listings app
      • How to add custom fonts in Sleek? 🔥
      • JavaScript events for developers
    • Product
      • Set up quantity rules and volume pricing 🔥
      • Add custom badges using product tags
      • Set up Local Pickup option
      • Show dynamic content for Products using Metafields 🔥
Powered by GitBook
On this page
  • 1. Upload your custom font to Shopify
  • 2. Create a customization file for your Sleek theme
  • 3. Initialize the font in the CSS file
  • 4. Apply the font to the theme
  • For body text:
  • For headings:
  • For navigation:
  • For subheadings:
  • For product cards title:
  • For buttons:
  • Notes & Tips 📝
  1. FAQs
  2. Generic

How to add custom fonts in Sleek? 🔥

A guide to add custom fonts to your store

PreviousCombined listings appNextJavaScript events for developers

Last updated 4 months ago

Sleek provides a wide library of system fonts to meet most design needs, but you can add custom fonts to personalize your theme further. Here’s how! ✨

1. Upload your custom font to Shopify

  • Ensure the font format is one of the following: .ttf, .otf, .woff, or .woff2.

  • Legal use: Ensure you have proper licenses for your custom fonts by working directly with font authors or distributors to ensure legal compliance.

Steps:

  1. Go to Shopify Admin > Files > Upload Files.

  2. Select and upload your font file.

2. Create a customization file for your Sleek theme

To manage your customizations, you’ll need a dedicated CSS file. This makes updates easier and keeps everything organized.

Steps:

1. In your Shopify admin, go Online Store > Edit code.

2. Navigate the Assets folder, click Add a new asset.

3. In the pop-up, click Create a blank file.

4. Select the Extension and name the file custom.

  1. Click Done.

6. After the new asset is created, go to the Layout folder and open the theme.liquid file.

7. Locate this line:

echo 'theme.css' | asset_url | stylesheet_tag: preload: true
  1. Copy the line, paste it below, and update the file name to custom.css:

echo 'custom.css' | asset_url | stylesheet_tag: preload: true

9. Click Save.

3. Initialize the font in the CSS file

You’ll now define your custom font using @font-face in the new custom.css file.

Steps:

  1. Go to Themes > Edit Code, and open assets/custom.css

  1. Add the following code:

@font-face{
  font-family: Name of font ;
  src : url( font-url );
}

For example:

@font-face{
  font-family: SofiaSans;
  src : url(https://cdn.shopify.com/s/files/1/0642/0565/2198/files/SofiaSans-Regular.ttf?v=167393855 );
}

Optional font styles:

  • Bold:

@font-face{
  font-family: SofiaSans;
  src : url(https://cdn.shopify.com/s/files/1/0642/0565/2198/files/SofiaSans-Regular.ttf?v=167393855 );
  font-weight: bold;
}
  • Italic:

@font-face{
  font-family: SofiaSans;
  src : url(https://cdn.shopify.com/s/files/1/0642/0565/2198/files/SofiaSans-Regular.ttf?v=167393855 );
  font-weight: bold;
  font-style: italic;
}

4. Apply the font to the theme

Customize specific areas of your theme by updating CSS variables. Add these codes to your custom.css file.

For body text:

:root
{
--font-body-family : font-name;
--font-body-style : font-style;
--font-body-weight : font-weight;
}

For example:

:root
{
--font-body-family : SofiaSans;
--font-body-style : italic;
--font-body-weight : bold;
}

For headings:

:root
{
--font-heading-family : font-name;
--font-heading-style : font-style;
--font-heading-weight : font-weight;
}

For example:

:root
{
--font-heading-family : SofiaSans
--font-heading-style : italic;
--font-heading-weight : bold;
}

For navigation:

:root
{
--font-navigation-family : font-name;
}

For example:

:root
{
--font-navigation-family : SofiaSans
}

For subheadings:

:root
{
--font-subheading-family : font-name;
}

For example:

:root
{
--font-subheading-family : SofiaSans
}

For product cards title:

:root
{
--font-pcard-title-family : font-name;
}

For example:

:root
{
--font-pcard-title-family : SofiaSans
}

For buttons:

:root
{
--font-button-family : font-name;
}

For example:

:root
{
--font-button-family : SofiaSans
}

Then, click Save and check the result.


Notes & Tips 📝

  • Font performance: Using too many fonts can slow down your site. Stick to 1-2 custom fonts for better performance.

  • Browser compatibility: Use formats like .woff2 for modern browsers and .woff for older ones.

  • Test across devices: Ensure your fonts display correctly on different devices and browsers.


🎉 Congratulations! Your custom font is now ready to elevate your designs in Sleek. 🚀

Once uploaded, click the button and copy the font's URL.