Shopify provides hundreds of free fonts to use for your store. However, you need to use a custom font to get aligned with your brand guideline but it is not supported by Shopify, you can still add it to your theme. Here is a guide on how to do it:
-
You need to have your font available first. Some fonts have licenses, so make sure you purchase them properly for your use. Our support team will not be in charge of getting your required fonts.
-
Next, prepare two files with the format .woff and .woff2 for each font style to be added. This is to make sure that your added font is readable on all types of browsers.
-
After having sufficient files, you upload them to the folder File in Theme settings.
All your uploaded font files have the chain button on the right side to provide the file link for your act of copying.
-
Next, get back to your admin dashboard, click on Online store > Themes and choose Be Yours theme to edit further. Click on ... > Edit code.
-
In the open edit code window, you navigate to the folder Snippets in the left-hand column. In this folder, click on the file “css-variables.liquid” to add some custom code for the new font.
-
In the file open file “css-variables.liquid”, you add additional codes under the tab style. It can be found under the text {%- style -%}. The codes are added as follows:
@font-face {
font-family: "MyFontHeading";
src: url('add your font file link') format("woff2"),
url('add your font file link') format("woff");
}@font-face {
font-family: "MyFontBody";
src: url('add your font file link') format("woff2"),
url('add your font file link') format("woff");
}Note: Italic text sections are customized by you. The number of @font-face{ } codes to be added depends on how many font styles that you have.
-
After that, you:
-
Search for the text “font-heading-family” and replace all parts of {{...}} with your added text for font-family line ('MyFontBody' in our example).
-
Search for the text “font-body-family” to navigate to relevant code line and replace all parts of {{...}} with your added text for font-family in the codes of step 6 (in our example, it is 'MyFontHeading')
-
- After replacement, the commented code in the red box is replaced by the code in the green box. It looks like the below photo:
- Finally, click Save.
Note:
- The settings in Theme settings > Typography is no longer in effect no matter what you configure here once you add these codes in the “css-variables.liquid” file.
- All above instructions are applicable when you apply the same custom font for all sections & block. In case you need to apply various fonts for different sections or blocks, the edit process will much more complicated and please contact our support team to get further help.
Need Further Assistance
If you encounter any issues or need additional help with your Be Yours theme, don't hesitate to reach out to Roartheme's support team for expert guidance.
Scan the QR code to get support within 8 hours via RoarTheme ’s Whatsapp
Share:
Image size guidelines of Be Yours theme
Set up the EU cookie banner for your website