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

Fix accessibility issues on homepage and individual article pages #2160

Merged
merged 10 commits into from
Jan 8, 2021
Merged

Fix accessibility issues on homepage and individual article pages #2160

merged 10 commits into from
Jan 8, 2021

Conversation

barrymcgee
Copy link
Contributor

@barrymcgee barrymcgee commented Dec 16, 2020

Why:

Accessibility can nearly always be improved. This site was already built with accessibility clearly in mind but I noticed some remaining issues flagged in my aXe accessibility browser plugin so I thought I'd address them.

Fixes #2159

What's being changed:

  • Removed aria-hidden link wrapping the Github logo mark in the site header from the tab index so it's no longer keyboard accessible. This means keyboard users will skip straight to the next link around 'Github docs' which is the same.
  • Make headings semantic and ensuring they only increment by one sequentially while maintaining the current visual styling.
  • Wrap sidebar navigation in <nav> sectioning element to confer semantic meaning.
  • Fix up incorrectly nested <ul>'s in the sidebar navigation
  • Fix up duplicate nested <main> elements on article pages - there should only be one per page.

Each commit for each change has a link containing full supplementary rationale.

The biggest remaining issues are coming from the third party Agolia search box which is out of my control and there are also some color contrast issues but that will require collaboration and sign off from a designer.

Lighthouse Accessibilty score on production:

Screenshot 2020-12-16 at 14 35 47

Lighthouse Accessibilty score on this Heroku demo:

Screenshot 2020-12-16 at 14 36 50

Check off the following:

  • All of the tests are passing.
  • I have reviewed my changes in staging. (look for the deploy-to-heroku link in your pull request, then click View deployment)

Not applicable:

@welcome
Copy link

welcome bot commented Dec 16, 2020

Thanks for opening this pull request! A GitHub docs team member should be by to give feedback soon. In the meantime, please check out the contributing guidelines.

@janiceilene
Copy link
Contributor

@barrymcgee Thanks so much for opening a PR! I'll get this triaged for review 💖

@janiceilene janiceilene added the engineering Will involve Docs Engineering label Dec 16, 2020
@github-actions
Copy link
Contributor

This PR is stale because it has been open 7 days with no activity and will be automatically closed in 3 days. To keep this PR open, update the PR by adding a comment or pushing a commit.

@github-actions github-actions bot added the stale There is no recent activity on this issue or pull request label Dec 26, 2020
@barrymcgee
Copy link
Contributor Author

Holiday break 🎅

@github-actions github-actions bot removed the stale There is no recent activity on this issue or pull request label Dec 27, 2020
@mmnbmm23

This comment has been minimized.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 4, 2021

This PR is stale because it has been open 7 days with no activity and will be automatically closed in 3 days. To keep this PR open, update the PR by adding a comment or pushing a commit.

@github-actions github-actions bot added the stale There is no recent activity on this issue or pull request label Jan 4, 2021
@barrymcgee
Copy link
Contributor Author

Bumping this once more as we're now just out of the holiday period and I'm hopeful it might get reviewed this week.

@github-actions github-actions bot removed the stale There is no recent activity on this issue or pull request label Jan 5, 2021
Copy link
Contributor

@heiskr heiskr left a comment

Choose a reason for hiding this comment

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

👋🏼 Hi @barrymcgee , this looks pretty great. I think this checks one or two boxes in #141 as well.

We have an automated accessibility script we run once a day, pa11y-ci in the repo as well. I checked out this branch and ran npm run pa11y-test on it. I'm seeing the form issue you've mentioned:

 • This form does not contain a submit button, which creates issues for those
   who cannot submit the form using the keyboard. Submit buttons are INPUT
   elements with type attribute "submit" or "image", or BUTTON elements with
   type "submit" or omitted/invalid.

   (html > body > main > div:nth-child(1) > header > div:nth-child(2) > div >
   div > div > div:nth-child(2) > div:nth-child(2) > form)

   <form class="mb-0"> <div id="search-input-contai...</form>

I think this is coming from https://github.com/algolia/instantsearch.js/. That said, the actual form element in question is here:
https://github.com/github/docs/blob/main/includes/search-form.html So I think we could move up the aria-hidden to the form element and no longer get that message.

But this is definitely an upgrade as is.

@barrymcgee barrymcgee requested a review from a team as a code owner January 7, 2021 16:48
@barrymcgee
Copy link
Contributor Author

@heiskr Thank you for your review! I've made your suggested change and the pa11y-test check now passes without error.

@heiskr
Copy link
Contributor

heiskr commented Jan 7, 2021

It looks like the heading level change had the side effect of breaking a few "rendering" tests

@barrymcgee
Copy link
Contributor Author

@heiskr Sorry, now rebased and all fixed up.

@chiedo chiedo merged commit 98e74a5 into github:main Jan 8, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Jan 8, 2021

Thanks very much for contributing! Your pull request has been merged 🎉 You should see your changes appear on the site in approximately 24 hours.

@chiedo
Copy link
Contributor

chiedo commented Jan 8, 2021

Thanks for the contribution @barrymcgee!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
engineering Will involve Docs Engineering
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Accessibility audit is flagging markup errors
6 participants