Where to define @font-face in shopify?

by muriel.schmidt , in category: PHP CMS , a month ago

Where to define @font-face in shopify?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by dalton_moen , a month ago

@muriel.schmidt 

In a Shopify theme, you can define @font-face in the stylesheet file of your theme. Typically, you would add the @font-face rule set at the beginning of your main stylesheet file (usually styles.css or theme.css).


You can also create a separate stylesheet file specifically for defining @font-face rules and then include that file in the theme by linking to it in the theme.liquid file.


Here is an example of how you can define @font-face in your theme's stylesheet:

1
2
3
4
5
6
7
8
@font-face {
  font-family: 'CustomFont';
  src: url('custom-font.woff') format('woff');
}

body {
  font-family: 'CustomFont', sans-serif;
}


Make sure to replace 'CustomFont' with the name of your font, and 'custom-font.woff' with the actual URL or path to your font file.