Skip to content

Commit 647bc2d

Browse files
author
Miles Hinchliffe
committed
Miles and mike pair programming changes
1 parent 22d4839 commit 647bc2d

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

src/lib/components/data-vis/table/Table.svelte

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,12 @@
143143
scope="col"
144144
class={`govuk-table__header ${column.dataType === "number" ? "govuk-table__header--numeric" : ""}`}
145145
title={metaData[column.key].explainer}
146+
aria-sort={sortState.column !== column.key
147+
? "not-sorted"
148+
: sortState.column === column.key &&
149+
sortState.order === "descending"
150+
? "descending"
151+
: "ascending"}
146152
>
147153
<div class="header">
148154
<Button
@@ -226,4 +232,17 @@
226232
border-radius: 10%;
227233
padding: 6px;
228234
}
235+
236+
:global([aria-sort="ascending"].govuk-table__header .top-triangle) {
237+
fill: #222;
238+
}
239+
:global([aria-sort="ascending"].govuk-table__header .bottom-triangle) {
240+
fill: #bcbcbd;
241+
}
242+
:global([aria-sort="descending"].govuk-table__header .top-triangle) {
243+
fill: #bcbcbd;
244+
}
245+
:global([aria-sort="descending"].govuk-table__header .bottom-triangle) {
246+
fill: #222;
247+
}
229248
</style>

src/lib/components/ui/Button.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,16 @@
6464
aria-hidden="true"
6565
role="img"
6666
viewBox="0 0 22 22"
67-
fill="none"
67+
fill="currentColor"
6868
xmlns="http://www.w3.org/2000/svg"
6969
>
7070
<path
71+
class="top-triangle"
7172
d="M8.1875 9.5L10.9609 3.95703L13.7344 9.5H8.1875Z"
7273
fill="currentColor"
7374
></path>
7475
<path
76+
class="bottom-triangle"
7577
d="M13.7344 12.0781L10.9609 17.6211L8.1875 12.0781H13.7344Z"
7678
fill="currentColor"
7779
></path>

0 commit comments

Comments
 (0)