From 389fc172c29dba477c060a088307ead4f9b8ad35 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 | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/blocks/library/gallery/style.scss b/blocks/library/gallery/style.scss index b0f33ac630eb1c..8be5c70f8531d1 100644 --- a/blocks/library/gallery/style.scss +++ b/blocks/library/gallery/style.scss @@ -8,6 +8,26 @@ 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);