fix(a11y): WCAG 2 AA contrast, labels and dropdown
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
8025858060
commit
70c3ca82ea
8 changed files with 134 additions and 37 deletions
|
|
@ -562,13 +562,17 @@ defmodule MvWeb.CoreComponents do
|
|||
phx-target={@phx_target}
|
||||
>
|
||||
<%= if @checkboxes do %>
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={Map.get(@selected, item.value, true)}
|
||||
class="checkbox checkbox-sm checkbox-primary pointer-events-none"
|
||||
tabindex="-1"
|
||||
<%!-- Visual-only indicator: do not nest an interactive control (checkbox) inside the button for screen reader and focus correctness (WCAG 2.1.2). --%>
|
||||
<span
|
||||
class={
|
||||
if Map.get(@selected, item.value, true),
|
||||
do: "text-primary",
|
||||
else: "text-base-300"
|
||||
}
|
||||
aria-hidden="true"
|
||||
/>
|
||||
>
|
||||
<.icon name="hero-check" class="size-4 shrink-0" />
|
||||
</span>
|
||||
<% end %>
|
||||
<span>{item.label}</span>
|
||||
</button>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue