Skip to content

Commit 201c4c9

Browse files
jorgefilipecostamcsfyouknowriadmrwweb
authored andcommitted
Fix: Custom font size taking over fit text. (#73241)
Co-authored-by: jorgefilipecosta <jorgefilipecosta@git.wordpress.org> Co-authored-by: mcsf <mcsf@git.wordpress.org> Co-authored-by: youknowriad <youknowriad@git.wordpress.org> Co-authored-by: mrwweb <mrwweb@git.wordpress.org>
1 parent bcc4ea3 commit 201c4c9

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

backport-changelog/6.9/10517.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
https://github.com/WordPress/wordpress-develop/pull/10517
2+
3+
* https://github.com/WordPress/gutenberg/pull/73241

lib/block-supports/typography.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ function gutenberg_typography_get_preset_inline_style_value( $style_value, $css_
244244
* @return string Filtered block content.
245245
*/
246246
function gutenberg_render_typography_support( $block_content, $block ) {
247-
if ( ! empty( $block['attrs']['fitText'] ) && ! is_admin() ) {
247+
if ( ! empty( $block['attrs']['fitText'] ) && $block['attrs']['fitText'] && ! is_admin() ) {
248248
wp_enqueue_script_module( '@wordpress/block-editor/utils/fit-text-frontend' );
249249

250250
// Add Interactivity API directives for fit text to work with client-side navigation.
@@ -260,6 +260,8 @@ function gutenberg_render_typography_support( $block_content, $block ) {
260260
$block_content = $processor->get_updated_html();
261261
}
262262
}
263+
// fitText supersedes any other typography features
264+
return $block_content;
263265
}
264266

265267
if ( ! isset( $block['attrs']['style']['typography']['fontSize'] ) ) {

0 commit comments

Comments
 (0)