From b31b5ec1380d9f6b94712b6d0069268bc820f06f Mon Sep 17 00:00:00 2001 From: Olivia206 <olivia.simonet206@gmail.com> Date: Wed, 6 Mar 2024 14:45:56 +0100 Subject: [PATCH] =?UTF-8?q?added=20sizes=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/sass/_theme/_configuration.sass | 1 + assets/sass/_theme/blocks/key_figures.sass | 1 + config.yaml | 4 ++++ layouts/partials/blocks/templates/key_figures.html | 6 +++++- 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/assets/sass/_theme/_configuration.sass b/assets/sass/_theme/_configuration.sass index 368097c6..cffca514 100644 --- a/assets/sass/_theme/_configuration.sass +++ b/assets/sass/_theme/_configuration.sass @@ -433,6 +433,7 @@ $block-testimonials-pagination-progress-background: var(--color-accent) !default $block-key_figures-number-font-family: $heading-font-family !default $block-key_figures-unit-font-weight: normal !default $block-key_figures-number-font-weight: bold !default +$block-key_figures-image-max-width: $spacing-6 !default $block-key_figures-font-size: pxToRem(16) !default $block-key_figures-number-font-size: pxToRem(32) !default diff --git a/assets/sass/_theme/blocks/key_figures.sass b/assets/sass/_theme/blocks/key_figures.sass index 5efdb775..64126a16 100644 --- a/assets/sass/_theme/blocks/key_figures.sass +++ b/assets/sass/_theme/blocks/key_figures.sass @@ -29,6 +29,7 @@ img display: block margin-bottom: $spacing-2 + max-width: $block-key_figures-image-max-width @include media-breakpoint-up(desktop) font-size: $block-key_figures-font-size-desktop strong diff --git a/config.yaml b/config.yaml index 7540ffe1..11d2b05d 100644 --- a/config.yaml +++ b/config.yaml @@ -126,6 +126,10 @@ params: mobile: 350 tablet: 400 desktop: 750 + key_figures: + mobile: 100 + tablet: 100 + desktop: 150 image: mobile: 480x850 tablet: 768x1360 diff --git a/layouts/partials/blocks/templates/key_figures.html b/layouts/partials/blocks/templates/key_figures.html index ed0cea5a..33470c53 100644 --- a/layouts/partials/blocks/templates/key_figures.html +++ b/layouts/partials/blocks/templates/key_figures.html @@ -23,7 +23,11 @@ <dl> <dt> {{ with .image }} - {{ partial "commons/image.html" (dict "image" .) }} + {{ partial "commons/image.html" + (dict + "image" . + "sizes" site.Params.image_sizes.blocks.key_figures + )}} {{ end }} <strong>{{ .number }}</strong>{{ partial "PrepareHTML" .unit }} </dt> -- GitLab