Skip to content

Commit 23f17ae

Browse files
Fix: Custom font size taking over fit text.
Fixes an issue where if a paragraph/heading had a custom font size and then was conververted to the stretchy variation. The custom font size on the front end was applied instead of fit text. Developed in: #10517 Props jorgefilipecosta, mcsf, mrwweb. Fixes #64254. git-svn-id: https://develop.svn.wordpress.org/trunk@61246 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 7766491 commit 23f17ae

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/wp-includes/block-supports/typography.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ function wp_typography_get_preset_inline_style_value( $style_value, $css_propert
306306
* @return string Filtered block content.
307307
*/
308308
function wp_render_typography_support( $block_content, $block ) {
309-
if ( ! empty( $block['attrs']['fitText'] ) && ! is_admin() ) {
309+
if ( ! empty( $block['attrs']['fitText'] ) && $block['attrs']['fitText'] && ! is_admin() ) {
310310
wp_enqueue_script_module( '@wordpress/block-editor/utils/fit-text-frontend' );
311311

312312
// Add Interactivity API directives for fit text to work with client-side navigation.
@@ -322,6 +322,8 @@ function wp_render_typography_support( $block_content, $block ) {
322322
$block_content = $processor->get_updated_html();
323323
}
324324
}
325+
// fitText supersedes any other typography features
326+
return $block_content;
325327
}
326328
if ( ! isset( $block['attrs']['style']['typography']['fontSize'] ) ) {
327329
return $block_content;

0 commit comments

Comments
 (0)