How to generate a CSS @font_face declaration for a Shopify font?

How to generate a CSS @font_face declaration for a Shopify font?

iztokmlakar
Visitor
1 0 0

Hi there,

 

How can I generate a CSS @font_face declaration to use in theme.liquid for a Shopify-hosted font, archivo_n4, for example. In other words I want to use the Archivo font that's already hosted in Shopify and I want to include it in my theme.liquid (and custom.css) file using Liquid.

 

Thanks!

 

I

Reply 1 (1)

elinagg4
Visitor
1 0 0

In your theme.liquid document, add the accompanying Fluid code bit to characterize the @font-face statement:

fluid
{% catch fontUrl %}https://cdn.shopify.com/s/textual styles/archivo_n4.woff{% endcapture %} @font-face { text style family: 'Archivo'; src: url({{ fontUrl }}) format('woff'); textual style weight: ordinary; textual style: typical; }
For more data click here