Support » Developing with WordPress » Problem with editor font sizes in WP 6.1

  • Resolved SkyMaja


    Hi, this is my code, which used to work correctly in WP 6.0.2

    					'name'      => esc_html__( 'XS', 'mywebsite' ),
    					'shortName' => esc_html_x( 'XS', 'Font size', 'mywebsite' ),
    					'size'      => 14,
    					'slug'      => 'extra-small',
    					'name'      => esc_html__( 'S', 'mywebsite' ),
    					'shortName' => esc_html_x( 'S', 'Font size', 'mywebsite' ),
    					'size'      => 16,
    					'slug'      => 'small',
    					'name'      => esc_html__( 'M', 'mywebsite' ),
    					'shortName' => esc_html_x( 'M', 'Font size', 'mywebsite' ),
    					'size'      => 18,
    					'slug'      => 'normal',
    					'name'      => esc_html__( 'L', 'mywebsite' ),
    					'shortName' => esc_html_x( 'L', 'Font size', 'mywebsite' ),
    					'size'      => 30,
    					'slug'      => 'large',
    					'name'      => esc_html__( 'XL', 'mywebsite' ),
    					'shortName' => esc_html_x( 'XL', 'Font size', 'mywebsite' ),
    					'size'      => 40,
    					'slug'      => 'extra-large',

    and here you can see how it looks like now in editor:

    As you can see, there is no px value. Only name of font size, which isn’t the same as on button.

    If I choose for example L on button, the has-normal-font-size class is applied. So it works like it used to be, only labels on the buttons are incorrect (and missing px value).

    Is it a bug in WP 6.1 or do I have to change something? What exactly? I didn’t find any information about this in field guide.

    I don’t have theme.json and don’t want to add it now.

Viewing 2 replies - 1 through 2 (of 2 total)
  • I suspect it has to do with this bug here: – if you have further questions about it, I would recommend you to contact the Gutenberg developers there.

    Thread Starter SkyMaja


    Thanks, yes, it’s that issue. Interesting, that author of this issue has problem in WP 6.0.2 and I’m pretty sure that it used to work correctly on my website, until I updated to 6.1.
    Currently I solved this by adding 6th font size. If they are at least 6, they display correctly in a dropdown instead of a row.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.