fix(card): small quiet action menu a11y #5879
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes keyboard accessibility issues for action buttons in small, quiet variant Cards. The action buttons are now accessible via keyboard navigation and become visible when focused.
Changes made:
visibility: hiddentoopacity: 0to keep elements in the accessibility tree:focus-withinCSS rule to make actions visible when any child element receives focusfocusableattribute to the action button slotMotivation and context
Small quiet Cards with action buttons were not keyboard accessible. The action menu button had
visibility: hiddenexcept on:hoveror:focus-within, which prevented the button from receiving focus unless the Card was hovered. This made it impossible for keyboard-only users to access critical card actions.The fix changes the visibility approach to use
opacity: 0instead, which keeps elements in the accessibility tree while maintaining the same visual behavior. Action buttons now properly receive focus and become visible when navigating with the keyboard.Related issue(s)
Screenshots (if appropriate)
Screenshots will be added showing keyboard focus behavior before and after the fix.
Before 🚫
Only after hovering with a mouse can
Tabenter the card to focus the action menu button.Screen.Recording.2025-11-24.at.1.43.50.PM.mov
After ✅
With a mouse not hovering, tab can enter the card to focus on the action menu button.
Screen.Recording.2025-11-24.at.1.44.28.PM.mov
Author's checklist
I have added automated tests to cover my changes. (N/A - CSS-only changes, existing functionality unchanged)I have included updated documentation if my change required it. (N/A - no documentation updates needed)Reviewer's checklist
patch,minor, ormajorfeaturesAutomated tests cover all use cases and follow best practices for writing (N/A - CSS-only changes)Manual review test cases
Keyboard navigation to action buttons in small quiet Cards
Visual state consistency between hover and focus
Screen reader announces action buttons correctly
Device review