Skip to content

Commit

Permalink
Merge pull request #1147 from alphagov/fix-centering-container-ie8
Browse files Browse the repository at this point in the history
Fix container not being centered in IE8
  • Loading branch information
NickColley authored Jan 17, 2019
2 parents 9a11120 + 52f3ac5 commit 0730e73
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
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

0 comments on commit 0730e73

Please sign in to comment.