Skip to content

Commit 75fc529

Browse files
author
Adam Argyle
authored
Merge pull request #58 from argyleink/a11y-fixes
A11y fixes
2 parents 4fd470a + 33617c0 commit 75fc529

12 files changed

Lines changed: 34 additions & 11 deletions

src/components/hero.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const totalFeatures = biomes.reduce((total, biome) => {
4444
</div>
4545
<div>
4646
<p class="sub-title">
47-
Chrome and <span class="callout"><Icon name="css" size="1ch" title="CSS" /> CSS</span> in 2024 journeyed<br>
47+
Chrome and <span class="callout"><Icon aria-hidden="true" name="css" size="1ch" title="CSS" /> CSS</span> in 2024 journeyed<br>
4848
through the <b>forest</b>, over the <b>mountains</b>, and across the <b>seas</b>…
4949
</p>
5050
</div>

src/components/nav.aside.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const { biomes } = Astro.props;
1010
<header>
1111
<h2 class="retro-title">CSS Wrapped</h2>
1212
<button popovertarget="mobile-menu" popovertargetaction="hide">
13-
<Icon name="close" title="Close" size="2rem" />
13+
<Icon name="close" title="Close" aria-label="Close" size="2rem" />
1414
</button>
1515
</header>
1616
<div>

src/components/nav.primary.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import ThemeSwitch from "./theme.switch.astro";
1414
popovertarget="mobile-menu"
1515
title="Mobile Navigation Menu"
1616
>
17-
<Icon name="hamburger" size="1.75rem" />
17+
<Icon name="hamburger" aria-label="Hamburger Menu" size="1.75rem" />
1818
</button>
1919
</div>
2020
</nav>

src/components/video.astro

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ const { src, width = 720, height = 480 } = Astro.props;
1616
muted
1717
loop
1818
playsinline
19-
preload="metadata"></video>
19+
preload="metadata">
20+
Your browser does not support video
21+
</video>
2022

2123
<style>
2224
/* @keyframes rounded-mask-reveal {

src/components/youtube.astro

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,26 @@ const watchURL = `https://youtube.com/watch?v=${id}`;
3939
height: auto;
4040
aspect-ratio: var(--aspectRatio);
4141
}
42+
43+
/* Make the fallback link the size of the whole component */
44+
lite-youtube > a {
45+
display: block;
46+
width: 100%;
47+
height: 100%;
48+
position: absolute;
49+
top: 0;
50+
left: 0;
51+
border-radius: var(--radius-3);
52+
}
53+
54+
/* Hide the fallback link when the component loads the button to prevent two tab stops */
55+
lite-youtube > a {
56+
outline-offset: -5px;
57+
}
58+
59+
/* Hide the fallback link when the component loads the button to prevent two tab stops */
60+
lite-youtube:has(button) > a {
61+
display: none;
62+
}
4263
}
4364
</style>

src/features/components/anchor-positioning.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ const slug = slugify(title);
6565

6666
<div class="resources">
6767
<p>
68-
<Icon name="book" title="Book Icon" />
68+
<Icon name="book" title="Book Icon"aria-hidden="true" />
6969
Resources:
7070
</p>
7171
<ul>

src/features/developerexperience/at-property.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ div {
8282

8383
<div class="resources">
8484
<p>
85-
<Icon name="book" title="Book Icon" />
85+
<Icon name="book" title="Book Icon"aria-hidden="true" />
8686
Resources:
8787
</p>
8888
<ul>

src/features/developerexperience/light-dark.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ const slug = slugify(title);
7272

7373
<div class="resources">
7474
<p>
75-
<Icon name="book" title="Book Icon" />
75+
<Icon name="book" title="Book Icon"aria-hidden="true" />
7676
Resources:
7777
</p>
7878
<ul>

src/features/developerexperience/starting-style.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ const slug = slugify(title);
7979

8080
<div class="resources">
8181
<p>
82-
<Icon name="book" title="Book Icon" />
82+
<Icon name="book" title="Book Icon"aria-hidden="true" />
8383
Resources:
8484
</p>
8585
<ul>

src/features/interactions/scroll-driven-animations.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const slug = slugify(title);
5050

5151
<div class="resources">
5252
<p>
53-
<Icon name="book" title="Book Icon" />
53+
<Icon name="book" title="Book Icon"aria-hidden="true" />
5454
Resources:
5555
</p>
5656
<ul>

0 commit comments

Comments
 (0)