Skip to content

Restore visible focus outlines for keyboard accessibility#5829

Open
DhyaniKavya wants to merge 3 commits intosugarlabs:masterfrom
DhyaniKavya:fix/restore-focus-outline-accessibility
Open

Restore visible focus outlines for keyboard accessibility#5829
DhyaniKavya wants to merge 3 commits intosugarlabs:masterfrom
DhyaniKavya:fix/restore-focus-outline-accessibility

Conversation

@DhyaniKavya
Copy link
Contributor

@DhyaniKavya DhyaniKavya commented Feb 20, 2026

issue: #5828

Problem:-
A global CSS rule removes focus outlines from all elements:

*:focus { outline: none; }

-This prevents visible focus indicators across the interface.
-Keyboard users cannot identify the currently focused element
-Focus visibility is essential for navigation using the Tab key
-Removing outlines creates an accessibility barrier
-Violates WCAG 2.4.7 (Focus Visible) guidelines
-While the UI appears unchanged for mouse users, keyboard and assistive technology users lose critical navigation feedback.

Solution:-
-This PR restores visible focus indicators while preserving the visual design.
-removes the global suppression of focus outlines
-introduces an accessible :focus-visible style
-ensures focus rings appear for keyboard navigation only
-does not affect layout, spacing, or existing UI behavior

Changes Made:-
-Files modified:

css/activities.css
-> removed global *:focus { outline: none; } rule
-> added accessible :focus-visible styling

css/style.css
-> ensured consistent focus-visible styling (if applicable)

Testing Performed:-
-Manual Verification
-Navigated interface using the Tab key
-Verified visible focus indicator appears on interactive elements
-Confirmed mouse clicks do not show unnecessary focus rings
-Verified no layout or visual regressions
-Confirmed focus order remains logical
-Automated Checks

CSS lint: ✅ no syntax issues
Build: ✅ successful

Impact:-
-Restores visible focus indicators for keyboard users
-Improves accessibility and usability
-Aligns with WCAG accessibility guidelines
-Enhances inclusive user experience
-No breaking changes

Notes:-
This change is intentionally minimal and non-breaking. It restores accessibility compliance while maintaining the existing visual design. The implementation uses :focus-visible to ensure focus indicators appear only during keyboard navigation.

Happy to adjust styling if maintainers prefer a different focus appearance.

  • Bug Fix

@github-actions
Copy link
Contributor

✅ All Jest tests passed! This PR is ready to merge.

@Commanderk3
Copy link
Member

Commanderk3 commented Feb 20, 2026

@walterbender Looks good to me. Although I'm not certain if the linting was necessary.

@DhyaniKavya
Copy link
Contributor Author

@Commanderk3 Thank you for reviewing
I ran Prettier to ensure formatting consistency, but I understand that it can introduce unnecessary diffs. I’ll avoid formatting-only changes in future PRs and keep them strictly minimal and issue-focused.

@DhyaniKavya
Copy link
Contributor Author

@walterbender @omsuneri Please review the changes . If anything needs to change, I am open to address it.

Copy link
Contributor

@vanshika2720 vanshika2720 left a comment

Choose a reason for hiding this comment

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

@DhyaniKavya The accessibility fix is correct and appreciated. However, this PR includes large formatting-only changes which make review difficult.

Could you please separate the focus outline fix into a minimal PR and move formatting changes into a separate formatting-only PR?

Copy link
Contributor

@zealot-zew zealot-zew left a comment

Choose a reason for hiding this comment

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

we wouldn't be needing this as focus is present for the specific buttons.

@walterbender
Copy link
Member

Please resolve the conflict. Otherwise it looks good.

@DhyaniKavya
Copy link
Contributor Author

Sure . I will resolve them asap

@github-actions
Copy link
Contributor

github-actions bot commented Mar 9, 2026

❌ Some Jest tests failed. Please check the logs and fix the issues before merging.

Failed Tests:

GraphicsBlocks.test.js

@github-actions github-actions bot added the bug fix Fixes a bug or incorrect behavior label Mar 9, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 9, 2026

❌ Some Jest tests failed. Please check the logs and fix the issues before merging.

Failed Tests:

GraphicsBlocks.test.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug fix Fixes a bug or incorrect behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants