Skip to content

Commit 2a579e5

Browse files
committed
use flexbox order property to change order of content for screenreaders
1 parent 2fb65c2 commit 2a579e5

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

_layouts/docs.html

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,19 @@
1717
<div class="col-12 col-md-3 col-xl-2 bd-sidebar">
1818
{% include docs-sidebar.html %}
1919
</div>
20-
<main class="col-12 col-md-9 col-xl-8 py-md-3 pl-md-5 bd-content" role="main">
21-
<h1 class="bd-title" id="content">{{ page.title }}</h1>
22-
<p class="bd-lead">{{ page.description }}</p>
23-
{% include ads.html %}
24-
{{ content }}
25-
</main>
2620

2721
{% if page.toc %}
2822
<div class="d-none d-xl-block col-xl-2 bd-toc">
2923
{{ content | toc_only }}
3024
</div>
3125
{% endif %}
26+
27+
<main class="col-12 col-md-9 col-xl-8 py-md-3 pl-md-5 bd-content" role="main">
28+
<h1 class="bd-title" id="content">{{ page.title }}</h1>
29+
<p class="bd-lead">{{ page.description }}</p>
30+
{% include ads.html %}
31+
{{ content }}
32+
</main>
3233
</div>
3334
</div>
3435

assets/scss/_content.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
//
66

77
.bd-content {
8+
order: 1;
9+
810
// Hack the sticky header
911
> h2[id],
1012
> h3[id],

assets/scss/_sidebar.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
top: 4rem;
1111
max-height: calc(100vh - 4rem);
1212
}
13+
order: 2;
1314
padding-top: 1.5rem;
1415
padding-bottom: 1.5rem;
1516
overflow-x: visible;
@@ -49,6 +50,7 @@
4950
//
5051

5152
.bd-sidebar {
53+
order: 0;
5254
background-color: #f5f2f9;
5355
border-bottom: 1px solid rgba(0,0,0,.1);
5456

0 commit comments

Comments
 (0)