I’m under a bit of a deadline, so I’m afraid I can’t provide much info at the moment. I ended up just reinstalling TT3 and then editing my child theme manually.
I should have saved a copy of the old theme.json and diff’d them, but I’m afraid I did not. I added a list under settings/typography/fontFamlies with the custom fonts I needed and the CSS is being generated to the child theme’s path as expected, based on src like file:./assets/fonts/Montserrat-VariableFont_wght.woff2
.
One thing I noticed is that the way the child/parent theme.json are merged, the settings/typography/fontFamilies list from the child completely replaces the one in the parent. So the font families from TT3 no longer appear in the block editor. The theme.json v2 “living reference” doesn’t have any details about how child theme.json entries are merged with the parent’s, so no idea if this is by design or a bug.
In any case, that’s ok for my scenario. I just duped the “system font” entry from TT3 so it would still be available in addition to the google fonts I added, i.e.
child/theme.json:settings/typography/fontFamilies:
...
{
"fontFamily": "-apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,Oxygen-Sans,Ubuntu,Cantarell,\"Helvetica Neue\",sans-serif",
"name": "System Font",
"slug": "system-font"
}
...
A word of caution to anyone editing the theme.json file by hand, it does not use JSON5 conventions and is very strict on the input, so if you have an additional trailing comma, for example, your theme won’t load and you will just get a not-very-helpful “PHP Notice: Error when decoding a JSON file” message in your WP_DEBUG log.
-
This reply was modified 1 year, 9 months ago by
ryandjohnson.
-
This reply was modified 1 year, 9 months ago by
ryandjohnson.