From f112ccc8035741a1158a3341f3a8fea1422e5377 Mon Sep 17 00:00:00 2001 From: danix Date: Fri, 17 Mar 2023 12:11:31 +0100 Subject: [PATCH] fixed images display inside a figure element, aka when not inside a gallery. --- assets/sass/components/_image.scss | 17 +++++++++++++++-- layouts/shortcodes/img.html | 5 +++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/assets/sass/components/_image.scss b/assets/sass/components/_image.scss index 6052089..67f156c 100644 --- a/assets/sass/components/_image.scss +++ b/assets/sass/components/_image.scss @@ -46,12 +46,16 @@ &.fit { display: block; - margin: 0 0 _size(element-margin) 0; - width: 100%; + margin: 0 auto _size(element-margin); + width: 90%; img { width: 100%; } + div.picture { + max-width: 100%; + height: auto; + } } &.main { @@ -61,6 +65,11 @@ img { width: 100%; + max-width: 100%; + } + div.picture { + max-width: 100%; + height: auto; } @include breakpoint('<=small') { @@ -147,4 +156,8 @@ overflow: hidden; } } + } + + div.picture { + display: inline-block; } \ No newline at end of file diff --git a/layouts/shortcodes/img.html b/layouts/shortcodes/img.html index d4159be..f5f29ca 100644 --- a/layouts/shortcodes/img.html +++ b/layouts/shortcodes/img.html @@ -14,7 +14,7 @@ for that, and then fade in for the LQIP effect. Feel free to adjust your CSS/SCSS as desired. */}} -{{- $imgClass := "w-full h-auto animate-fade" -}} +{{- $imgClass := "animate-fade" -}} {{- $dataSzes := "(min-width: 1024px) 100vw, 50vw" -}} {{/* Now we'll create the 20-pixel-wide LQIP @@ -74,7 +74,8 @@ /> {{ $alt }} -- 2.20.1