Skip to content

Commit 48a2c04

Browse files
authored
feat: implement single barrier (resolves #361) (#370)
1 parent 2b3e6be commit 48a2c04

File tree

3 files changed

+71
-1
lines changed

3 files changed

+71
-1
lines changed

src/_includes/layouts/barrier.njk

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,46 @@
11
{% extends "layouts/base.njk" %}
22

33
{% set pageType = 'barrier' %}
4+
5+
{% block banner %}
6+
<div class="banner bg-indigo-800">
7+
<div class="wrapper">
8+
<div class="banner__content flow">
9+
{% set breadcrumb = collections['pages_' + lang] | find('data.translationKey', 'barriers') %}
10+
<a href="{{ breadcrumb.url }}" >{{ breadcrumb.data.shortTitle if breadcrumb.data.shortTitle else breadcrumb.data.title }} {% include 'svg/arrowRight.svg' %}</a>
11+
<h1>{{ title }}</h1>
12+
</div>
13+
</div>
14+
</div>
15+
{% endblock %}
16+
17+
{% block content %}
18+
<nav aria-labelledby="barrier-menu" class="flow">
19+
<inclusive-disclosure>
20+
<button aria-controls="{{ title | slugify }}-menu">
21+
<h2 id="barrier-menu">{% __ 'toc' %}</h2>
22+
</button>
23+
<div content id="{{ title | slugify }}-menu">
24+
<ul role="list" class="flow">
25+
<li class="flow" id="toc">
26+
<h3>{% __ 'toc' %}</h3>
27+
<ul role="list" class="flow"></ul>
28+
</li>
29+
</ul>
30+
</div>
31+
</inclusive-disclosure>
32+
</nav>
33+
<article class="flow">
34+
<h2>{% __ 'barriers-problem' %}</h2>
35+
{{ problem | renderContent('md') | safe }}
36+
{% if collections['strategies-and-tips_' + lang] | find('data.barriers', uuid) %}
37+
<h2>{% __ 'barriers-fix' %}</h2>
38+
{% for strategy in collections['strategies-and-tips_' + lang] %}
39+
{% if uuid in strategy.data.barriers %}
40+
{% set strategyOrTip = strategy %}
41+
{% include "partials/components/card--strategies-and-tips.njk" %}
42+
{% endif %}
43+
{% endfor %}
44+
{% endif %}
45+
</article>
46+
{% endblock %}

src/_includes/partials/components/card--strategies-and-tips.njk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div class="card strategies-and-tips bg-indigo-700">
22
<div class="card__content">
33
<h3>
4-
<a class="card__title" href="">
4+
<a class="card__title" href="{{ strategyOrTip.url }}">
55
{{ strategyOrTip.data.title }}
66
</a>
77
</h3>

src/assets/styles/collections/_guidelines.css

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,50 @@
11
.guidelines .banner,
22
.processes .banner,
3+
.barrier .banner,
34
.barriers .banner {
45
background-color: var(--fl-bgColor, var(--color-indigo-200));
56
color: var(--fl-fgColor, var(--color-black));
67
}
78

9+
.barrier nav,
10+
.barrier article,
811
.guidelines nav,
912
.guidelines article {
1013
box-shadow: inset 0 -0.1875rem 0 0 var(--fl-fgColor, transparent);
1114
}
1215

16+
.barrier nav,
1317
.guidelines nav {
1418
background-color: var(--fl-bgColor, var(--color-indigo-100));
1519
}
1620

21+
.barrier nav > h2,
1722
.guidelines nav > h2 {
1823
display: none;
1924
}
2025

26+
.barrier inclusive-disclosure h3 {
27+
font-size: var(--step-2);
28+
font-weight: var(--font-weight-semibold);
29+
margin-block-end: var(--flow-space, 1em);
30+
}
31+
32+
.barrier nav inclusive-disclosure,
2133
.guidelines nav inclusive-disclosure {
2234
padding-inline: 0;
2335
}
2436

37+
.barrier nav inclusive-disclosure > *,
2538
.guidelines nav inclusive-disclosure > * {
2639
padding-inline: var(--common-inline-padding);
2740
}
2841

42+
.barrier nav inclusive-disclosure [aria-expanded],
2943
.guidelines nav inclusive-disclosure [aria-expanded] {
3044
box-shadow: none;
3145
}
3246

47+
.barrier nav inclusive-disclosure [aria-expanded]::after,
3348
.guidelines nav inclusive-disclosure [aria-expanded]::after {
3449
right: var(--common-inline-padding);
3550
}
@@ -78,18 +93,22 @@
7893
}
7994

8095
@media (width >= 70.875rem) {
96+
.barrier nav > h2,
8197
.guidelines nav > h2 {
8298
display: block;
8399
}
84100

101+
.barrier nav inclusive-disclosure > *,
85102
.guidelines nav inclusive-disclosure > * {
86103
padding-inline: 0;
87104
}
88105

106+
.barrier nav inclusive-disclosure [aria-expanded],
89107
.guidelines nav inclusive-disclosure [aria-expanded] {
90108
display: none;
91109
}
92110

111+
.barrier nav inclusive-disclosure [aria-expanded] + *,
93112
.guidelines nav inclusive-disclosure [aria-expanded] + * {
94113
display: block;
95114
}
@@ -101,15 +120,18 @@
101120
}
102121
}
103122

123+
.barrier article,
104124
.guidelines article {
105125
padding-block: 2.125rem 5rem;
106126
padding-inline: var(--common-inline-padding);
107127
}
108128

129+
.barrier article > *,
109130
.guidelines article > * {
110131
max-width: 41.875rem;
111132
}
112133

134+
.barrier article > h2,
113135
.guidelines article > h2 {
114136
max-width: 100%;
115137
}
@@ -153,6 +175,7 @@
153175
}
154176

155177
@media (width >= 70.875rem) {
178+
.barrier .content,
156179
.guidelines .content {
157180
display: grid;
158181
grid-template-columns: 35% 65%;
@@ -161,11 +184,14 @@
161184
width: 100%;
162185
}
163186

187+
.barrier nav,
188+
.barrier article,
164189
.guidelines nav,
165190
.guidelines article {
166191
padding-block: 8.4375rem;
167192
}
168193

194+
.barrier nav,
169195
.guidelines nav {
170196
padding-inline: 8.4375rem 5rem;
171197
position: relative;
@@ -183,6 +209,7 @@
183209
}
184210
}
185211

212+
.barrier article,
186213
.guidelines article {
187214
padding-inline: 8.4375rem;
188215
}

0 commit comments

Comments
 (0)