Skip to content

fix(Button): enforce 44px minimum touchable area (WCAG 2.5.5)#1561

Open
AlexandraGallipoliRodrigues wants to merge 1 commit into
masterfrom
fix/button-min-touchable-area-web-2445
Open

fix(Button): enforce 44px minimum touchable area (WCAG 2.5.5)#1561
AlexandraGallipoliRodrigues wants to merge 1 commit into
masterfrom
fix/button-min-touchable-area-web-2445

Conversation

@AlexandraGallipoliRodrigues
Copy link
Copy Markdown
Contributor

@AlexandraGallipoliRodrigues AlexandraGallipoliRodrigues commented Jun 3, 2026

Copilot AI review requested due to automatic review settings June 3, 2026 09:58
@AlexandraGallipoliRodrigues AlexandraGallipoliRodrigues added the AI AI Generated label Jun 3, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 3, 2026

Size stats

master this branch diff
Total JS 16.2 MB 16.2 MB -265 B
JS without icons 2.07 MB 2.07 MB -265 B
Lib overhead 92.5 kB 92.5 kB 0 B
Lib overhead (gzip) 19.9 kB 19.9 kB 0 B

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Button styling to ensure a minimum interactive/touch target size compliant with WCAG 2.5.5 by enforcing a responsive minimum size (smaller on pointer devices, 44px on touch devices) without breaking existing minimum widths for standard buttons.

Changes:

  • Introduces a shared CSS variable (interactiveAreaSize) to represent the minimum interactive area, switching values via mq.touchableOnly.
  • Enforces minimum width using min-width: max(existingMinWidth, interactiveAreaSize) so only undersized link buttons expand.
  • Enforces minimum height by applying a min-height to the internal textContent container (accounting for button border) to reach the target touch size while keeping content vertically centered.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 3, 2026

Deploy preview for mistica-web ready!

Project:mistica-web
Status: ✅  Deploy successful!
Preview URL:https://mistica-6tx7enfz9-flows-projects-65bb050e.vercel.app
Latest Commit:dc8c85a

Deployed with vercel-action

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 3, 2026

Accessibility report
✔️ No issues found

ℹ️ You can run this locally by executing yarn audit-accessibility.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 3, 2026

Screenshot tests report

✔️ All passing

… (WCAG 2.5.5)

Buttons and button links did not guarantee the minimum touch target size
required by WCAG 2.5.5 / ABNT-ANATEL. Short button links (eg. "Fazer recarga"
in a card) and small buttons fell below the minimum, failing the Android
Accessibility Scanner.

Following the chip/switch-component pattern, add a transparent `::after`
overlay that enforces a 48px minimum interactive area ONLY on touchable
devices. The overlay is absolutely positioned and overflows the button when
it's smaller than 48px, so it does NOT affect the layout nor the visible
button size (per design spec #2548 / DSNCORE-2286). It self-limits via
min(0px, ...), so default buttons (already >=48px) are untouched.

Because the overlay must not be clipped, the button's `overflow: hidden`
(used to clip the loading animation) is moved to an inner content wrapper.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@AlexandraGallipoliRodrigues AlexandraGallipoliRodrigues force-pushed the fix/button-min-touchable-area-web-2445 branch from a291767 to dc8c85a Compare June 3, 2026 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI AI Generated

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants