Jump to content

Custom Google font works then breaks with no changes

Go to solution Solved by mjlazer,

Recommended Posts

Hi all, first post.

I was using @import to use a Google font called Barlow Condensed. It's not listed in SquareSpace but I managed to get it working. Then when I came back to keep working the next day, it was only using the fallback font 'sans serif'. I saw an error in the console saying "Could not decode font". I then switched to using <link> and injected the code into the header and it started working again. Now, I login and it's back to sans serif. In the element inspector, the 'Barlow Condensed' isn't crossed out, it's just not picking up the font file it seems.

I'm currently on a trial so not sure if I can share the live website or not but let me know if I can and you need to see it.

Here's the code:

HTML:

<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@0,300;0,500;0,700;0,900;1&display=swap" rel="stylesheet">

CSS:

h1, h2, h3, h4, h5, h6 {
  font-family: 'Barlow Condensed', sans-serif !important;
  font-weight: 900 !important;
  text-transform: uppercase !important;
}

 

Edited by mjlazer
Link to comment
  • Replies 1
  • Views 1.1k
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment


×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.