Skip to content
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

WCAG 2.4.7 AA: Link has no visible focus indicator (Issue 29) #364

Closed
CJE001 opened this issue Sep 13, 2024 · 0 comments · Fixed by #395
Closed

WCAG 2.4.7 AA: Link has no visible focus indicator (Issue 29) #364

CJE001 opened this issue Sep 13, 2024 · 0 comments · Fixed by #395
Assignees
Labels
A11y Issue is related to accessibility Type: Defect Issue is a defect

Comments

@CJE001
Copy link

CJE001 commented Sep 13, 2024

Summary

Via Vision Australia assessment: August 2024

Impact: medium

Note: DTA have a 90 day remediation period to address the identified issues within the audit, all issues must be resolved to obtain WCAG 2.2 certification for digital.gov.au.

Steps to reproduce

Global issue – Back to top link
digital.gov.au beta | digital.gov.au (https://www.digital.gov.au)

Observed outcome

The back to top link does not have a visible focus indicator when it receives keyboard focus. The element has been given an outline-colour of transparent in the CSS.

Picture17

Code used

.ct-back-to-top .ct-back-to-top__button, .ct-back-to-top .ct-back-to-top__button:focus, .ct-back-to-top .ct-back-to-top__button:active, .ct-back-to-top .ct-back-to-top__button:visited, .ct-back-to-top .ct-back-to-top__button:hover {
border-radius: 6rem;
padding: .5rem;
background-color: var(--ct-color-light-interaction-background);
border-color: var(--ct-color-light-interaction-background);
color: var(--ct-color-light-interaction-text);
line-height: 0;
outline-color: rgba(0,0,0,0);
}

Why this matters

Without a highly visible focus indicator, sighted keyboard users may have difficulty determining what element has keyboard focus. They may have trouble activating controls or interacting with the content.

Expected outcome

Ensure that all focusable elements have a highly visible focus indicator when they receive keyboard focus. Preferably, this should be a solid border that surrounds the component.

Ensure that the contrast ratio between the focus indicator and the adjacent background is at least 3:1.

Code example

:focus-visible {
outline: 3px solid black;
box-shadow: 0 0 0 6px white;
outline-offset: .2rem;
}

Note

When customising focus indicators, it may be necessary to design multiple versions to ensure sufficient contrast with all component and background variations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A11y Issue is related to accessibility Type: Defect Issue is a defect
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants