Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Use aria-label for WordPress affiliation link #2187

Merged
merged 1 commit into from
Feb 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/components/VHeader/VWordPressLink.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<template>
<VLink
href="https://wordpress.org"
:aria-label="
$t('footer.wordpress-affiliation', { wordpress: 'WordPress' }).toString()
"
:class="mode === 'light' ? 'text-dark-charcoal' : 'text-white'"
class="hover:no-underline focus-visible:rounded-sm focus-visible:outline-none focus-visible:ring focus-visible:ring-pink focus-visible:ring-offset-1 focus-visible:ring-offset-tx"
>
Expand All @@ -10,8 +13,7 @@
class="label-regular flex flex-row items-center gap-1"
>
<template #wordpress>
<WordPress class="aria-hidden" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

class="aria-hidden"? I think just making this bit aria-hidden=true would've fixed it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean removing aria-label added in this PR and adding the non-tailwind aria-hidden class would fix the "no space between WordPress and project for screenreaders" problem, @dhruvkb?
I tried with VoiceOver, and when you and aria-label to the link, all of the other content becomes invisible for screenreader.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, that's interesting. I approved your solution though because it definitely works.

<span class="sr-only">WordPress</span>
<WordPress />
</template>
</i18n>
</VLink>
Expand Down