Skip to content

Conversation

@ada-workbackai
Copy link

Summary

Fixes WCAG 2.4.1 (Bypass Blocks) by ensuring the skip navigation link becomes visible when keyboard users tab to it.

Issue: The skip-to-content link was permanently positioned off-screen (left: -100%) and never became visible even when focused, preventing keyboard-only users from using it effectively.

Solution: Added :focus-within pseudo-class to the CSS selector so the skip link appears when any child link receives focus.

Technical Details

The original CSS only used :host:focus, but this doesn't work for web components because:

  • Focus goes to the <a> element inside the shadow DOM
  • The :host element itself never receives focus
  • The :focus-within pseudo-class properly detects when descendants are focused

Test Plan

  • Tab to the skip link from the address bar - it now becomes visible
  • Press Enter on the skip link - focus jumps to main content
  • Skip link is hidden by default until focused
  • Works on all pages that use the component

Evidence

Before/after testing demonstrates the skip link now appears when focused, meeting WCAG 2.4.1 requirements.


WCAG Reference:
2.4.1 Bypass Blocks

Add :focus-within pseudo-class to make skip navigation link visible when
keyboard users tab to it. Previously the link remained off-screen even
when focused, preventing keyboard-only users from using it effectively.

This fixes WCAG 2.4.1 (Bypass Blocks) compliance by ensuring the skip
link becomes visible on focus, allowing users to bypass repetitive
navigation elements.
@ada-workbackai
Copy link
Author

Fixes Workback.ai accessibility issue #131 (WCAG 2.4.1 - Bypass Blocks).

Evidence and testing: https://app.workback.ai/dashboard/issue/131/

@ada-workbackai
Copy link
Author

Fixed prettier formatting check by updating CONTRIBUTING.md formatting. CI should pass now.

@ada-workbackai
Copy link
Author

All CI checks are now passing. Ready for review.

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.

2 participants