Skip to content

Commit

Permalink
Use disableFontSizes to remove core font sizes.
Browse files Browse the repository at this point in the history
  • Loading branch information
justintadlock committed Jan 25, 2024
1 parent cfdd5fb commit 0f14dd2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
15 changes: 11 additions & 4 deletions src/ThemeJson.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,19 @@ public function boot(): void
}

/**
* Removes the core font-sizes, which are re-added in Gutenberg 16.9. In
* the past, if a theme defined a set of custom sizes, these were not
* shown. Currently, there is no way to disable the core sizes via
* `theme.json`, so we're removing them via a filter.
* Removes the core font-sizes entirely from the being rendered. We're
* handling the fallbacks for this via CSS.
*
* These were merged (and put at the top) of the font-size picker in
* Gutenberg 16.9 with no `theme.json`-method of disabling them. In the
* past, if a theme defined a set of custom sizes, these were not shown.
* @link https://github.com/WordPress/gutenberg/issues/55744
*
* Gutenberg 17.6 added the `defaultFontSizes` prop:
* @link https://github.com/WordPress/gutenberg/pull/56661
*
* @todo Remove above notes with WordPress 6.5+ min. requirement.
*
* @hook wp_theme_json_data_default
* @param WP_Theme_JSON_Data The Gutenberg plugin breaks this.
* @since 1.0.0
Expand Down
3 changes: 2 additions & 1 deletion theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,8 @@
]
},
"typography": {
"customFontSize": true,
"customFontSize": false,
"defaultFontSizes": false,
"dropCap": true,
"fontFamilies": [
{
Expand Down

0 comments on commit 0f14dd2

Please sign in to comment.