Skip to content

Commit ab5f1c1

Browse files
authored
[docs] fix small a11y issues (#8074)
- duplicate text in showcase/deploy links - make banner a <header> - move skip link in front of banner - treat focusing deployment links the same as hovering them - properly label search input - make CTRL+K a div instead of a label
1 parent 755096e commit ab5f1c1

File tree

5 files changed

+24
-22
lines changed

5 files changed

+24
-22
lines changed

sites/kit.svelte.dev/src/lib/search/Search.svelte

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
<form class="search-container" action="/search">
99
<input
10-
id="search"
1110
value={q}
1211
on:input={(e) => {
1312
$searching = true;
@@ -19,13 +18,14 @@
1918
type="search"
2019
name="q"
2120
placeholder="Search"
21+
aria-label="Search"
2222
spellcheck="false"
2323
/>
2424

2525
{#if browser}
26-
<label for="#search">
26+
<div class="shortcut">
2727
<kbd>{navigator.platform === 'MacIntel' ? '' : 'Ctrl'}</kbd> <kbd>K</kbd>
28-
</label>
28+
</div>
2929
{/if}
3030
</form>
3131

@@ -62,7 +62,7 @@
6262
color: var(--sk-text-3);
6363
}
6464
65-
input:focus + label {
65+
input:focus + .shortcut {
6666
display: none;
6767
}
6868
@@ -71,7 +71,7 @@
7171
text-transform: uppercase;
7272
}
7373
74-
label {
74+
.shortcut {
7575
color: var(--sk-text-3);
7676
position: absolute;
7777
top: calc(50% - 0.9rem);
@@ -100,7 +100,7 @@
100100
width: 11rem;
101101
}
102102
103-
label {
103+
.shortcut {
104104
padding: 0 1.6rem 0 0;
105105
}
106106

sites/kit.svelte.dev/src/routes/Banner.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313

1414
<svelte:window on:scroll={handle_scroll} />
1515

16-
<div class="banner" class:visible>
16+
<header class="banner" class:visible>
1717
<p>
1818
<a href="https://www.youtube.com/watch?v=N4BRVkQVoMc">
1919
<strong>Dec 14:</strong> a Svelte Radio live special 👀
2020
</a>
2121
</p>
22-
</div>
22+
</header>
2323

2424
<style>
2525
.banner {

sites/kit.svelte.dev/src/routes/home/Deployment.svelte

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
href="https://github.com/sveltejs/kit/tree/master/packages/adapter-static"
3535
class="invert"
3636
>
37-
<img src={html5} alt="HTML5 logo" />
37+
<img src={html5} alt="" />
3838
<span><span class="large">Static</span> HTML</span>
3939
</a>
4040
<a
@@ -43,7 +43,7 @@
4343
href="https://github.com/sveltejs/kit/tree/master/packages/adapter-node"
4444
class="invert"
4545
>
46-
<img src={node} alt="Node logo" />
46+
<img src={node} alt="" />
4747
<span>Node.js</span>
4848
</a>
4949
<a
@@ -52,23 +52,23 @@
5252
href="https://github.com/sveltejs/kit/tree/master/packages/adapter-vercel"
5353
class="invert invert-hover"
5454
>
55-
<img src={vercel} alt="Vercel logo" style="transform: translate(0,-0.2rem)" />
55+
<img src={vercel} alt="" style="transform: translate(0,-0.2rem)" />
5656
<span>Vercel</span>
5757
</a>
5858
<a
5959
target="_blank"
6060
rel="noreferrer"
6161
href="https://github.com/sveltejs/kit/tree/master/packages/adapter-netlify"
6262
>
63-
<img src={netlify} alt="Netlify logo" />
63+
<img src={netlify} alt="" />
6464
<span>Netlify</span>
6565
</a>
6666
<a
6767
target="_blank"
6868
rel="noreferrer"
6969
href="https://github.com/sveltejs/kit/tree/master/packages/adapter-cloudflare"
7070
>
71-
<img src={cloudflare} alt="Cloudflare logo" />
71+
<img src={cloudflare} alt="" />
7272
<span>Cloudflare</span>
7373
</a>
7474
</div>
@@ -79,7 +79,7 @@
7979
rel="noreferrer"
8080
href="https://github.com/jthegedus/svelte-adapter-firebase"
8181
>
82-
<img src={firebase} alt="Firebase logo" />
82+
<img src={firebase} alt="" />
8383
<span>Firebase</span>
8484
</a>
8585
<a
@@ -88,23 +88,23 @@
8888
href="https://github.com/pluvial/svelte-adapter-deno"
8989
class="invert invert-hover"
9090
>
91-
<img src={deno} alt="Deno logo" />
91+
<img src={deno} alt="" />
9292
<span>Deno</span>
9393
</a>
9494
<a target="_blank" rel="noreferrer" href="https://github.com/MikeBild/sveltekit-adapter-aws">
95-
<img src={lambda} alt="AWS Lambda logo" />
95+
<img src={lambda} alt="" />
9696
<span>AWS</span>
9797
</a>
9898
<a
9999
target="_blank"
100100
rel="noreferrer"
101101
href="https://github.com/geoffrich/svelte-adapter-azure-swa"
102102
>
103-
<img src={azure} alt="Azure logo" />
103+
<img src={azure} alt="" />
104104
<span>Azure</span>
105105
</a>
106106
<a target="_blank" rel="noreferrer" href="https://kit.svelte.dev/docs/adapters">
107-
<img src={plus} alt="Plus sign" />
107+
<img src={plus} alt="" />
108108
<span>More...</span>
109109
</a>
110110
</div>
@@ -193,12 +193,14 @@
193193
transition: filter 0.2s;
194194
}
195195
196-
.platforms a:hover img {
196+
.platforms a:hover img,
197+
.platforms a:focus-visible img {
197198
filter: invert(var(--invert-hover));
198199
transition: none;
199200
}
200201
201-
.platforms a:hover span {
202+
.platforms a:hover span,
203+
.platforms a:focus-visible span {
202204
color: var(--sk-text-1);
203205
}
204206

sites/kit.svelte.dev/src/routes/home/Showcase.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<div class="showcase">
2929
{#each showcase as { url, image }}
3030
<a href="https://{url}" target="_blank" rel="noreferrer">
31-
<Image src={image} alt="Screenshot of {url}" />
31+
<Image src={image} alt="" />
3232
<span>{url}</span>
3333
</a>
3434
{/each}

sites/site-kit/src/lib/components/SkipLink.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
inset-block-start: 0;
1515
inset-inline-start: 0;
1616
transform: translateY(-999px);
17-
z-index: 101; /* 1 more than the nav z-index */
17+
z-index: 1000; /* 1 more than the banner z-index */
1818
}
1919
2020
a:focus {

0 commit comments

Comments
 (0)