Custom font not loading

Hi there,

I am using the same process that I always use for loading in a custom font, however its not working when i refer to it in CSS and is snapping back to the default error font times new roman. Does anyone recognise an issue? Thanks so much.

Ella

PW: ellaella

did you uploaded the file in content ==> Files?

and if added then use the url ==> Copy from files

like this and add the url in the font-Face url inside

Example: url(‘https://cdn.shopify.com/s/files/1/0732/3769/2573/files/bcop-removebg-preview.webp?v=1754954773‘)

HI @ellacoker

For each url, try to use

| asset_url

So for your case

url({{ 'Boska-Light.woff2'  | asset_url }}) 

Hello, I have just done that and still not working.

The code is proper – try pasting it into a different CSS file.
Shopify complains about something in your base.css – could be related:

/** Shopify CDN: Minification failed

Line 3727:6 Comments in CSS use "/* ... */" instead of "//"
Line 4142:0 Expected "}" to go with "{"

**/

Also, you can use “Custom Liquid” section in your Footer Group and add code there, wrapped with <style>...</style>. Benefit – you can run liquid code there, like file_url, which is not processed in the .CSS assets

Try using this code in Theme.liquid before closing style and then check this, or if you cant reach this, send me Store url and collaborator code to check this properly. Thanks and best regards.

Hey @ellacoker,
Thanks for Bringing this question to Shopify community.
If you facing the issue with the loading of the font then the only solution is to paste the existing code in theme.liquid file instead of base.css file.
Here are the steps that you need to follow:
Go to Shopify Admin >> Online Store >> themes >> Edit Code >> theme.liquid
In the theme.liquid check for where the tag is closed.
After that add a style tag like below.

<style>
Your Font Code here
</style>

By following this your font will surely load.

If you need assistance then share the 4 digits collab code in the p/m so that I can take a look.
Thanks

Hi @ellacoker,

You can follow theinstructions below, it will work fine:

I see the font is called in base.css file, but does not see it has been used somewhere in your store. Exmaple you must use font like this

h1 { font-family: Boska-Medium; }