Skip to content

Commit

Permalink
Fix issues with gallery in IE11. (#7465)
Browse files Browse the repository at this point in the history
IE 11 is a horrendous browser, and its support for flexbox is equally horrendous.

Galleries, as a result, had crazy stretched images. This PR fixes that.
  • Loading branch information
jasmussen committed Jun 22, 2018
1 parent c4b1362 commit 58c96ee
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
11 changes: 11 additions & 0 deletions core-blocks/gallery/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,14 @@
left: 50%;
transform: translate( -50%, -50% );
}

// IE11 doesn't support object-fit or flex very well, so we inline-block.
@media all and ( -ms-high-contrast: none ) {
*::-ms-backdrop, .blocks-gallery-item {
display: inline-block;
}

*::-ms-backdrop, .blocks-gallery-item img {
width: 100%;
}
}
7 changes: 0 additions & 7 deletions core-blocks/gallery/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
justify-content: center;
position: relative;


figure {
margin: 0;
height: 100%;
Expand Down Expand Up @@ -53,12 +52,6 @@
object-fit: cover;

}

// Alas, IE11+ doesn't support object-fit
_:-ms-lang(x), figure {
height: auto;
width: auto;
}
}

// Responsive fallback value, 2 columns
Expand Down

0 comments on commit 58c96ee

Please sign in to comment.