From e17f606d2b114704fdd7d9b9435d091445c6863a Mon Sep 17 00:00:00 2001
From: alexisben <alex@noesya.coop>
Date: Mon, 28 Nov 2022 17:53:17 +0100
Subject: [PATCH] fix image height

---
 assets/sass/_theme/_configuration.sass       |  4 ++++
 assets/sass/_theme/blocks/image.sass         | 10 ++++------
 assets/sass/_theme/blocks/video.sass         |  3 ---
 layouts/partials/blocks/templates/image.html |  2 +-
 4 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/assets/sass/_theme/_configuration.sass b/assets/sass/_theme/_configuration.sass
index 546df910..9d9bfe09 100644
--- a/assets/sass/_theme/_configuration.sass
+++ b/assets/sass/_theme/_configuration.sass
@@ -290,6 +290,10 @@ $block-key_figures-number-font-size-xxl: px2rem(80) !default
 // Block gallery
 $block-gallery-carousel-background: $color-background-alt
 
+// Block image
+$block-image-max-height-with-sidebar: calc(100vh - var(--header-height)) !default
+$block-image-max-height-without-sidebar: none !default
+
 // Sections
 $article-title-size: $h4-size !default
 $article-title-size-md: $h4-size-md !default
diff --git a/assets/sass/_theme/blocks/image.sass b/assets/sass/_theme/blocks/image.sass
index d665ef01..9e8342e3 100644
--- a/assets/sass/_theme/blocks/image.sass
+++ b/assets/sass/_theme/blocks/image.sass
@@ -18,14 +18,13 @@
         margin-left: calc(-#{$grid-gutter-sm} / 2)
         margin-right: calc(-#{$grid-gutter-sm} / 2)
 
-
     @include in-page-with-sidebar
         @include media-breakpoint-up(md)
             picture
                 margin-left: 0
                 margin-right: -$grid-gutter
             img
-                max-height: calc(100vh - var(--header-height))
+                max-height: $block-image-max-height-with-sidebar
                 width: auto
     @include in-page-without-sidebar
         @include media-breakpoint-up(md)
@@ -44,10 +43,9 @@
                     order: 2
                 picture
                     margin-left: 0
-                    margin-right: -$grid-gutter
-                    // text-align: right
-                    // img
-                    //     display: inline
+                    margin-right: -$grid-gutterxz
+                    img
+                        max-height: $block-image-max-height-without-sidebar
                 figcaption
                     width: calc(#{col(5)} + #{$grid-gutter} / 2)
                     order: 1
diff --git a/assets/sass/_theme/blocks/video.sass b/assets/sass/_theme/blocks/video.sass
index 83ca5396..28353262 100644
--- a/assets/sass/_theme/blocks/video.sass
+++ b/assets/sass/_theme/blocks/video.sass
@@ -1,5 +1,3 @@
-/* TODO : https://developer.mozilla.org/fr/docs/Web/HTML/Element/details */
-
 .block-video
     .video
         @include aspect-ratio(16/9, 'iframe')
@@ -13,4 +11,3 @@
         .video
             margin-left: calc(-#{$grid-gutter-sm} / 2)
             margin-right: calc(-#{$grid-gutter-sm} / 2)
-
diff --git a/layouts/partials/blocks/templates/image.html b/layouts/partials/blocks/templates/image.html
index 52b1b8a1..0d1532f4 100644
--- a/layouts/partials/blocks/templates/image.html
+++ b/layouts/partials/blocks/templates/image.html
@@ -36,7 +36,7 @@
                   "alt"      .alt
                   "mobile"   "480x850"
                   "tablet"   "768x1360"
-                  "desktop"  "1024x1820"
+                  "desktop"  "1400x1820"
                 )}}
             </a>
             <figcaption>
-- 
GitLab