Skip to content

Commit 6aaa105

Browse files
authored
site a11y: add missing h1s (#5715)
1 parent bf35353 commit 6aaa105

File tree

5 files changed

+17
-0
lines changed

5 files changed

+17
-0
lines changed

site/src/routes/blog/index.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<meta name="Description" content="Articles about Svelte and UI development">
1919
</svelte:head>
2020

21+
<h1 class="visually-hidden">Blog</h1>
2122
<div class='posts stretch'>
2223
{#each posts as post}
2324
<article class='post' data-pubdate={post.metadata.dateString}>

site/src/routes/docs/index.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@
1919
<meta name="Description" content="Cybernetically enhanced web apps">
2020
</svelte:head>
2121

22+
<h1 class="visually-hidden">API Docs</h1>
2223
<Docs {sections}/>

site/src/routes/examples/index.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100
<meta name="Description" content="Interactive example Svelte apps">
101101
</svelte:head>
102102

103+
<h1 class="visually-hidden">Examples</h1>
103104
<div class='examples-container' bind:clientWidth={width}>
104105
<div class="viewport offset-{offset}">
105106
<TableOfContents {sections} active_section={active_slug} {isLoading} />

site/src/routes/index.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
<meta name="Description" content="Cybernetically enhanced web apps">
3535
</svelte:head>
3636

37+
<h1 class="visually-hidden">Svelte</h1>
3738
<Hero
3839
title="Svelte"
3940
tagline="Cybernetically enhanced web apps"

site/static/global.css

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,16 @@ h5:hover .anchor,
2929
h6:hover .anchor {
3030
opacity: 1;
3131
}
32+
33+
/* visually hidden, but accessible to assistive tech */
34+
.visually-hidden {
35+
border: 0;
36+
clip: rect(0 0 0 0);
37+
height: auto;
38+
margin: 0;
39+
overflow: hidden;
40+
padding: 0;
41+
position: absolute;
42+
width: 1px;
43+
white-space: nowrap;
44+
}

0 commit comments

Comments
 (0)