Use custom local fonts through child theme
-
Hello! I’m trying to use a local custom font through a child theme. In this case is Rubik font. I uploaded it through FTP and changed the theme.json file with this code:
"fontFace": [
{
"fontFamily": "Rubik",
"fontStretch": "",
"fontStyle": "normal",
"fontWeight": "300 400 500 600 700 800 900",
"src": [
"file:./assets/fonts/Rubik-VariableFont_wght.woff",
"file:./assets/fonts/Rubik-VariableFont_wght.woff2",
"file:./assets/fonts/Rubik-VariableFont_wght.ttf"
]
}
],
"fontFamily": "\"Rubik\", sans-serif",
"name": "Rubik",
"slug": "rubik"
}I’ve used Spectra One with child theme many times and I’ve always had some problems customizing theme options changing theme.json file in the child theme. But this is the first time that, after uploading font and customizing theme.json file, I can’t use Rubik font on the theme editor styles options. It continues to show only Inter. And the font changes in the frontend because of body style in my custom css.
So, is there any change I’m missing? Also I can see that all custom css properties (e.g., –preset-color–light) are declared out of theme.json, so I’m not sure that theres any point on customizing theme.json file to change theme editor options for the theme?
The page I need help with: [log in to see the link]
- The topic ‘Use custom local fonts through child theme’ is closed to new replies.