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

A11y: provide content skip links for keyboard/screen reader users #1153

Closed
RyKilleen opened this issue Nov 19, 2018 · 16 comments · Fixed by #13503
Closed

A11y: provide content skip links for keyboard/screen reader users #1153

RyKilleen opened this issue Nov 19, 2018 · 16 comments · Fixed by #13503
Assignees
Labels
area: accessibility issues that need accessibility improvements (a11y) changelog: rollup Items that will be communicated in our monthly rollup changelogs internal team only internal tasks only for Forem team members size: estimated XS less than a few days to complete tech: frontend changes will primarily involve frontend technologies

Comments

@RyKilleen
Copy link
Contributor

Is your feature request related to a problem? Please describe.
When users navigate a page with keyboard tabbing, screen readers, or other assistive technology, a useful pattern is to provide a "Skip to Main Content' skip link before navigation or long lists (Tags list, etc).

Describe the solution you'd like
A visible skip link that pops up when a user has tabbed into an element like the nav or long tags list.

Additional context
https://webaim.org/techniques/skipnav/

@Link2Twenty
Copy link
Contributor

Link2Twenty commented Nov 20, 2018

This is part of the WCAG spec
2.4.1 Bypass Blocks: A mechanism is available to bypass blocks of content that are repeated on multiple Web pages. (Level A)

Useful links:
https://www.w3.org/TR/UNDERSTANDING-WCAG20/navigation-mechanisms-skip.html
https://www.w3.org/WAI/WCAG21/quickref/?versions=2.0&showtechniques=241#qr-navigation-mechanisms-skip

@Zhao-Andy Zhao-Andy added the area: accessibility issues that need accessibility improvements (a11y) label Nov 21, 2018
@jessleenyc jessleenyc added the external contributors welcome contribution is welcome! label Nov 21, 2018
@jessleenyc
Copy link
Contributor

Thanks for the feature request. This is approved if anyone wants to jump on it!

@Link2Twenty
Copy link
Contributor

Just to add to this, I had to press the tab button 80 times before I could go to the first post.

@Link2Twenty
Copy link
Contributor

Link2Twenty commented Feb 14, 2019

Adding this to just before the dev logo in the nav

<a href="#articles-list" class="skip-content">Skip to content</a>

and this to your CSS

.skip-content {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translatex(-50%);
  background: black;
  color: white;
  z-index: 9999;
  padding: 13px;
  cursor: default;
  pointer-events: none;
  opacity: 0;
}

.skip-content:focus {
  pointer-events: auto;
  opacity: 1;
}

Normal view:
image
Focused view:
image

Which is not something the everyday user would notice. But would make life, hopefully, a lot easier for keyboard users.

Thoughts?

@RyKilleen
Copy link
Contributor Author

RyKilleen commented Feb 15, 2019

@Link2Twenty I think this demonstrates a great, straight-forward implementation! From WebAIM's site:

The verdict: This method works well for nearly all users. Sighted mouse users (who do not benefit from the link) do not see it, screen reader users will hear the link, and sighted keyboard users will see the link when they navigate to it.

@RyKilleen
Copy link
Contributor Author

Tackling this currently!

@maestromac
Copy link
Member

This is partially implemented am I correct?

@RyKilleen
Copy link
Contributor Author

Correct, right now it's a pretty naive implementation that only works on the home page.

@scottaohara
Copy link

Could there not be a unique ID that was added to the h1 of each post, so that the skip link could navigate people there?

Was rather excited to see there was a skip link on the site, and then was immediately disappointed to realize it didn't do anything on anyone's posts. :(

@RyKilleen
Copy link
Contributor Author

The most semantic route forward is probably to guarantee that an <main id="main-content"> tag exists around the content you want skipped to for any given template. That would keep it semantic and consistent without having to insert magic elements in specific spots for all templates.

@scottaohara
Copy link

"the most semantic route forward" is a debatable statement, but doing a quick audit of the site, a fair one based on the lack of proper heading structure / general misuse of heading for a good portion of the site that aren't people's posts.

That said, it seems that a main element w/id would also need to be properly added to the templates.

@rhymes rhymes removed the future label Jul 1, 2020
@nickytonline nickytonline added this to Inbox (existing issues) in Hacktoberfest potential via automation Sep 30, 2020
@nickytonline nickytonline moved this from Inbox (existing issues) to Hacktoberfest Worthy in Hacktoberfest potential Sep 30, 2020
@nickytonline nickytonline self-assigned this Oct 6, 2020
@colabottles
Copy link

@nickytonline I'll take a look at some point with this. Thanks!

@techieeliot
Copy link

Hey, @colabottles I'm working on issue #4807 but I'd love to help you out over a live stream sometime to finish this PR up.

@mstruve mstruve added size: estimated XS less than a few days to complete tech: frontend changes will primarily involve frontend technologies internal team only internal tasks only for Forem team members and removed external contributors welcome contribution is welcome! labels Feb 11, 2021
@nickytonline
Copy link
Contributor

Whoever takes this on, create small PRs. We can do one page at a time.

@mstruve mstruve added this to Backend Focused in Current Cycle Work Feb 11, 2021
@mstruve mstruve moved this from Backend Focused to Frontend Focused in Current Cycle Work Feb 11, 2021
@aitchiss aitchiss self-assigned this Feb 12, 2021
@aitchiss aitchiss moved this from Frontend Focused to In Progress 🖥 in Current Cycle Work Feb 12, 2021
Current Cycle Work automation moved this from In Progress 🖥 to DONE 🎉 Apr 27, 2021
@aitchiss
Copy link
Contributor

This issue is closed since we now have added the skip link functionality to all pages 🎉

There is a small piece of work remaining - currently when a user navigates internally (link click), the skip link isn't the first item focused on the new page. This is captured in #13505, should be a quick fix and once implemented users should be able to get the most out of the new skip links 😄

@aitchiss aitchiss added the changelog: rollup Items that will be communicated in our monthly rollup changelogs label Apr 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: accessibility issues that need accessibility improvements (a11y) changelog: rollup Items that will be communicated in our monthly rollup changelogs internal team only internal tasks only for Forem team members size: estimated XS less than a few days to complete tech: frontend changes will primarily involve frontend technologies
Projects
No open projects
Development

Successfully merging a pull request may close this issue.