Jump to content

Recommended Posts

Posted

Hi,

I try to change the default font-family by adding the following lines in custom.css

.body {
    font-family: 'Creepster', Arial, sans-serif;
}

but it won't work. Any help would be welcome.

Posted

Unfortunately, what I thought was solved is not. I still have the same problem. My default font change is not reflected despite adding the appropriate lines in custom.css. I'm completely lost.😐

Posted

I'm still trying to figure out why I can't integrate a Google font into my site via "custom.css". The font I want to use is "Creepster". So the lines I have added are as follows

@import url('https://fonts.googleapis.com/css2?family=Creepster&display=swap" rel="stylesheet');
body *{
  font-family: Creepster, cursive; !important
}

But it still doesn't work. Thank you for your help.

 

Posted

Hello,

This code is working fine for me:

@import url('https://fonts.googleapis.com/css2?family=Creepster&display=swap');
body {
  font-family: Creepster, cursive;
}

 

Could contain: Text, Paper

If you're trying to use it on a 3rd party theme, post your URL here and I'll take a closer look for you 🙂

Posted
16 minutes ago, opentype said:

Before assigning a new Google font, you need to turn off the Google fonts assigned in your theme settings.

This is already the case but you cannot see it because it is another theme that is a copy of the one displayed by default.  As I don't want my members to be able to access it now, it is only visible to the "administrator" group.

Posted
3 hours ago, Olmyster said:

This is already the case but you cannot see it because it is another theme that is a copy of the one displayed by default.  As I don't want my members to be able to access it now, it is only visible to the "administrator" group.

We’ll need to view the broken/admin theme to find out why the font isn’t loading. 

Posted

Your site is currently using this code:

@import url('https://fonts.googleapis.com/css2?family=Creepster&display=swap" rel="stylesheet');
body {
    font-family: Creepster, cursive;
}

It needs to be this:

@import url('https://fonts.googleapis.com/css2?family=Creepster&display=swap');
body {
    font-family: Creepster, cursive;
}

 

With that said, import statements should only appear at the very top of your css file. Depending on how your theme has been coded, the custom.css file can be appended to other files, which means that your import statement is no longer at the top.

A safer solution would be to use the <link> code. Add this to the <head> area of your theme:

<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=Creepster&display=swap" rel="stylesheet">

Then use this in your css:

body {
    font-family: 'Creepster', cursive;
}

 

Posted

Thank you @Ehren, your solution solved my problem. What is strange is the necessity to use the <link> code in the <head> area of my theme because this theme is just a simple copy of the original theme, nothing more.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...