Skip to content

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

Closed as not planned

Description

@himanshupathak95

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

Activity

  1. himanshupathak95 commented on Feb 10, 2025

    @himanshupathak95
    ContributorAuthor

    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.

  2. t-hamano commented on Feb 10, 2025

    @t-hamano
    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.

  3. t-hamano commented on Feb 20, 2025

    @t-hamano
    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.

    @WordPress/gutenberg-components Regarding font sizes in mobile layouts, I would like to confirm if the 16px font size of the InputControl is intentional and still a valid design.

  4. ciampo commented on Feb 26, 2025

    @ciampo
    Contributor

    We don't currently have the capacity to investigate deeply, but as you also mentioned, it seems like the 16px size was intentional.

    I imagine this would warrant some investigation from @WordPress/gutenberg-design too, although I'm not sure they'll have capacity either.

  5. mirka commented on Feb 28, 2025

    @mirka
    Member

    Yes, this is a widely-used technique to avoid zoom on focus in iOS Safari, and is still relevant. We could potentially talk about visual consistency across components, but I believe that discussion would be whether or not we should upsize all control component font sizes to 16px on mobile, rather than removing the 16px rule.

  6. t-hamano commented on Mar 2, 2025

    @t-hamano
    Contributor

    Thanks everyone for your feedback! Let's close this issue.

    discussion would be whether or not we should upsize all control component font sizes to 16px on mobile, rather than removing the 16px rule.

    @himanshupathak95 If this discussion is necessary, let's submit a new issue.

  7. removed
    [Type] BugAn existing feature does not function as intended
    on Mar 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions