From f8f55892e674e20ed2ff8269472c34317c1b4af6 Mon Sep 17 00:00:00 2001 From: Asartea <76259120+Asartea@users.noreply.github.com> Date: Thu, 13 Jul 2023 19:31:04 +0200 Subject: [PATCH] Fix: Add aria-label to logo links (#3964) ## Because - Currently there isn't anything describing where the logo links go to, which presents issues when using a screen reader ## This PR - Adds a `aria-label` to make it clear where the links go to ## Pull Request Requirements - [x] I have thoroughly read and understand [The Odin Project Contributing Guide](https://github.com/TheOdinProject/theodinproject/blob/main/CONTRIBUTING.md) - [x] The title of this PR follows the `keyword: brief description of change` format, using one of the following keywords: - `Feature` - adds new or amends existing user-facing behavior - `Chore` - changes that have no user-facing value, refactors, dependency bumps, etc - `Fix` - bug fixes - [x] The `Because` section summarizes the reason for this PR - [x] The `This PR` section has a bullet point list describing the changes in this PR - [x] I have verified all tests and linters pass after making these changes. --- app/components/logo_component.html.erb | 2 +- app/views/shared/_navbar.html.erb | 2 +- app/views/static_pages/about/_overview.html.erb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/components/logo_component.html.erb b/app/components/logo_component.html.erb index d750bb2864..a2b686eeb1 100644 --- a/app/components/logo_component.html.erb +++ b/app/components/logo_component.html.erb @@ -1,3 +1,3 @@ -<%= link_to root_path do %> +<%= link_to root_path, 'aria-label': 'Return back home' do %> <%= inline_svg_tag 'logo.svg', class: "#{classes} text-gray-800 dark:text-gray-300", aria: true, title: 'Odin Logo' %> <% end %> diff --git a/app/views/shared/_navbar.html.erb b/app/views/shared/_navbar.html.erb index 04c21d6d02..d8e83f0ac1 100644 --- a/app/views/shared/_navbar.html.erb +++ b/app/views/shared/_navbar.html.erb @@ -4,7 +4,7 @@
- <%= link_to root_path, class: 'logo' do %> + <%= link_to root_path, class: 'logo', 'aria-label': 'Return back home' do %> <%= image_tag 'icons/odin-icon.svg', alt: 'Odin Logo', class: 'block lg:hidden h-12 w-auto' %> <% end %> diff --git a/app/views/static_pages/about/_overview.html.erb b/app/views/static_pages/about/_overview.html.erb index 50b19f1e55..3d47381bcd 100644 --- a/app/views/static_pages/about/_overview.html.erb +++ b/app/views/static_pages/about/_overview.html.erb @@ -39,7 +39,7 @@
<%= render CardComponent.new do |card| %> <% card.with_header(classes: 'flex items-center') do %> - +

Open Source

<% end %> <% card.with_body(classes: 'prose prose-gray dark:prose-invert text-gray-500 dark:text-gray-300') do %>