Setting Font Sizes in Theme.json
-
I am interested in replicating the font-sizing that I currently have on a traditional theme in a child theme of BlockBase, building from a base font size for a Paragraph up through the Heading font size, H1 through H6. I understand that this will involve messing around with theme.json in the child theme. I have read a lot about theme.json and have poked around gingerly, but I can’t figure out how font size works. Specifically, I can’t figure out how I can set a base font size and then make that definition the basis for all the other font sizes.
Ideally, I would like to set a base font size to 15px and then use em/rem settings for the rest of the font sizes.
I can see where font sizes are defined under settings/custom/typography/fontSizes, e.g.
{
“name”: “Extra Large”,
“size”: “32px”,
“slug”: “x-large”
}And I can see where that gets referenced in the definition for H2.
“h2”: {
“typography”: {
“fontSize”: “var(–wp–preset–font-size–x-large)”
}
}What I don’t see is how to set up the base font size that I can use to define the various other sizes.
- The topic ‘Setting Font Sizes in Theme.json’ is closed to new replies.