Adding code to Theme.css is not changing fonts on the website

Adding code to Theme.css is not changing fonts on the website

MAYLA
Visitor
3 0 0

Hi,

 

I'm trying to change the font on our website for the theme Stiletto.

 

our font is called "Neutra Text Book Alt" and i have it in a woff2 file, I've been following this instruction below, but nothing happens, the font doesn't change.

 

  1. Convert your font from OTF to WOFF2

  2. From your Shopify Admin go to Online Store > Themes > next to the theme you want to edit click Actions > Edit Code. Go to Asset/theme.css

  3. Paste code at the bottom, replace name of you font and of you file

     

     @font-face {

    font-family: "NAME OF FONT";

    src: url("NAME-OF-FONT-FILE.woff2") format("woff2"),

    url("NAME-OF-FONT-FILE.woff") format(”woff");

    }

     

    Add Classes here with comma, { font-family: ”NAME OF FONT”Important; }

     

    4. Upload the WOFF2-file under assets

     

    5. Copy full font name (without ”.woff2” and paste above in NAME OF FONTS

     

    6. Add classes here "Add Classes here with comma, ", if you want all text add:

    h1,h2,h3,h4,h5,h6,body,p,a

     

    7. Add below/above our new code


    // newly installed code starts

    // newly installed code ends


I would be very thankful if someone could help me.

Thanks!

 

Replies 5 (5)

zara120
Visitor
1 0 0

i tried this code on my this project but i did not found the results.

MAYLA
Visitor
3 0 0

The font I want to add is called Neutra Text Book Alt. Perhaps Shopify won't accept the font? 

PageFly-Victor
Shopify Partner
7865 1786 3131

Hi @MAYLA,

You can use my code

@font-face {
font-family: "Neutra Text Book Alt";
src: url("https://cdn.shopify.com/s/files/1/0612/7756/9224/files/NeutraText.woff2?v=1676079239") format("woff2")
}

using

h1,h2,h3,h4,h5,h6,body,p,a{
font-family:'Neutra Text Book Alt'
}

 

Hope my solution works perfectly for you!

Best regards,

Victor | PageFly

MAYLA
Visitor
3 0 0

Hi, Thank you so much but it still doesn't work. I added your code to our "theme.css" But should I add it somewhere else? 

PageFly-Victor
Shopify Partner
7865 1786 3131

Cab you give me a screenshot of the position added code?