Make WordPress Core

Changeset 61246


Ignore:
Timestamp:
11/14/2025 11:36:30 AM (4 weeks ago)
Author:
jorgefilipecosta
Message:

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: https://github.com/WordPress/wordpress-develop/pull/10517

Props jorgefilipecosta, mcsf, mrwweb.
Fixes #64254.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/block-supports/typography.php

    r61145 r61246  
    307307 */
    308308function 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
     
    323323            }
    324324        }
     325        // fitText supersedes any other typography features
     326        return $block_content;
    325327    }
    326328    if ( ! isset( $block['attrs']['style']['typography']['fontSize'] ) ) {
Note: See TracChangeset for help on using the changeset viewer.