Skip to content

Commit 8df4a50

Browse files
hbuchelHeather Buchel
andauthored
Docs/a11y roundup (#1862)
* add aria label to W3C image * add aria-hidden to React icon, label already says React * Remove out of order headings, tab title should suffice * add labels to nav landmarks. Remove aside landmark from section nav as is not needed Co-authored-by: Heather Buchel <[email protected]>
1 parent a10ba2e commit 8df4a50

File tree

4 files changed

+15
-9
lines changed

4 files changed

+15
-9
lines changed

docs/src/components/ComponentStyleDisplay.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,11 @@ export const ComponentStyleDisplay = ({ componentName }) => {
2626
<Tabs>
2727
<TabItem title="Target Classes">
2828
<View padding={`${tokens.space.medium} 0`}>
29-
<Heading>Component Class Names</Heading>
3029
<ComponentClassTable componentName={componentName} />
3130
</View>
3231
</TabItem>
3332
<TabItem title="CSS Variables">
3433
<View padding={`${tokens.space.medium} 0`}>
35-
<Heading>Component CSS Variable Names</Heading>
3634
<ComponentVariableTable
3735
componentName={componentName.toLowerCase()}
3836
/>

docs/src/components/Layout/Header.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,14 @@ const NavLink = ({
5757
};
5858

5959
const Nav = (props) => (
60-
<Flex as="nav" className="docs-nav" alignItems="center" gap="0" grow="1">
60+
<Flex
61+
as="nav"
62+
aria-label="Main navigation"
63+
className="docs-nav"
64+
alignItems="center"
65+
gap="0"
66+
grow="1"
67+
>
6168
<NavLink {...props} href="/getting-started/installation">
6269
Getting started
6370
</NavLink>
@@ -156,7 +163,7 @@ export const Header = ({ platform, colorMode, setColorMode }) => {
156163
</Flex>
157164

158165
<Nav onClick={() => setExpanded(false)} />
159-
<nav className="docs-sidebar-nav">
166+
<nav aria-label="Section navigation" className="docs-sidebar-nav">
160167
<SecondaryNav onClick={() => setExpanded(false)} />
161168
</nav>
162169
</View>

docs/src/components/Layout/SecondaryNav.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,12 +185,12 @@ export const SecondaryNav = (props) => {
185185

186186
export const Sidebar = () => {
187187
return (
188-
<aside className="docs-sidebar">
188+
<nav aria-label="Section navigation" className="docs-sidebar">
189189
<div className="docs-sidebar-inner">
190-
<nav className="docs-sidebar-nav">
190+
<div className="docs-sidebar-nav">
191191
<SecondaryNav />
192-
</nav>
192+
</div>
193193
</div>
194-
</aside>
194+
</nav>
195195
);
196196
};

docs/src/components/Layout/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export default function Page({
9595
isExternal
9696
>
9797
<Icon
98-
ariaLabel=""
98+
ariaLabel="W3C"
9999
as={SiW3C}
100100
marginInlineEnd={tokens.space.xs}
101101
/>
@@ -123,6 +123,7 @@ export default function Page({
123123
>
124124
<Icon
125125
ariaLabel=""
126+
aria-hidden="true"
126127
as={SiReact}
127128
marginInlineEnd={tokens.space.xs}
128129
/>

0 commit comments

Comments
 (0)