Skip to content

Commit bde9d11

Browse files
authored
chore: support Policy Briefs pages (footnotes + table layout) (#178)
* chore: create footnotes component * Keep policy tables as tables on mobile with min-width and horizontal scroll * shorten footnotes divider width to 30% * change file name and bump style version
1 parent f415979 commit bde9d11

File tree

5 files changed

+69
-7
lines changed

5 files changed

+69
-7
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
.footer-notes {
2+
padding-inline: 5%;
3+
font-size: var(--step--1);
4+
}
5+
6+
.footer-notes .content-wrapper::before {
7+
content: "";
8+
display: block;
9+
height: 1px;
10+
width: 30%;
11+
top: 0;
12+
left: 0;
13+
margin-bottom: var(--space-2xs);
14+
background-color: black;
15+
}
16+
17+
.footer-notes ol {
18+
list-style: none;
19+
padding: 0;
20+
}
21+
22+
.footnote-backlink {
23+
font-size: var(--step--2);
24+
}

web/themes/interledger/css/components/table.css

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,24 +68,25 @@
6868
}
6969

7070
/* Responsive card layout for medium screens and below */
71+
/* except for tables on Policy pages */
7172
@media (max-width: 1024px) {
72-
.table-wrapper table thead {
73+
.table-wrapper table:not(.policy-table) thead {
7374
display: none;
7475
}
7576

76-
.table-wrapper table,
77-
.table-wrapper table tbody {
77+
.table-wrapper table:not(.policy-table),
78+
.table-wrapper table:not(.policy-table) tbody {
7879
display: block;
7980
}
8081

8182
.table-wrapper table tbody {
82-
border: 1px solid var(---table-border-color-sm);
83+
border: 1px solid var(--table-border-color-sm);
8384
border-radius: var(--border-radius);
8485
overflow: hidden;
8586
background: var(--table-bg-sm);
8687
}
8788

88-
.table-wrapper table tr {
89+
.table-wrapper table:not(.policy-table) tr {
8990
display: block;
9091
}
9192

@@ -101,8 +102,11 @@
101102
color: var(--table-fg-sm);
102103
}
103104

104-
.table-wrapper table td {
105+
.table-wrapper table:not(.policy-table) td {
105106
display: block;
107+
}
108+
109+
.table-wrapper table td {
106110
padding: var(--space-2xs) var(--space-xs);
107111
position: relative;
108112
color: var(--table-fg-sm);
@@ -144,3 +148,17 @@
144148
padding-bottom: var(--space-2xs);
145149
}
146150
}
151+
152+
/* Policy Briefs page table styling */
153+
.table-wrapper table.policy-table {
154+
min-width: 600px;
155+
max-width: none;
156+
}
157+
158+
.table-wrapper table.policy-table td:first-child {
159+
white-space: normal;
160+
}
161+
162+
.table-wrapper:has(table.policy-table) {
163+
overflow-x: auto;
164+
}

web/themes/interledger/interledger.libraries.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
global-styling:
2-
version: 1.7.3
2+
version: 1.7.4
33
css:
44
theme:
55
css/fonts.css: {}
@@ -31,6 +31,7 @@ global-styling:
3131
css/components/cta-button.css: {}
3232
css/components/event-card.css: {}
3333
css/components/faq.css: {}
34+
css/components/footer-notes.css: {}
3435
css/components/hero.css: {}
3536
css/components/highlight-text.css: {}
3637
css/components/podcast.css: {}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<ol>
2+
{% for item in items %}
3+
<li id="footnote-{{ loop.index }}">
4+
<span class="visually-hidden">Footnote
5+
{{loop.index}}
6+
</span>
7+
<sup aria-hidden="true">{{ loop.index }}
8+
</sup>
9+
{{ item.content }}
10+
<a href="#ref-{{ loop.index }}" aria-label="Return to footnote {{ loop.index }} reference in article" class="footnote-backlink">↩</a>
11+
</li>
12+
{% endfor %}
13+
</ol>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<aside class="footer-notes node--{{ node.id }}">
2+
<h2 class="visually-hidden">Footnotes</h2>
3+
<div class="content-wrapper">
4+
{{ content }}
5+
</div>
6+
</aside>

0 commit comments

Comments
 (0)