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

Unexpected font size for custom select control on mobile screens #69113

Open
3 of 6 tasks
himanshupathak95 opened this issue Feb 10, 2025 · 2 comments · May be fixed by #69114
Open
3 of 6 tasks

Unexpected font size for custom select control on mobile screens #69113

himanshupathak95 opened this issue Feb 10, 2025 · 2 comments · May be fixed by #69114
Assignees
Labels
[Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@himanshupathak95
Copy link
Contributor

himanshupathak95 commented Feb 10, 2025

Discovered while working on #69029

Description

There is an inconsistent font size behavior in the custom select control component on mobile screens (below 600px). While most text elements maintain a 13px font size, the selected text in the dropdown displays 16px. This inconsistency creates visual misalignment and poor user experience.

Problems with this inconsistency:

  • Creates visual disruption and inconsistent typography hierarchy
  • Dropdown options remain at 13px while only the selected text becomes 16px
  • No clear UX rationale for highlighting just this particular text element
  • Breaks visual consistency with other form controls and text elements
  • Makes the interface feel less polished and professional

While 16px is a common default for body text on mobile devices, dropdowns, and secondary UI elements typically follow the same size as surrounding text to maintain visual harmony. I understand 16px is better for readability, but if only the dropdown retains it while others shrink, it contradicts consistent accessibility practices.

This is a conversation starter and I still think this needs design feedback moving forward and also some accessibility insights. Also, this was added in #22329

Step-by-step reproduction instructions

  1. Open any page/post with a custom select control component
  2. View the page on a mobile device or screen width below 600px
  3. Observe the font size of the selected text in the dropdown
  4. Compare it with other text elements and dropdown options

Screenshots, screen recording, code snippet

Screen.Recording.2025-02-10.at.13.15.06.mov

Environment info

  • WordPress version: 6.7.1
  • Gutenberg version: 20.2.0
  • Theme: Emptytheme 1.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
@himanshupathak95 himanshupathak95 added the [Type] Bug An existing feature does not function as intended label Feb 10, 2025
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Feb 10, 2025
@himanshupathak95
Copy link
Contributor Author

I have created a PR (#69114) that demonstrates the expected behavior and proposes a potential fix for this inconsistency.

The PR removes the mobile-specific font size override to maintain consistent typography across all screen sizes. However, I would appreciate both design and development feedback on this approach, as this is meant to start a conversation about the best way to handle font sizing in our mobile UI components.

@t-hamano
Copy link
Contributor

From what I understand, the current font size is intentional, to prevent zoom in mobile Safari (Example: #27405).

Even in core, the font size of all form elements is consistent at 16px for mobile layouts.

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
2 participants