From 9aaa0cabc80fbf3278a664e4cea987fbaab4c80c Mon Sep 17 00:00:00 2001 From: alexisben <alex@noesya.coop> Date: Fri, 24 Feb 2023 11:56:37 +0100 Subject: [PATCH] fix mobile figcaption --- assets/sass/_theme/_utils.sass | 9 +++++++++ assets/sass/_theme/design-system/hero.sass | 7 ++++--- layouts/partials/header/hero.html | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/assets/sass/_theme/_utils.sass b/assets/sass/_theme/_utils.sass index e00c827b..35172dc7 100644 --- a/assets/sass/_theme/_utils.sass +++ b/assets/sass/_theme/_utils.sass @@ -368,6 +368,15 @@ @include media-breakpoint-up(desktop) &:before padding-right: 0 + @include media-breakpoint-down(desktop) + position: relative + background: $color-background + &::before + background: transparent + p + display: block + background: transparent + position: relative &:hover figcaption p diff --git a/assets/sass/_theme/design-system/hero.sass b/assets/sass/_theme/design-system/hero.sass index 6ca0cf94..28833f74 100644 --- a/assets/sass/_theme/design-system/hero.sass +++ b/assets/sass/_theme/design-system/hero.sass @@ -48,9 +48,10 @@ > h1, > hgroup margin-bottom: $spacing2 &--image-landscape - figure - margin-left: half(-$grid-gutter-sm) - margin-right: half(-$grid-gutter-sm) + .content + figure + margin-left: half(-$grid-gutter-sm) + margin-right: half(-$grid-gutter-sm) &--image-portrait, &--image-square .container display: flex diff --git a/layouts/partials/header/hero.html b/layouts/partials/header/hero.html index df099f4f..cb14b4bc 100644 --- a/layouts/partials/header/hero.html +++ b/layouts/partials/header/hero.html @@ -33,7 +33,7 @@ "sizes" ( .sizes | default site.Params.image_sizes.design_system.hero ) "lazy" false ) }} - {{ if .image.credit }} + {{ if partial "GetTextFromHTML" .image.credit }} <figcaption tabindex="0"> <p> {{- partial "GetTextFromHTML" .image.credit -}} -- GitLab