-
-
Notifications
You must be signed in to change notification settings - Fork 145
fix(a11y): improve focus outline contrast for keyboard navigation #650
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix(a11y): improve focus outline contrast for keyboard navigation #650
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
- Increase focus ring opacity from 10% to 50% in focus-ring shortcut - Add ring-offset-bg for consistent offset coloring - Update input-base focus states (border-fg/50, ring-fg/30) for better visibility - Change link focus outline from var(--border) to var(--fg-muted) for WCAG compliance Fixes npmx-dev#647
- Settings Toggle: add focus-visible ring styles to switch button - CollapsibleSection: add focus styles to anchor link heading - tag shortcut: add focus-visible styles for interactive tags/badges
a85c0cc to
b6701f9
Compare
|
@whitep4nth3r Thanks for the detailed review! I've pushed updates addressing the feedback:
Also rebased on latest main. Let me know if there are any other elements that need attention! |
|
Wondering; could the accent color be used as the base color for setting the outline color, possibly mixing it, to make it darker/lighter if needed? |
Match the search page input styling with focus-visible:ring-2
|
@whitep4nth3r Good catches! Just pushed a fix for the compare page input field - it was missing the focus ring entirely. For the top bar inconsistencies, I think you're right that there's some mixing of styles. I'll dig into that - looks like some elements might be using browser defaults or conflicting focus classes. The partial/clipped focus rings (like on the version selector) are interesting - I suspect it's an overflow issue where the parent container clips the ring. I'll investigate. Quick question on the sidebar links: would you prefer they all have full focus rings, or is the underline acceptable for inline text links? Happy to make them consistent either way - just want to check if there's a preferred pattern for the project. |
|
@thasmo That's an interesting idea! Using the accent color could make the focus rings feel more intentional and integrated with the design system. Currently I'm using Maybe something like |
|
Thanks for looking into everything! I would go with full focus rings throughout. |
|
Perfect, full rings it is! I'll work through the remaining elements and push an update. |
- Remove inconsistent ring-accent/50 styles, use ring-fg/50 everywhere - Add ring-offset for proper spacing on inputs - Use focus-ring shortcut consistently for buttons/links - Fix header nav links, search inputs, mobile menu, modals
|
Pushed a bigger update that standardizes focus rings across the codebase: Fixed:
The issue was some components were using Still need to look at the version selector clipping issue, will dig into that next. |
Was using undefined 'ring-ring' color, now uses consistent focus-ring shortcut
@JarvisInvestInsight, I guess it might not be so easy to just use the same opacity/formula for all existing colors, so I don't have an answer for that. 😅 I think you're doing a great job by fixing the focus/outline issues, and maybe we can bring the topic to the a11y channel in Discord. There are already some ideas about font settings as well etc. Maybe also a high-contrast mode would make sense, but I'm no A11Y expert by all means. But maybe we can throw some requirements together and revamp the settings/colors along the way without bloating the scope too much. 🙂 |
|
Agreed, let's keep this PR focused on the focus ring fixes. Happy to jump into the a11y channel on Discord to discuss fonts, high-contrast mode, and other improvements - sounds like a good opportunity to scope out a broader a11y roadmap for the project. |











Summary
This PR fixes the focus outline contrast issues reported in #647. Keyboard users couldn't see focus indicators due to very low opacity values.
Changes
uno.config.tsfocus-ring: Changedring-fg/10toring-fg/50for visible focus ringsring-offset-bgfor consistent offset coloringinput-base: Changedborder-fg/40toborder-fg/50andring-fg/10toring-fg/30app/assets/main.cssvar(--border)tovar(--fg-muted)for better contrastTesting
Tab through interactive elements in both light/dark mode - focus indicators are now visible.
Fixes #647
Found this helpful? ☕ Buy me a coffee