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 display of warning text icon when border-box box sizing is applied globally #1862

Merged
merged 2 commits into from
Jul 16, 2020

Conversation

36degrees
Copy link
Contributor

@36degrees 36degrees commented Jul 15, 2020

If a user applies a global box-sizing reset, the warning text icon is 'squished' horizontally as the border is 'accounted for' within the 29px min-width.

Explicitly use border-box sizing, as this means that the min-width reflects the actual desired width of the icon, rather than having to factor the border width in separately. As the box-sizing model is now set explicitly, it should display correctly whether the reset is applied or not.

Increase the min-width and min-height of the icon to include the border (3px border * 2 in each direction = 6px).

Fixes #1810

Before

localhost_3000_components_warning-text_preview (2)

After

localhost_3000_components_warning-text_preview (1)

@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-1862 July 15, 2020 12:41 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-1862 July 15, 2020 12:47 Inactive
If a user applies a global box-sizing reset [1], the warning text icon is 'squished' horizontally as the border is 'accounted for' within the 29px min-width.

Explicitly use border-box sizing, as this means that the min-width reflects the actual desired width of the icon, rather than having to factor the border width in separately. As the box-sizing model is now set explicitly, it should display correctly whether the reset is applied or not.

Increase the min-width and min-height of the icon to include the border (3px border * 2 in each direction = 6px).

[1]: https://css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Warning text icon is squashed with box-sizing: border-box.
3 participants