Skip to content

Apply WCAG 2.5.8 (24px min hit target) consistently across small controls #854

Description

@ravisuhag

Summary

Several interactive controls render below the WCAG 2.5.8 (Target Size, Minimum — 24×24px) threshold. An earlier attempt (commit b3ab3bcb) added transparent ::before pseudo-elements to pad the hit boxes, but it was reverted because the 24px rule was applied unevenly and left gaps. This issue tracks doing it consistently.

Sub-24px controls today

Control Size(s) below 24px
checkbox .small 12px, .large 16px
radio .small 12px, default 16px
icon-button size-1 12px, size-2 16px, size-3 20px
toggle size-1 12px, size-2 16px
slider small thumb 8×16px
chip dismiss button ~12px
callout dismiss ~20px
color-picker thumbs (small)
sidebar handle 4px

(space-4 = 12px, space-5 = 16px, space-6 = 20px, space-7 = 24px.)

Problems with the reverted attempt

  1. Inconsistent threshold. icon-button and toggle expanded both their 12px and 16px sizes; checkbox and radio expanded only 12px, leaving the 16px .large checkbox and 16px default radio untouched. Same pixel size, different treatment.
  2. 20px controls left as-is. icon-button size-3 (20px) and callout dismiss (20px) still fall under 24px — they pass only via WCAG's spacing exception, not the minimum.
  3. Coverage gaps. chip dismiss (~12px) and color-picker thumbs were never touched.
  4. Grouped-toggle clip. Inside .group (overflow: clip, 1px gaps) the ::before expansion is clipped at the group edge, so the fix is partly defeated there.

Suggested approach

  • Decide the policy explicitly: expand every interactive target below 24px, or rely on the spacing exception for ≥20px targets and document that. Then apply it uniformly.
  • If checkboxes/radios are exempt because they sit inside a clickable label, state that and skip their box expansion entirely (don't expand only the 12px variant).
  • Consider a shared pattern for the pseudo-element expansion — a --rs-space-7 (24px) named min-target with the inset derived via calc() — to avoid repeating magic insets (-6 / -4 / -8) across five files.
  • Resolve the grouped-toggle clipping (e.g. rethink the group's overflow, or accept and document the limit).

Notes

The mechanism itself (transparent absolutely-positioned ::before, position: relative host, layout/visuals unchanged) was correct and the per-size math was right — the issue is scope/consistency, not technique.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions