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 legend text wrapping in IE. #248

Merged
merged 1 commit into from
Jun 9, 2016

Conversation

jonhurrell
Copy link

IE9-11 and Edge 12-13 can be completely fixed using box-sizing: border-box; max-width: 100%, but IE8 will still experience some issues as “the min-width property applies to content-box even if box-sizing is set to border-box” cite.
IE8-11 can be fixed using the 456 Berea St fix display: table; white-space: normal, but this fix will not work at all for Edge 12-13.

IE9-11 and Edge 12-13 can be completely fixed using box-sizing: border-box; max-width: 100%, but IE8 will still experience some issues as “the min-width property applies to content-box even if box-sizing is set to border-box” cite.
IE8-11 can be fixed using the 456 Berea St fix display: table; white-space: normal, but this fix will not work at all for Edge 12-13.
@robinwhittleton
Copy link
Contributor

We have a legend style override in https://github.com/alphagov/govuk_elements/blob/master/public/sass/elements/_forms.scss#L22 already. Presumably this code would be better placed there? Also, can you link to a page on 456berastreet in the commit?

@gemmaleigh
Copy link
Contributor

I think it should sit in the reset stylesheet.

I need to test this (which is why it hasn't been merged yet), ideally L22 from forms.scss would be moved into the reset stylesheet too (or removed if not required).

I'll investigate later today.

@jonhurrell
Copy link
Author

I'd place it as a reset, it's included in normalize.
@robinwhittleton How to line wrap text in legend elements, even in IE

@gemmaleigh
Copy link
Contributor

I think it really helps to see screenshots with fixes like this.

Here's a screenshot before:

Win10 Edge 13
win10_edge_13 0

Here's what Normalize uses to fix text wrapping in Edge and IE

legend {
  box-sizing: border-box; /* 1 */
  color: inherit; /* 2 */
  display: table; /* 1 */
  max-width: 100%; /* 1 */
  padding: 0; /* 3 */
  white-space: normal; /* 1 */
}

Here's a screenshot after:

Win10 Edge13
win10_edge_13 0

@gemmaleigh gemmaleigh merged commit 1eb4c11 into alphagov:master Jun 9, 2016
gemmaleigh added a commit that referenced this pull request Aug 4, 2016
- Bump govuk frontend toolkit to 4.14.4 (PR #278)
- Add a .column-full class (PR #270)
- Add a file upload example (PR #268)
- Remove the blue outline from the main content area (PR #265)
- Fix legend text wrapping in IE (PR #248)
@gemmaleigh gemmaleigh mentioned this pull request Aug 4, 2016
robinwhittleton pushed a commit to alphagov/verify-frontend that referenced this pull request Aug 5, 2016
govuk_frontend_toolkit fixes a potential bug with tabular numbers (alphagov/govuk_frontend_toolkit#301).
govuk_elements fixes a potential bug with legend styling in IE (alphagov/govuk_elements#248).

Authors: @robinwhittleton
gemmaleigh added a commit that referenced this pull request Sep 12, 2016
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.

3 participants