Skip to content

Font picker not reflecting correct size with custom font sizes #67283

@mikemcalister

Description

@mikemcalister

Description

When a theme has several custom font sizes declared in theme.json, the global styles UI does not show the right label for the assigned font sizes. When you cycle through the H1-H6 selector, it shows random font sizes in the select label. See video below.

The issue does not affect a theme like 2025 which has the standard S, M, L, XL, XXL font size pattern. But when more font sizes are added to 2025, the issue does show.

Step-by-step reproduction instructions

  1. Add several custom font sizes to theme.json (more than 5).
  2. Go to Global Styles > Typography > Headings.
  3. Toggle back and forth between the H1-H6 selectors and note the label in the font size drop down versus the actual selection.

Screenshots, screen recording, code snippet

CleanShot.2024-11-25.at.13.56.46.mp4

Environment info

WP 6.7.1

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Package] Components/packages/components[Status] In ProgressTracking issues with work in progress[Type] BugAn existing feature does not function as intended

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions