Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0

Custom Google font works only while editing CSS. Reverts to default site font after navigating to a new page.


Question

Site URL: https://robin-khaki-7l6n.squarespace.com/test-styles-page

I've been trying to add a Google font (that is not available on the list of available SquareSpace fonts) using the following CSS: 

@import url('https://fonts.googleapis.com/css?family=Barlow:wght@100&display=swap');

@font-face {font-family: 'Barlow', sans-serif;}

p {font-family:'Barlow'; font-weight: 100;}

While I'm in the midst of editing the custom CSS, the fonts on the page display properly. However, after I save the CSS and navigate to a different page, all the fonts change to a random font (and not even a sans-serif font!). Furthermore, when I inspect the code, it says that the font displayed is Barlow (see screen shot)

Then the weirdest thing: when I navigate back to the Custom CSS area, the fonts change back to the "Barlow" font specified in the CSS. Without me making any changes! Just by navigating to that screen.

Can anyone help?

Screen Shot 2021-04-01 at 2.54.17 PM.png

Link to post
  • Answers 3
  • Created
  • Last Reply

Top Posters For This Question

Top Posters For This Question

Popular Posts

Thanks @tuanphan for the solution! Here's what worked: Removed all the CSS above. Edited site footer and added the following in a code block: <link rel="preconnect" href="https:/

Posted Images

3 answers to this question

Recommended Posts

  • 0

Thanks @tuanphan for the solution! Here's what worked:

  1. Removed all the CSS above.
  2. Edited site footer and added the following in a code block:
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Barlow:wght@100&display=swap" rel="stylesheet">

    3. Went to Design>Custom CSS and added the following:

p {
    font-family: 'Barlow', sans-serif;
}

 

 
Link to post

Create an account or sign in to comment

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


×
×
  • Create New...