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

Fix text resize issue with warning text icon #1584

Merged
merged 2 commits into from
Sep 20, 2019
Merged

Conversation

36degrees
Copy link
Contributor

@36degrees 36degrees commented Sep 20, 2019

The font size of the exclamation mark within the warning text component is currently specified as 1.6 em, within a 19px context which means that the calculated font-size is 30.4px.

Because the height and width of the circle the exclamation mark sits within are specified in px, the exclamation mark increases in size when the page is zoomed text-only, whilst the circle does not. This results in the mark overflowing outside of the circle.

Specifying the font-size in px solves this problem. Whilst the icon is used to add emphasis, the text is also inset and bold, so we can treat it as presentational.

In Safari, the exclamation mark actually ends up slightly larger, but is still contained entirely within the circle.

Browser Before After
Chrome Chrome Before Chrome After
Firefox FF Before FF After
Safari Safari Before Safari After
IE IE Before IE After

Fixes #1569

@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-1584 September 20, 2019 15:12 Inactive
The font size of the exclamation mark within the warning text component is currently specified as 1.6 em, within a 19px context which means that the calculated font-size is 30.4px.

Because the height and width of the circle the exclamation mark sits within are specified in px, the exclamation mark increases in size when the page is zoomed text-only, whilst the circle does not. This results in the mark overflowing outside of the circle.

Specifying the font-size in px solves this problem. Whilst the icon is used to add emphasis, the text is also inset and bold, so we can treat it as presentational.

In Safari, the exclamation mark actually ends up slightly larger, but is still contained entirely within the circle.
Copy link
Contributor

@NickColley NickColley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice and simple 👍

@NickColley NickColley added this to the Next milestone Sep 20, 2019
@36degrees 36degrees merged commit c764384 into master Sep 20, 2019
@36degrees 36degrees deleted the warning-text-resize branch September 20, 2019 15:52
@36degrees 36degrees mentioned this pull request Oct 7, 2019
@NickColley NickColley mentioned this pull request Oct 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

Icons don't resize with text
3 participants