-
I’m working with a designer on project, who asked me about the block editor defaults for font size. This got me spinning up an empty site on the latest version of WP, GeneratePress Pro and GenerateBlocks Pro. The conclusion is as follows:
Core paragraph block defaults:
Small: 17px
Medium: 20px
Large: 36px
Extra Large: 42pxGenerateBlocks Headline block (Paragraph element) defaults:
13px
17px
25px
35pxThis leads me to seek to understand the following:
- Why does GB use different labeling and sizes than the core blocks?
- How do we/can we override both these defaults to make them the same, to our preference?
Forgive me if I’ve missed something, but I cannot find settings for anything other than the 17px option in GB, which appears to adopt the ‘body’ setting in the typography manager.
Short of messing around with a custom theme.json, I’m not sure how to gain control over these values?
-
David
Hi there,
The GB “defaults” we’re set a while back, and we have yet to add a filter to change them, but that is coming.
But they are not to be confused with what core blocks.
Core addshas
classes to their blocks HTML when those options are selected eg.has-large-font-size
.
And yes, if you had theme with theme.json you could set those CSS property values.GB doesn’t use those kinds of Utility classes. And it wasn’t designed as a theme replacement.
For example in GP we recommend you set your Typography in the Theme customizer.
Allow the site to inherit those font sizes and use core blocks where possible.And then use GB where you need custom designs that break from theme styles.
If you find theres a common GB style you use then use the GB Pro Global Styles to create them
-
Thanks David, OK, so it’s good to know I’m not missing something here then!
It would seem to me (at least without fully appreciating the bigger picture), that the ability to define the values of the utility classes such as .has-large-font-size, via GP by way of theme.json, and for that to in turn reflect into the GB options would be a really nice enhancement and unify everything?
Would adding a theme.json to a GP child theme be a terrible idea, and override other defaults in GeneratePress, causing a world of chaos and gnashing of teeth?
-
David
In Customizer > Typography –> Add New typography, in the Target Element select box, choose
Custom
and in the CSS Class field you can add your own class or those utility classes and set the font style there -
Thanks David, sure, that’s how I’ve been doing it. I was more wondering about redefining the variables using theme.json, rather than overriding them. Not a problem though.
-
David
Ah ok.
The Problem with theme.json in a traditional theme it will introduce other CSS properties that you may not want or will conflict with theme styles. Its the main reason we have steered away from introducing it, as it will cause more headaches then its worth – but we are still looking at options here. -
Fair enough, I totally relate to that. My explorations using my old Genesis stack were similar!
-
David
Yeah, theme.json is great for a theme doesn’t come with the kind of customizations that GP offers.
But i am sure it will get better over time 🙂Glad to be of help
- You must be logged in to reply to this topic.