Skip to content

Commit

Permalink
Merge pull request #2228 from alphagov/checkboxes-ie8
Browse files Browse the repository at this point in the history
Fix display of checkboxes in Internet Explorer 8
  • Loading branch information
36degrees authored May 17, 2021
2 parents 47ca4e9 + 7d046a0 commit c14d6c9
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 36 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Fixes

- [#2228: Fix display of checkboxes in Internet Explorer 8](https://github.com/alphagov/govuk-frontend/pull/2228)

## 3.12.0 (Feature release)

### New features
Expand Down
74 changes: 38 additions & 36 deletions src/govuk/components/checkboxes/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -72,43 +72,45 @@
touch-action: manipulation;
}

// [ ] Check box
.govuk-checkboxes__label:before {
content: "";
box-sizing: border-box;
position: absolute;
top: 0;
left: 0;
width: $govuk-checkboxes-size;
height: $govuk-checkboxes-size;
border: $govuk-border-width-form-element solid currentColor;
background: transparent;
}
@include govuk-not-ie8 {
// [ ] Check box
.govuk-checkboxes__label:before {
content: "";
box-sizing: border-box;
position: absolute;
top: 0;
left: 0;
width: $govuk-checkboxes-size;
height: $govuk-checkboxes-size;
border: $govuk-border-width-form-element solid currentColor;
background: transparent;
}

// ✔ Check mark
//
// The check mark is a box with a border on the left and bottom side (└──),
// rotated 45 degrees
.govuk-checkboxes__label:after {
content: "";
box-sizing: border-box;

position: absolute;
top: 11px;
left: 9px;
width: 23px;
height: 12px;

transform: rotate(-45deg);
border: solid;
border-width: 0 0 5px 5px;
// Fix bug in IE11 caused by transform rotate (-45deg).
// See: alphagov/govuk_elements/issues/518
border-top-color: transparent;

// ✔ Check mark
//
// The check mark is a box with a border on the left and bottom side (└──),
// rotated 45 degrees
.govuk-checkboxes__label:after {
content: "";
box-sizing: border-box;

position: absolute;
top: 11px;
left: 9px;
width: 23px;
height: 12px;

transform: rotate(-45deg);
border: solid;
border-width: 0 0 5px 5px;
// Fix bug in IE11 caused by transform rotate (-45deg).
// See: alphagov/govuk_elements/issues/518
border-top-color: transparent;

opacity: 0;

background: transparent;
opacity: 0;

background: transparent;
}
}

.govuk-checkboxes__hint {
Expand Down

0 comments on commit c14d6c9

Please sign in to comment.