🎨 Palette: Keyboard Accessibility for Interactive Cards#11
Conversation
- Added `role="button"` and `tabIndex={0}` to `ProjectCard` and `ExperienceCard` root `motion.div` elements.
- Implemented `onKeyDown` handlers to trigger click events when 'Enter' or 'Space' are pressed.
- Added `focus-visible` Tailwind classes to provide clear visual indicators for keyboard navigation.
- Fixed a `__dirname` resolution issue in `vite.config.js`.
- Configured ESLint to ignore unused `motion` variables to fix lint errors.
- Documented learning in `.Jules/palette.md`.
Co-authored-by: Dev22603 <92785712+Dev22603@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
✅ Deploy Preview for dev-bachani ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
🎨 Palette: Keyboard Accessibility for Cards
💡 What:
Added native keyboard accessibility (tab navigation and Enter/Space activation) to the custom interactive
ProjectCardandExperienceCardcomponents.🎯 Why:
These cards used
motion.divwith anonClickhandler to act as clickable elements. While this works for mouse users, it completely breaks the experience for keyboard navigators and screen readers, as non-interactive elements are typically skipped in tab order and do not respond to standard keyboard interactions. This change ensures a fully inclusive and navigable experience for all users.📸 Before/After:
(Visual changes are limited to a new focus outline when navigating via keyboard, tested via Playwright validation).
♿ Accessibility:
role="button"to inform screen readers of the element's purpose.tabIndex={0}to make the cards focusable in standard tab order.onKeyDownhandler to captureEnterandSpacekey presses to emulate clicks, matching standard<button>behavior.focus-visiblering utilities to ensure users clearly see which card is currently focused.PR created automatically by Jules for task 1765313374384205503 started by @Dev22603