Skip to content

Site Editor Layout Breaks When changing existing names of Font Sizes with Long Names in theme.json #68344

@snehapatil2001

Description

Description

  • When updating existing font sizes with long names in the theme.json file, the Site Editor layout breaks when selecting these font sizes. The issue results in the text overflowing and overlapping with other elements in the Site Editor panel, making the layout look misaligned and negatively impacting the user experience.
  • This happens when the font size names are long enough to extend beyond the available space, causing visual disruptions and layout issues.

Expected behavior

Font size names with long text should be properly truncated with an ellipsis or wrapped within the available space, preventing any overflow or layout issues in the Site Editor.

Step-by-step reproduction instructions

  1. Open your theme's theme.json file and update the existing font sizes with long names. Example:
    {
      "settings": {
        "typography": {
          "fontSizes": [
    	{
    		"fluid": false,
    		"name": "Small small small small small small small small small small small small small small small",
    		"size": "0.875rem",
    		"slug": "small"
    	},
          ]
        }
      }
    }
  2. Navigate to the Site Editor (Appearance > Editor).
  3. Open the Typography panel and select one of the custom font sizes with a long name.
  4. Observe how the Site Editor layout breaks, with text overlapping or causing a horizontal overflow.

Screenshots, screen recording, code snippet

Screen.Recording.2024-12-27.at.3.17.15.PM.mov

Environment info

  • WordPress: 6.8-alpha-59561
  • PHP: 8.1.29
  • Server: nginx
  • Database: MySQL 8.016
  • Browser: Version 131.0.6778.205
  • OS: macOS
  • Theme: Twenty Twenty-Five
  • Plugins: Gutenberg 19.9.0

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

Assignees

Labels

Global StylesAnything related to the broader Global Styles efforts, including Styles Engine and theme.jsonNeeds Design FeedbackNeeds general design feedback.[Feature] TypographyFont and typography-related issues and PRs[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