Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Site Editor Layout Breaks When Selecting Font Sizes with Long Names in theme.json #68271

Open
3 of 6 tasks
SainathPoojary opened this issue Dec 24, 2024 · 4 comments · May be fixed by #68280
Open
3 of 6 tasks

Site Editor Layout Breaks When Selecting Font Sizes with Long Names in theme.json #68271

SainathPoojary opened this issue Dec 24, 2024 · 4 comments · May be fixed by #68280
Assignees
Labels
[Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@SainathPoojary
Copy link
Contributor

Description

When adding custom font sizes with long names in the theme.json file, the Site Editor layout breaks when these font sizes are selected. The issue manifests as an overflow in the Site Editor panel, causing a horizontal scrollbar to appear. This negatively impacts the user experience by breaking the layout and making the interface difficult to use.

Step-by-step reproduction instructions

  1. Add custom font sizes with long names in your theme’s theme.json file. Example:
{
	"settings": {
		"typography": {
			"fontSizes": [
				{
					"slug": "extra-long-heading-one",
					"size": "16px",
					"name": "Extra Extra Extra Long Heading Style One"
				},
				{
					"slug": "extra-long-heading-two",
					"size": "20px",
					"name": "Extra Extra Extra Long Heading Style Two"
				}
			]
		}
	}
}
  1. Navigate to the Site Editor (Appearance > Editor).
  2. Open the Typography panel and try to select one of the custom font sizes with a long name.
  3. Observe how the Site Editor layout breaks, leading to overflow and the appearance of a scrollbar.

Screenshots, screen recording, code snippet

2024-12-24.18-00-16.mp4

Environment info

  • WordPress: 6.8-alpha-59533
  • PHP: 8.2.26
  • Server: Apache/2.4.62 (Debian)
  • Database: mysqli (Server: 11.4.4-MariaDB-ubu2404 / Client: mysqlnd 8.2.26)
  • Browser: Chrome 131.0.0.0
  • OS: macOS
  • Theme: Emptytheme 1.0
  • MU Plugins: None activated
  • 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
@SainathPoojary SainathPoojary added the [Type] Bug An existing feature does not function as intended label Dec 24, 2024
@himanshupathak95
Copy link
Contributor

himanshupathak95 commented Dec 25, 2024

I observed similar behavior with the given conditions -

Image

@yogeshbhutkar
Copy link
Contributor

A similar thing can be replicated on mobile devices if the text becomes too large.

Image

@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Dec 25, 2024
@yogeshbhutkar
Copy link
Contributor

yogeshbhutkar commented Dec 25, 2024

Thank you for raising the issue, @SainathPoojary. I’ve implemented a potential fix for the issue, simply applying display: contents appears to resolve it.

@SainathPoojary
Copy link
Contributor Author

Thank you for addressing the issue @yogeshbhutkar! Applying display: contents seems like a reasonable solution. I’ve tested it, and it’s working correctly.

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants