Skip to content

Commit

Permalink
🐛 fix(app): add SVG labels for a11y
Browse files Browse the repository at this point in the history
  • Loading branch information
gerdesque committed Jan 18, 2025
1 parent f77da1f commit 49d6e25
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 10 deletions.
8 changes: 6 additions & 2 deletions src/components/HeroImage.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
---
import Hero from '../icons/about.svg'
import HeroSVG from '../icons/about.svg'
import { siteTitle } from '@src/consts'
---

<Hero class:list={'m-auto h-[300px] object-cover'} />
<HeroSVG
aria-label=`${siteTitle} Hero`
class:list={'m-auto h-[300px] object-cover'}
/>
8 changes: 7 additions & 1 deletion src/components/Logo.astro
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,11 @@ const { background = false } = Astro.props
<div class='bg-primary rounded-full absolute -z-50 transition-all top-1 left-1 h-16 w-16' />
)
}
<LogoSVG width={96} height={96} class='ml-2' fill='currentColor' />
<LogoSVG
aria-label='logo'
width={96}
height={96}
class='ml-2'
fill='currentColor'
/>
</a>
22 changes: 16 additions & 6 deletions src/components/SocialLinks.astro
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,23 @@ import { socialMedia } from '@src/consts'
---

<div class='flex items-center justify-center gap-2 h-8'>
<a aria-label='instagram' href={socialMedia.instagram} target='_blank'>
<Instagram width={32} height={32} fill='currentColor' />
<a href={socialMedia.instagram} target='_blank'>
<Instagram
aria-label='Instagram'
width={32}
height={32}
fill='currentColor'
/>
</a>
<a aria-label='github' href={socialMedia.github} target='_blank'>
<Github width={32} height={32} fill='currentColor' />
<a href={socialMedia.github} target='_blank'>
<Github aria-label='Github' width={32} height={32} fill='currentColor' />
</a>
<a aria-label='linkedin' href={socialMedia.linkedin} target='_blank'>
<Linkedin width={32} height={32} fill='currentColor' />
<a href={socialMedia.linkedin} target='_blank'>
<Linkedin
aria-label='Linkedin'
width={32}
height={32}
fill='currentColor'
/>
</a>
</div>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion tests/homepage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ test.describe('Homepage areas', () => {

test('has footer', async ({ page }) => {
await expect(
page.getByRole('contentinfo').getByLabel('instagram'),
page.getByRole('contentinfo').getByLabel('Instagram'),
).toBeVisible()
})
})
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 49d6e25

Please sign in to comment.