Skip to content

Commit dc33abc

Browse files
authored
Merge pull request #354 from torchbox/feature/twe-12-service-area-fe
TWE-12 | FE | Service area page
2 parents 0107666 + e5e41f8 commit dc33abc

File tree

6 files changed

+37
-16
lines changed

6 files changed

+37
-16
lines changed

tailwind.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ module.exports = {
2222
transparent: 'transparent',
2323
background: 'var(--color--background)',
2424
heading: 'var(--color--heading)',
25+
themePrimary: 'var(--color--theme-primary)',
2526
},
2627
screens: {
2728
sm: '410px',

tbx/project_styleguide/templates/patterns/_pattern_library_only/streamfield/service_area_story_container.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ tags:
88
raw: |
99
<img alt="" class="avatar__image" height="100" sizes="(max-width: 598px) 100px, (min-width: 599px) 145px" src="https://picsum.photos/100/100.webp" srcset="https://picsum.photos/100/100.webp 100w, https://picsum.photos/144/144.webp 144w, https://picsum.photos/286/286.webp 286w" width="100">
1010
# four_photo_collage_block.yaml
11-
item.image format-webp loading="lazy" fill-{100x100} alt=item.image.alt_text:
11+
'item.image format-webp loading="lazy" fill-{500x500,600x600} sizes="(max-width: 1022px) 600px, 500px" class="four-photo-collage__image" alt=item.alt_text':
1212
raw: |
13-
<img alt="" width="100" height="100" loading="lazy" sizes="100px" src="https://picsum.photos/100/100.webp" srcset="https://picsum.photos/100/100.webp 100w">
13+
<img alt="" width="500" height="500" loading="lazy" class="four-photo-collage__image" sizes="(max-width: 1022px) 600px, 500px" src="https://picsum.photos/500/500.webp" srcset="https://picsum.photos/500/500.webp 500w, https://picsum.photos/600/600.webp 600w">
1414
pageurl:
1515
# blog_chooser_block.yaml
1616
blog_page.blog_index as blog_index_url:

tbx/project_styleguide/templates/patterns/molecules/streamfield/blocks/four_photo_collage_block.html

+11-5
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,16 @@
1010
{% endfor %}
1111
</div>
1212
</div>
13-
{% if value.caption %}
14-
<div class="heading heading--three heading--light four-photo-collage__caption rich-text">{{ value.caption|richtext }}</div>
15-
{% endif %}
16-
{% if value.description %}
17-
{{ value.description|richtext }}
13+
{% if value.caption or value.description %}
14+
<div class="four-photo-collage__text">
15+
{% if value.caption %}
16+
<div class="rich-text heading heading--three heading--light mb-8">
17+
{{ value.caption|richtext }}
18+
</div>
19+
{% endif %}
20+
{% if value.description %}
21+
<div class="rich-text four-photo-collage__description">{{ value.description|richtext }}</div>
22+
{% endif %}
23+
</div>
1824
{% endif %}
1925
</div>

tbx/project_styleguide/templates/patterns/pages/service/service_area_page.html

+6-8
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
{% extends "patterns/base_page.html" %}
2-
{% load wagtailcore_tags wagtailimages_tags %}
2+
{% load wagtailcore_tags %}
33

44
{% block content %}
5-
<div>
6-
{# Division #}
7-
<p>Division: {{ page.final_division.label }}</p>
5+
<div class="grid grid--spacer-large streamfield service-area-page">
86

9-
{# Title #}
10-
<h1>{{ page.title }}</h1>
11-
{# Subtitle #}
12-
<p>{{ page.subtitle }}</p>
7+
<div class="grid__title">
8+
<h1 class="heading heading--mega">{{ page.title }}</h1>
9+
<p class="heading heading--two-b heading--light text-themePrimary">{{ page.subtitle }}</p>
10+
</div>
1311

1412
{% include_block page.body %}
1513
</div>

tbx/static_src/sass/components/_four-photo-collage.scss

+6-1
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,16 @@
111111
object-fit: cover;
112112
}
113113

114-
&__caption {
114+
&__text {
115115
grid-column: 1 / span 4;
116116

117117
@include media-query(large) {
118118
grid-column: 1 / span 7;
119119
}
120120
}
121+
122+
// Override the default rich text font size
123+
&__description.rich-text {
124+
@include font-size('size-six');
125+
}
121126
}

tbx/static_src/sass/components/_grid.scss

+11
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,17 @@
422422
}
423423
}
424424

425+
// Service area page adjustments
426+
.template-service-area-page & {
427+
&__title {
428+
margin-bottom: $spacer-medium;
429+
430+
@include media-query(large) {
431+
margin-bottom: $spacer-medium-plus;
432+
}
433+
}
434+
}
435+
425436
// Service page alignment
426437
.template-service-page & {
427438
&__intro,

0 commit comments

Comments
 (0)