fix(a11y): WCAG 2 AA contrast, labels and dropdown
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Moritz 2026-03-04 16:19:28 +01:00
parent 8025858060
commit 70c3ca82ea
Signed by: moritz
GPG key ID: 1020A035E5DD0824
8 changed files with 134 additions and 37 deletions

View file

@ -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>