diff --git a/assets/sass/_theme/blocks/chapter.sass b/assets/sass/_theme/blocks/chapter.sass index 9bab2d3e6e94a9cb5ec3de68fedebba9688c4915..43a0a5fc4e987c2dc3c17cd3aa47da4a9342cb02 100644 --- a/assets/sass/_theme/blocks/chapter.sass +++ b/assets/sass/_theme/blocks/chapter.sass @@ -5,7 +5,7 @@ margin-top: $spacing1 * @include small - picture + picture, img display: block figcaption @include small @@ -15,7 +15,7 @@ display: flex .text order: 2 - figure + figcaption margin-bottom: $spacing1 &--alt_background background: $block-chapter-layout-alt-background @@ -27,13 +27,16 @@ color: $block-chapter-layout-accent-color a @include link($block-chapter-layout-accent-color) - @include media-breakpoint-down(desktop) &--with-image &.block-chapter--alt_background, &.block-chapter--accent_background padding-top: half($grid-gutter-sm) @include media-breakpoint-up(desktop) @include in-page-with-sidebar + figure + max-width: col(6, 8) + &.image-portrait + max-width: col(4, 8) &--alt_background, &--accent_background background: none .chapter .text diff --git a/layouts/partials/blocks/templates/chapter.html b/layouts/partials/blocks/templates/chapter.html index b8075a6f16055b4401f3b5e98036e9ded106051d..9a72217dc5fccf4a5c9013cde1e0f018a4569893 100644 --- a/layouts/partials/blocks/templates/chapter.html +++ b/layouts/partials/blocks/templates/chapter.html @@ -3,9 +3,11 @@ {{- $title := .block.title -}} {{- $layout := .block.data.layout | default "no_background" -}} {{- $class := "block block-chapter" -}} +{{- $image_class := "" -}} {{- with .block.data -}} {{ if .image }} {{- $class = printf "%s block-chapter--with-image" $class -}} + {{- $image_class = printf "image-%s" (partial "GetImageDirection" .image) -}} {{ end }} {{- $layout_class := printf "block-chapter--%s" $layout -}} {{- $class = printf "%s %s" $class $layout_class -}} @@ -36,7 +38,7 @@ {{ end -}} </div> {{ if .image }} - <figure> + <figure class="{{- $image_class -}}"> {{ partial "commons/image.html" (dict "image" .image