From 72501c90b4a9c282db1d1a9fe87f1563cbb180d0 Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Wed, 17 Nov 2021 09:30:33 -0600 Subject: [PATCH] Remove `aria-hidden` on icons in favor of empty alt text. This matches better with adding alt text to images, which is probably better than either manually opting out of the accessibility tree or creating some less-compatible implementation. --- lib/live_beats_web/live/live_helpers.ex | 1 + lib/live_beats_web/live/player_live.ex | 2 +- lib/live_beats_web/live/song_live/index.ex | 8 ++++---- lib/live_beats_web/views/layout_view.ex | 4 ++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/live_beats_web/live/live_helpers.ex b/lib/live_beats_web/live/live_helpers.ex index 7e6608f..4f363c0 100644 --- a/lib/live_beats_web/live/live_helpers.ex +++ b/lib/live_beats_web/live/live_helpers.ex @@ -96,6 +96,7 @@ defmodule LiveBeatsWeb.LiveHelpers do assigns |> assign_new(:outlined, fn -> false end) |> assign_new(:class, fn -> "w-4 h-4 inline-block" end) + |> assign_new(:alt, fn -> "" end) ~H""" <%= if @outlined do %> diff --git a/lib/live_beats_web/live/player_live.ex b/lib/live_beats_web/live/player_live.ex index abc7240..fb0c6ad 100644 --- a/lib/live_beats_web/live/player_live.ex +++ b/lib/live_beats_web/live/player_live.ex @@ -41,7 +41,7 @@ defmodule LiveBeatsWeb.PlayerLive do redirect_to={profile_path(@profile)} class="mx-auto flex outline border-2 border-white border-opacity-20 rounded-md p-1 pr-2" > - <.icon name={:user_circle} aria-hidden="true"/> + <.icon name={:user_circle}/>

<%= @profile.username %>

<% else %> diff --git a/lib/live_beats_web/live/song_live/index.ex b/lib/live_beats_web/live/song_live/index.ex index 545826b..672acdc 100644 --- a/lib/live_beats_web/live/song_live/index.ex +++ b/lib/live_beats_web/live/song_live/index.ex @@ -13,7 +13,7 @@ defmodule LiveBeatsWeb.SongLive.Index do <%= @profile.tagline %> <%= if @owns_profile? do %>(you)<% end %> <.link href={@profile.external_homepage_url} _target="blank" class="block text-sm text-gray-600"> - <.icon name={:code} aria-hidden="true"/> <%= url_text(@profile.external_homepage_url) %> + <.icon name={:code}/> <%= url_text(@profile.external_homepage_url) %> @@ -22,18 +22,18 @@ defmodule LiveBeatsWeb.SongLive.Index do <.button primary phx-click={JS.push("switch_profile", value: %{user_id: nil}, target: "#player", loading: "#player")} > - <.icon name={:stop} aria-hidden="true"/>Stop Listening + <.icon name={:stop}/>Stop Listening <% else %> <.button primary phx-click={JS.push("switch_profile", value: %{user_id: @profile.user_id}, target: "#player", loading: "#player")} > - <.icon name={:play} aria-hidden="true"/>Listen + <.icon name={:play}/>Listen <% end %> <%= if @owns_profile? do %> <.button primary patch_to={Routes.song_index_path(@socket, :new)}> - <.icon name={:upload} aria-hidden="true"/>Upload Songs + <.icon name={:upload}/>Upload Songs <% end %> diff --git a/lib/live_beats_web/views/layout_view.ex b/lib/live_beats_web/views/layout_view.ex index 6e3ebcd..f4823eb 100644 --- a/lib/live_beats_web/views/layout_view.ex +++ b/lib/live_beats_web/views/layout_view.ex @@ -35,7 +35,7 @@ defmodule LiveBeatsWeb.LayoutView do redirect_to={profile_path(@current_user)} class="text-gray-700 hover:text-gray-900 hover:bg-gray-50 group flex items-center px-2 py-2 text-sm font-medium rounded-md" > - <.icon name={:music_note} outlined class="text-gray-400 group-hover:text-gray-500 mr-3 flex-shrink-0 h-6 w-6" aria-hidden="true"/> + <.icon name={:music_note} outlined class="text-gray-400 group-hover:text-gray-500 mr-3 flex-shrink-0 h-6 w-6"/> My Songs @@ -43,7 +43,7 @@ defmodule LiveBeatsWeb.LayoutView do redirect_to={Routes.settings_path(LiveBeatsWeb.Endpoint, :edit)} class="text-gray-700 hover:text-gray-900 hover:bg-gray-50 group flex items-center px-2 py-2 text-sm font-medium rounded-md" > - <.icon name={:adjustments} outlined class="text-gray-400 group-hover:text-gray-500 mr-3 flex-shrink-0 h-6 w-6" aria-hidden="true"/> + <.icon name={:adjustments} outlined class="text-gray-400 group-hover:text-gray-500 mr-3 flex-shrink-0 h-6 w-6"/> Settings <% else %>