Form elements do not scale well if only font size increased
See original GitHub issueIf you zoom text only
in Firefox, select elements retain their 40px height but the text within them becomes larger and therefore cropped from the bottom edge.
Doesn’t seem to be as much of a problem for text inputs.
Can’t reproduce the problem in Chrome because the zoom text only option isn’t available.
Noticed this during user testing on a phone of GOV.UK’s search, specifically where we have select elements in finders.
(can’t remember what kind but possibly an iPhone 7?)
Side note: doing this on the Design System site causes the currently active menu item to be crossed out instead of underlined:
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (11 by maintainers)
Top Results From Across the Web
css - Font scaling based on width of container - Stack Overflow
My reasoning is that things like my menu become squished when you resize, so I need to reduce the px font-size of .menuItem...
Read more >C17: Scaling form elements which contain text - W3C
The objective of this technique is to ensure text-based form controls resize when text size is changed in the user agent. This will...
Read more >font-size | CSS-Tricks
The font-size property specifies the size, or height, of the font. font-size affects not only the font to which it is applied, but...
Read more >font-size - CSS: Cascading Style Sheets - MDN Web Docs
The font-size CSS property sets the size of the font. Changing the font size also updates the sizes of the font size-relative <length>...
Read more >How to Override Root Font Size to Create a Better User ...
So if we try to convert px values into rem, we'll need to do some math. Suppose we want to set the font-size...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It looks like this can affect text inputs, but only at extreme values (I had to modify the values for
toolkit.zoomManager.zoomValues
andzoom.maxPercent
in Firefox’sabout:config
to do this):We’d probably also want to scale text inputs and buttons at the same time to ensure that they remain aligned – so I’m going to rename this to ‘form inputs do not scale well…’.
The main issue with ‘em’ and ‘rem’ when using it with the legacy GOV.UK Template is that GOV.UK Template messes with the root font size, which is likely what you’re seeing.