Skip to content

Commit

Permalink
[Fix accessibility] severity 4 Issues (#1352)
Browse files Browse the repository at this point in the history
## 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">
  • Loading branch information
jpg619 authored Nov 6, 2024
1 parent 21e36bb commit 5ea4069
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/site-title.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Link from './link'
import useSiteMetadata from '../hooks/use-site-metadata'

const NpmLogo = ({size, sx}) => (
<Box sx={{...sx, color: 'logoBg'}} role="banner">
<Box sx={{...sx, color: 'logoBg'}}>
<svg height={size} width={size} viewBox="0 0 700 700" fill="currentColor" aria-hidden="true">
<polygon fill="currentColor" points="0,700 700,700 700,0 0,0" />
<polygon fill="#ffffff" points="150,550 350,550 350,250 450,250 450,550 550,550 550,150 150,150 " />
Expand Down
3 changes: 1 addition & 2 deletions src/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,13 @@ const DefaultLayout = ({children}) => {
<Box
sx={{
justifyContent: 'center',
flexDirection: 'row-reverse',
display: 'flex',
maxWidth: '1200px',
mx: 'auto',
width: '100%',
p: [4, 5, 6, 7],
}}
>
<TableOfContents.Desktop />
<Container as="main">
<Box sx={{mb: 4}}>
<Breadcrumbs />
Expand All @@ -60,6 +58,7 @@ const DefaultLayout = ({children}) => {
{children}
<PageFooter />
</Container>
<TableOfContents.Desktop />
</Box>
)
}
Expand Down

0 comments on commit 5ea4069

Please sign in to comment.