From 17b13d9fe9e7836e14a3a27ff1482ec668e12756 Mon Sep 17 00:00:00 2001 From: Joen Asmussen Date: Wed, 28 Jun 2017 11:40:22 +0200 Subject: [PATCH] Crop gallery images by default This is a work in progress. Pushing so as to test in IE. --- blocks/library/gallery/style.scss | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/blocks/library/gallery/style.scss b/blocks/library/gallery/style.scss index c72bc95052d7c8..32205ef47ab60d 100644 --- a/blocks/library/gallery/style.scss +++ b/blocks/library/gallery/style.scss @@ -5,9 +5,29 @@ &:not( .components-placeholder ) { margin-right: -16px; - margin-bottom: -16px; + margin-bottom: -16px; } + // Cropped by default + .blocks-gallery-image { + flex-grow: 1; + margin: 0 16px 16px 0; + + img { + width: 100%; + height: 100%; + object-fit: cover; + } + + // IE10+ hack + _:-ms-lang(x), img { + height: auto; + width: auto; + } + } + + /* + // Uncropped .blocks-gallery-image { flex-grow: 1; margin: 0 16px 16px 0; @@ -16,6 +36,7 @@ max-width: 100%; } } + */ &.columns-1 figure { width: calc(100% / 1 - 2 * 8px);