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 container not being centered in IE8 #1147

Merged
merged 2 commits into from
Jan 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@

([PR #1148](https://github.com/alphagov/govuk-frontend/pull/1148))

- Fix container not being centered in IE8

Since the header and the footer component use this container it also fixes centering for these components.

([PR #1147](https://github.com/alphagov/govuk-frontend/pull/1147))

## 2.5.1 (Fix release)

🔧 Fixes:
Expand Down
11 changes: 7 additions & 4 deletions src/objects/_width-container.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
// Limit the width of the container to the page width
max-width: $govuk-page-width;

@include govuk-if-ie8 {
width: $govuk-page-width;
}

// On mobile, add half width gutters
margin: 0 $govuk-gutter-half;

Expand All @@ -19,6 +15,13 @@
@include govuk-media-query($and: "(min-width: #{($govuk-page-width + $govuk-gutter * 2)})") {
margin: 0 auto;
}

@include govuk-if-ie8 {
width: $govuk-page-width;
// Since media queries are not supported in IE8,
// we need to duplicate this margin that centers the page.
margin: 0 auto;
}
}

@include govuk-exports("govuk/objects/width-container") {
Expand Down