Skip to content

Commit

Permalink
Revert "feat(theme-default): remove ari-hidden on title and use an em…
Browse files Browse the repository at this point in the history
…pty alt on brand image if not specified"

This reverts commit 4250903.
  • Loading branch information
nruffing committed Jan 28, 2024
1 parent 4250903 commit 6d62835
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion themes/theme-default/src/client/components/NavbarBrand.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,14 @@ const navbarBrandLogo = computed(() => {
}
return themeLocale.value.logo
})
const navbarBrandLogoAlt = computed(() => themeLocale.value.logoAlt ?? '')
const navbarBrandLogoAlt = computed(
() => themeLocale.value.logoAlt ?? navbarBrandTitle.value,
)
const navBarLogoAltMatchesTitle = computed(
() =>
navbarBrandTitle.value.toLocaleUpperCase().trim() ===
navbarBrandLogoAlt.value.toLocaleUpperCase().trim(),
)
const NavbarBrandLogo: FunctionalComponent = () => {
if (!navbarBrandLogo.value) return null
const img = h('img', {
Expand All @@ -49,6 +56,7 @@ const NavbarBrandLogo: FunctionalComponent = () => {
v-if="navbarBrandTitle"
class="site-name"
:class="{ 'can-hide': navbarBrandLogo }"
:aria-hidden="navBarLogoAltMatchesTitle"
>
{{ navbarBrandTitle }}
</span>
Expand Down

0 comments on commit 6d62835

Please sign in to comment.