Skip to content

Commit 5ea4069

Browse files
authored
[Fix accessibility] severity 4 Issues (#1352)
## WHAT This pull request includes a few changes to the `src/components/site-title.js` and `src/layout.js` files to improve the layout and structure of the components. Layout improvements: * [`src/layout.js`](diffhunk://#diff-a6d4de2cc6c8127b7cbdf668554367b396b50bea26c46bb805d3bc4d43108994L42-L50): Reordered the `TableOfContents.Desktop` component to be placed after the `Container` component and removed the `flexDirection: 'row-reverse'` style. [[1]](diffhunk://#diff-a6d4de2cc6c8127b7cbdf668554367b396b50bea26c46bb805d3bc4d43108994L42-L50) [[2]](diffhunk://#diff-a6d4de2cc6c8127b7cbdf668554367b396b50bea26c46bb805d3bc4d43108994R61) Code cleanup: * [`src/components/site-title.js`](diffhunk://#diff-c25bc0f69ad33508e676865af1c416298095475f259f0a06c386d0b5d9e4b294L7-R7): Removed the redundant `role="banner"` attribute from the `Box` component. ## BEFORE & AFTER <img width="375" alt="image" src="https://github.com/user-attachments/assets/b9b7c958-3b52-44f8-abd7-5938c909f48e"> <img width="375" alt="image" src="https://github.com/user-attachments/assets/d6093bf3-8ccb-4abe-a828-c7be5443bd79">
1 parent 21e36bb commit 5ea4069

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/components/site-title.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import Link from './link'
44
import useSiteMetadata from '../hooks/use-site-metadata'
55

66
const NpmLogo = ({size, sx}) => (
7-
<Box sx={{...sx, color: 'logoBg'}} role="banner">
7+
<Box sx={{...sx, color: 'logoBg'}}>
88
<svg height={size} width={size} viewBox="0 0 700 700" fill="currentColor" aria-hidden="true">
99
<polygon fill="currentColor" points="0,700 700,700 700,0 0,0" />
1010
<polygon fill="#ffffff" points="150,550 350,550 350,250 450,250 450,550 550,550 550,150 150,150 " />

src/layout.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,13 @@ const DefaultLayout = ({children}) => {
3939
<Box
4040
sx={{
4141
justifyContent: 'center',
42-
flexDirection: 'row-reverse',
4342
display: 'flex',
4443
maxWidth: '1200px',
4544
mx: 'auto',
4645
width: '100%',
4746
p: [4, 5, 6, 7],
4847
}}
4948
>
50-
<TableOfContents.Desktop />
5149
<Container as="main">
5250
<Box sx={{mb: 4}}>
5351
<Breadcrumbs />
@@ -60,6 +58,7 @@ const DefaultLayout = ({children}) => {
6058
{children}
6159
<PageFooter />
6260
</Container>
61+
<TableOfContents.Desktop />
6362
</Box>
6463
)
6564
}

0 commit comments

Comments
 (0)