Skip to content

feat(frontend): Accessibility audit - WCAG 2.1 AA compliance#722

Merged
Idrhas merged 3 commits into
Farm-credit:mainfrom
Uche44:feat/accessibility
Jul 7, 2026
Merged

feat(frontend): Accessibility audit - WCAG 2.1 AA compliance#722
Idrhas merged 3 commits into
Farm-credit:mainfrom
Uche44:feat/accessibility

Conversation

@Uche44

@Uche44 Uche44 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR resolves accessibility violations across the FarmCredit application by implementing WCAG 2.1 AA compliant keyboard navigation, color contrast, focus management, and ARIA markup. Key fixes include establishing an accessible primary foreground color in the light theme, implementing focus trapping/restoration in interactive overlays, and standardizing semantic markup across tables, buttons, and navigation elements.

Related Issue

Closes #540

What Was Implemented

  • Global Theme Contrast: Changed --primary-foreground from #ffffff to #0d0b21 (stellar-navy) to achieve an 8.27:1 contrast ratio on primary buttons, and increased --muted-foreground contrast to 6.14:1.
  • Success Buttons: Replaced white text with text-stellar-navy on green background buttons to ensure readable 4.5:1+ contrast.
  • Skip-to-Main Link: Added a visually hidden bypass skip link targeting #main-content at the body root in layout.tsx and wrapped pages in <main id="main-content"> wrappers.
  • Focus Trap & Restore: Built custom hook-free focus trapping (using Tab / Shift+Tab cycles) and element focus restoration inside the OnboardingTour modal overlay.
  • Form Sibling Focus: Nested hidden file inputs inside visual trigger labels in the project detail view, allowing :focus-within styles to render outline rings correctly during keyboard-only navigation.
  • Table Accessibility: Added semantic scopes (scope="col" and scope="row") to tables in the project view and order history pages.
  • Dynamic Status Regions: Tagged transaction loading containers and service worker install banners with role="status" and aria-live="polite".
  • ARIA Voice Duplication: Removed redundant screen-reader text and added aria-hidden="true" to SVG graphics inside social icons in the footer.
  • Build Prerendering Fixes: Wrapped the global layout in WalletProvider to ensure static page builds (such as /leaderboard) compile successfully without context mismatch errors.

Implementation Details

  • Tailwind Contrast Adjustments: Altered design tokens under light-theme variables in globals.css to seamlessly adjust color contrast across the entire app layout without needing individual inline styles.
  • Zero-Dependency Focus Trap: Implemented raw DOM selectors (querySelectorAll for focusable elements) inside the keydown listener of OnboardingTour to trap focus cleanly without bloated package dependencies.
  • Form Sibling Focus: Rather than using manual focus event handlers, wrapped <input type="file" className="sr-only"> inside the <label> button-styled trigger, using CSS :focus-within selectors to style focus rings automatically.

Screenshots / Recordings

(Please capture local browser screenshots/recordings of the skip-link, focus outline, and success button contrast to insert here.)

How to Test

  1. Format Code: Verify that all styling rules match Prettier:
    npm run format

@Idrhas

Idrhas commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Fix merge conflict and dont forget to Offramp your USDC on https://fundable.finance when you receive your rewards

@drips-wave

drips-wave Bot commented Jul 4, 2026

Copy link
Copy Markdown

@Uche44 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Uche44

Uche44 commented Jul 4, 2026

Copy link
Copy Markdown
Contributor Author

@Idrhas I've fixed it. Please merge so I get my points

@Idrhas
Idrhas merged commit cdb5462 into Farm-credit:main Jul 7, 2026
1 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(frontend): Accessibility audit - WCAG 2.1 AA compliance

2 participants