Skip to content

Commit 33504e2

Browse files
committed
More accessible resoionsive tables
1 parent c12a48a commit 33504e2

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

src/assets/sass/modules/_tables.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@
1414
.tabular-data {
1515
margin-bottom: 1em;
1616
overflow-x: auto;
17+
18+
&:focus {
19+
outline: thin solid $color-link-focus;
20+
}
21+
}
22+
23+
@include dark-mode {
24+
.tabular-data:focus {
25+
outline: thin solid $dark-color-link-focus;
26+
}
1727
}
1828

1929
/**

src/docs/design-patterns.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -870,7 +870,7 @@ <h2>Tables</h2>
870870
<h3>Plain table</h3>
871871
<p class="information">Simple table (without <code>&lt;thead&gt;</code>, <code>&lt;tfoot&gt;</code> tags)</p>
872872

873-
<div class="tabular-data">
873+
<div class="tabular-data" tabindex="0" aria-label="Food list" itemscope itemtype="https://schema.org/Table">
874874
<table>
875875
<tbody>
876876
<tr>
@@ -900,9 +900,9 @@ <h3>Plain table</h3>
900900
<h3>Full Table</h3>
901901
<p class="information">Full-feautured table with <code>scope</code>, <code>rowspan</code> <code>colspan</code> attributes, and <code>&lt;caption&gt;</code>, <code>&lt;colgroup&gt;</code>, <code>&lt;thead&gt;</code>, <code>&lt;tfoot&gt;</code>, <code>&lt;tbody&gt;</code> tags included</p>
902902

903-
<div class="tabular-data">
903+
<div class="tabular-data" tabindex="0" aria-labelledby="table-caption" itemscope itemtype="https://schema.org/Table">
904904
<table>
905-
<caption>This is a table caption</caption>
905+
<caption id="table-caption">This is a table caption</caption>
906906
<colgroup>
907907
<col class="t25">
908908
<col class="t25">

src/templates/forms/misc/language_table.txp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ try {
99
}
1010

1111
echo <<<EOHTML
12-
<div class="tabular-data">
12+
<div class="tabular-data" tabindex="0" aria-label="Language list" itemscope itemtype="https://schema.org/Table">
1313
<table>
1414
<colgroup>
1515
<col class="t30">

0 commit comments

Comments
 (0)