Make WordPress Core

Changeset 61015


Ignore:
Timestamp:
10/21/2025 10:57:43 AM (9 months ago)
Author:
cbravobernal
Message:

Block editor: Conditionally enqueue front end assets for fitText.

Introduces a new fitText block support that enables automatic font size adjustment to fit text within its container boundaries.

Props jorgefilipecosta, mukesh27, wildworks.

Fixes #64119.

File:
1 edited

Legend:

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

    r58950 r61015  
    307307 */
    308308function wp_render_typography_support( $block_content, $block ) {
     309        if ( ! empty( $block['attrs']['fitText'] ) ) {
     310                wp_enqueue_script_module( '@wordpress/block-editor/utils/fit-text-frontend' );
     311        }
    309312        if ( ! isset( $block['attrs']['style']['typography']['fontSize'] ) ) {
    310313                return $block_content;
Note: See TracChangeset for help on using the changeset viewer.