Description
I'm using the theme.json file to disable a number of font settings for the theme. Specifically there is an issue with custom font sizes:
{
"version": 1,
"settings": {
"typography": {
"customFontSize": false,
"fontSizes": []
}
}
}
Setting both of those properties does not actually remove the classnames (e.g. .has-large-font-size or variables (e.g. var(--wp--preset--font-size--large)).
The challenge this introduces is that the core/cover block's default template uses <p class="has-large-font-size">…</p>. Since the UI was disabled in theme.json, there is no way in the editor to remove this setting (with the exception of using the code editor which I don't think is a valid solution). Further, because the .has-large-font-size class uses !important it is also very difficult to override the style in my theme. I can use !important myself, but if I have custom paragraph styles applies, I'll need even more specific selectors.
I would expect that if I disable custom font sizes entirely, it should not define the classnames or variables at all or, at the very least, not apply them to existing blocks.
Step-by-step reproduction instructions
- Disable custom font sizes using
theme.json.
- Add a
core/cover block.
- Note the
has-large-font-size class applied with no way to remove it.
Screenshots, screen recording, code snippet
No response
Environment info
WordPress 5.8
Not using the Gutenberg plugin (although I have tested and the issue remains with the plugin enabled).
Pre-checks
Description
I'm using the
theme.jsonfile to disable a number of font settings for the theme. Specifically there is an issue with custom font sizes:{ "version": 1, "settings": { "typography": { "customFontSize": false, "fontSizes": [] } } }Setting both of those properties does not actually remove the classnames (e.g.
.has-large-font-sizeor variables (e.g.var(--wp--preset--font-size--large)).The challenge this introduces is that the
core/coverblock's default template uses<p class="has-large-font-size">…</p>. Since the UI was disabled intheme.json, there is no way in the editor to remove this setting (with the exception of using the code editor which I don't think is a valid solution). Further, because the.has-large-font-sizeclass uses!importantit is also very difficult to override the style in my theme. I can use!importantmyself, but if I have custom paragraph styles applies, I'll need even more specific selectors.I would expect that if I disable custom font sizes entirely, it should not define the classnames or variables at all or, at the very least, not apply them to existing blocks.
Step-by-step reproduction instructions
theme.json.core/coverblock.has-large-font-sizeclass applied with no way to remove it.Screenshots, screen recording, code snippet
No response
Environment info
WordPress 5.8
Not using the Gutenberg plugin (although I have tested and the issue remains with the plugin enabled).
Pre-checks