-
Notifications
You must be signed in to change notification settings - Fork 327
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
Prevent panel text overflowing when zoomed in on mobile #2347
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
govuk-design-system-ci
temporarily deployed
to
govuk-frontend-pr-2347
September 14, 2021 10:56
Inactive
36degrees
reviewed
Sep 15, 2021
hannalaakso
force-pushed
the
fix-panel-text-resized
branch
from
September 16, 2021 18:11
7083b44
to
2d374d3
Compare
govuk-design-system-ci
temporarily deployed
to
govuk-frontend-pr-2347
September 16, 2021 18:11
Inactive
hannalaakso
force-pushed
the
fix-panel-text-resized
branch
from
September 23, 2021 12:30
2d374d3
to
8de54e3
Compare
govuk-design-system-ci
temporarily deployed
to
govuk-frontend-pr-2347
September 23, 2021 12:30
Inactive
hannalaakso
changed the title
Fix panel text being clipped when zooming on mobile
Fix panel text overflowing on mobile
Sep 23, 2021
hannalaakso
added a commit
that referenced
this pull request
Sep 23, 2021
What the problem is Prevent text in the panel component from overflowing on mobile zoom. This overflowing is more likely to happen when user increases text size on a mobile eg. using iOS Safari text resize controls. The overflowing is a particular problem with the panel component since it uses white text. When the text overflows the container, it is invisible on the white (page) background. When the text in our other components overflow, the user might have to scroll horizontally to view it but the the text remains legible. We should aim to meet the WCAG Text resize Success criterion which requires that text can be scaled up to 200%. How this fixes it Decrease the padding on mobile to allow the text flow better. As an if-all-else-fails attempt to stop very long words from clipping, force them to break and wrap instead. Hopefully this is not something that would happen often since we’re reducing the padding to help with this. We additionally considered reducing the font size of the heading on a mobile to avoid the text wrapping at very narrow viewports. However, the `govuk-font` mixin uses the responsive font scale which fixes font sizes for different breakpoints to make components behave consistently. There currently isn’t a way to override those set font sizes for `govuk-font`. Since the other fixes in this commit go a long way towards solving this issue and we haven’t come across this requirement with our other components so far, we’re hesitant to add such new feature to `govuk-font` at this point, but we’ll keep an eye out for similar requirements in the future. We also considered progressively enhancing any words that wrap by using `hyphens: auto` to hyphenate them. However, we found that iOS Safari can omit the dash from some words but not others, or hyphenating unnecessarily; it seems that it would be introducing more issues than it would be solving. See #2347 for more details.
hannalaakso
force-pushed
the
fix-panel-text-resized
branch
from
September 23, 2021 14:45
8de54e3
to
cbe2b86
Compare
govuk-design-system-ci
temporarily deployed
to
govuk-frontend-pr-2347
September 23, 2021 14:45
Inactive
36degrees
approved these changes
Sep 27, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs a changelog entry, but otherwise looks good to me! 👏🏻
Although I think the PR description needs updating now that we're no longer using
|
What the problem is Prevent text in the panel component from overflowing on mobile zoom. This overflowing is more likely to happen when user increases text size on a mobile eg. using iOS Safari text resize controls. The overflowing is a particular problem with the panel component since it uses white text. When the text overflows the container, it is invisible on the white (page) background. When the text in our other components overflow, the user might have to scroll horizontally to view it but the the text remains legible. We should aim to meet the WCAG Text resize Success criterion which requires that text can be scaled up to 200%. How this fixes it Decrease the padding on mobile to allow the text flow better. As an if-all-else-fails attempt to stop very long words from clipping, force them to break and wrap instead. Hopefully this is not something that would happen often since we’re reducing the padding to help with this. We additionally considered reducing the font size of the heading on a mobile to avoid the text wrapping at very narrow viewports. However, the `govuk-font` mixin uses the responsive font scale which fixes font sizes for different breakpoints to make components behave consistently. There currently isn’t a way to override those set font sizes for `govuk-font`. Since the other fixes in this commit go a long way towards solving this issue and we haven’t come across this requirement with our other components so far, we’re hesitant to add such new feature to `govuk-font` at this point, but we’ll keep an eye out for similar requirements in the future. We also considered progressively enhancing any words that wrap by using `hyphens: auto` to hyphenate them. However, we found that iOS Safari can omit the dash from some words but not others, or hyphenating unnecessarily; it seems that it would be introducing more issues than it would be solving. See #2347 for more details.
hannalaakso
changed the title
Fix panel text overflowing on mobile
Fix panel text overflowing on mobile zoom
Sep 27, 2021
hannalaakso
changed the title
Fix panel text overflowing on mobile zoom
Fix panel text overflowing when zoomed in on mobile
Sep 27, 2021
hannalaakso
force-pushed
the
fix-panel-text-resized
branch
from
September 27, 2021 09:26
cbe2b86
to
d3fe242
Compare
govuk-design-system-ci
temporarily deployed
to
govuk-frontend-pr-2347
September 27, 2021 09:26
Inactive
1 task
vanitabarrett
pushed a commit
that referenced
this pull request
Sep 27, 2021
What the problem is Prevent text in the panel component from overflowing on mobile zoom. This overflowing is more likely to happen when user increases text size on a mobile eg. using iOS Safari text resize controls. The overflowing is a particular problem with the panel component since it uses white text. When the text overflows the container, it is invisible on the white (page) background. When the text in our other components overflow, the user might have to scroll horizontally to view it but the the text remains legible. We should aim to meet the WCAG Text resize Success criterion which requires that text can be scaled up to 200%. How this fixes it Decrease the padding on mobile to allow the text flow better. As an if-all-else-fails attempt to stop very long words from clipping, force them to break and wrap instead. Hopefully this is not something that would happen often since we’re reducing the padding to help with this. We additionally considered reducing the font size of the heading on a mobile to avoid the text wrapping at very narrow viewports. However, the `govuk-font` mixin uses the responsive font scale which fixes font sizes for different breakpoints to make components behave consistently. There currently isn’t a way to override those set font sizes for `govuk-font`. Since the other fixes in this commit go a long way towards solving this issue and we haven’t come across this requirement with our other components so far, we’re hesitant to add such new feature to `govuk-font` at this point, but we’ll keep an eye out for similar requirements in the future. We also considered progressively enhancing any words that wrap by using `hyphens: auto` to hyphenate them. However, we found that iOS Safari can omit the dash from some words but not others, or hyphenating unnecessarily; it seems that it would be introducing more issues than it would be solving. See #2347 for more details.
This was referenced Sep 27, 2021
vanitabarrett
pushed a commit
that referenced
this pull request
Sep 28, 2021
What the problem is Prevent text in the panel component from overflowing on mobile zoom. This overflowing is more likely to happen when user increases text size on a mobile eg. using iOS Safari text resize controls. The overflowing is a particular problem with the panel component since it uses white text. When the text overflows the container, it is invisible on the white (page) background. When the text in our other components overflow, the user might have to scroll horizontally to view it but the the text remains legible. We should aim to meet the WCAG Text resize Success criterion which requires that text can be scaled up to 200%. How this fixes it Decrease the padding on mobile to allow the text flow better. As an if-all-else-fails attempt to stop very long words from clipping, force them to break and wrap instead. Hopefully this is not something that would happen often since we’re reducing the padding to help with this. We additionally considered reducing the font size of the heading on a mobile to avoid the text wrapping at very narrow viewports. However, the `govuk-font` mixin uses the responsive font scale which fixes font sizes for different breakpoints to make components behave consistently. There currently isn’t a way to override those set font sizes for `govuk-font`. Since the other fixes in this commit go a long way towards solving this issue and we haven’t come across this requirement with our other components so far, we’re hesitant to add such new feature to `govuk-font` at this point, but we’ll keep an eye out for similar requirements in the future. We also considered progressively enhancing any words that wrap by using `hyphens: auto` to hyphenate them. However, we found that iOS Safari can omit the dash from some words but not others, or hyphenating unnecessarily; it seems that it would be introducing more issues than it would be solving. See #2347 for more details.
EoinShaughnessy
changed the title
Fix panel text overflowing when zoomed in on mobile
Prevent panel text overflowing when zoomed in on mobile
Sep 29, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As discussed in #2173, the panel heading text can overflow its container when a user increases text size on a mobile eg. using iOS Safari text resize controls. The overflowing is a particular problem with the panel component since it uses white text. When the text overflows the container, it is invisible on the white (page) background. When the text in our other components overflow, the user might have to scroll horizontally to view it but the the text remains legible.
We should aim to meet the WCAG Text resize Success criterion which requires that
How we fix this
To help fix this, this PR:
Possible future improvements
We additionally considered reducing the font size of the heading on a mobile to avoid the text wrapping at very narrow viewports. However, the
govuk-font
mixin uses the responsive font size map which fixes font sizes for different breakpoints to make our components behave consistently. There currently isn’t a way to override those set font sizes forgovuk-font
. Since the other fixes in this commit go a long way towards solving this issue and we haven’t come across this requirement with our other components so far, we’re hesitant to add this new feature togovuk-font
at this point, but we’ll keep an eye out for similar requirements in the future.We could consider adding something to the panel guidance about the need to keep the panel heading wording concise.
iOS 12 mini in Safari at 100% (no zoom)
Before
After
iOS 12 mini at 150% zoom
Before
After
iOS 12 mini at 200% zoom
Before
After
We decided not to hyphenate words that wrap
We also considered progressively enhancing any words that wrap by using
hyphens: auto
to hyphenate them but this seemed to potentially introduce more problems than it was solving. For instance, we found that iOS Safari can omit the dash from some words but not others, see below:iOS Safari can also hyphenate words unnecessarily, see below:
Fixes #2173