-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1110 from City-of-Helsinki/UHF-10239
UHF-10239 Image gallery paragraph
- Loading branch information
Showing
6 changed files
with
112 additions
and
1 deletion.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
.image-gallery { | ||
display: grid; | ||
gap: $spacing-double; | ||
grid-template-columns: repeat(1, 1fr); | ||
|
||
@include breakpoint($breakpoint-s) { | ||
grid-template-columns: repeat(2, 1fr); | ||
} | ||
|
||
@include breakpoint($breakpoint-l) { | ||
grid-template-columns: repeat(3, 1fr); | ||
} | ||
} | ||
|
||
.node--type-page, | ||
.service--full, | ||
.unit--full, | ||
.node--type-district, | ||
.node--type-news-article { | ||
.components--upper .image-gallery{ | ||
@include breakpoint($breakpoint-s) { | ||
grid-template-columns: repeat(2, 1fr); | ||
} | ||
} | ||
} | ||
|
||
.image-gallery__item-image { | ||
overflow: hidden; | ||
position: relative; | ||
width: 100%; | ||
|
||
img { | ||
@include image-defaults($height: 100%, $width: 100%, $max-width: null); | ||
} | ||
} | ||
|
||
.image-gallery__item-meta { | ||
margin-top: $spacing-half; | ||
} |
10 changes: 10 additions & 0 deletions
10
templates/paragraphs/paragraph--image-gallery-item.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{% block paragraph %} | ||
<div class="image-gallery__item"> | ||
<div class="image-gallery__item-image"> | ||
{{content.field_gallery_image}} | ||
</div> | ||
<div class="image-gallery__item-meta"> | ||
{{ gallery_image_description }} | ||
</div> | ||
</div> | ||
{% endblock paragraph %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{% set ratio = content.field_image_gallery_ratio[0]['#markup']|replace({":": "-"}) %} | ||
|
||
{% block paragraph %} | ||
{% embed "@hdbt/misc/component.twig" with | ||
{ | ||
component_classes: [ 'component--image-gallery' ], | ||
component_title: content.field_image_gallery_title, | ||
component_description: content.field_image_gallery_description, | ||
component_content_class: [ | ||
'image-gallery', | ||
'image-gallery--' ~ ratio], | ||
} | ||
%} | ||
{% block component_content %} | ||
|
||
{{ content.field_gallery_item }} | ||
|
||
{% endblock component_content %} | ||
{% endembed %} | ||
{% endblock paragraph %} |