-
Notifications
You must be signed in to change notification settings - Fork 332
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
Form elements do not scale well if only font size increased #1519
Comments
This appears to be fixable by changing the height from using |
There seems to be some concern to nested font sizing: 5f4d20c But perhaps |
Interestingly on testing it seems |
Looks like the reason for that is the body font size isn't set in the component guide (?) - we might need to look into that. |
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. |
We do have ways to only use relative units when compatibility mode is not turned on that we could consider. |
It looks like this can affect text inputs, but only at extreme values (I had to modify the values for 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…'. |
I did some investigation... RequirementWCAG 2.1 requires that user can resize text to at least 200% . InputsCurrent behaviourChrome when text resized to 32 (16 x 2 = 200%)Chrome when text resized to 48Safari when text resized to 200%Firefox when text resized to 200%IE11 when text resized to LargestProblemWe set the height of inputs with
which constraints them from expanding beyond that when text is resized. Recommendation to fixSwap the SelectsCurrent behaviourChrome when text resized to 32 (16 x 2 = 200%)Chrome when text resized to 48Safari when text resized to 200%Firefox when text resized to 200%IE11 when text resized to LargestProblemAgain, we set the height of inputs with
which stops them from expanding beyond that when text is resized. Recommendation to fixThis is a tricky one because setting File inputsCurrent behaviourChrome when text resized to 32 (16 x 2 = 200%)Safari when text resized to 200%ProblemThis seems like a vendor issue with Chrome and Safari as the unstyled element has the same issue with overlapping text on larger font sizes. px vs rem and compatibility modeChrome and IE fail to resize text when it's set in px. Our compatibility mode sets all font sizes in px to play nice with GOV.UK Template which only uses px sizing and sets global styles on Other elementsI picked up on some related issues, raised here: Reference: How text was resized in browsersChromeSettings > Appearance > Customise fonts FirefoxSet View > Zoom > Zoom text only. Press +/- SafariTo increase the font size, press Option-Command-Plus sign (+) EdgeCan't resize text apart from "Reading view" which removes form elements from the view. IE 8-11Page > Text size > Largest iOSText can't resized in browser. See #882 Android Chrome/FirefoxSettings > Accessibility > Text scaling |
@hannalaakso nice investigation, did you explore what happens if you use |
@hannalaakso excellent investigation. I did a fix for our select component on GOV.UK for this issue where |
@andysellick I think we'd need to avoid using |
This was introduced in August 2019 [1] to mitigate an issue in GOV.UK Frontend where the height of a select component was set in pixels, which meant it did not scale if users changed the text size in their browser [2]. That issue was fixed in GOV.UK Frontend [3] and released as part of v3.3.0 [4] in October 2019. Since then the height of a select component has been set in rem (as long as compatibility mode is not enabled) which means this adjustment can be removed. [1]: #1018 [2]: alphagov/govuk-frontend#1519 [3]: alphagov/govuk-frontend#1574 [4]: https://github.com/alphagov/govuk-frontend/releases/tag/v3.3.0#:~:text=Pull%20request%20%231574%3A%20Make%20form%20elements%20scale%20correctly%20when%20text%20resized%20by%20user.
If 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:
The text was updated successfully, but these errors were encountered: