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

PageLayout: Use HTML5 landmark elements #1973

Merged
merged 7 commits into from
Mar 23, 2022
Merged

PageLayout: Use HTML5 landmark elements #1973

merged 7 commits into from
Mar 23, 2022

Conversation

colebemis
Copy link
Contributor

@colebemis colebemis commented Mar 17, 2022

Based on @alliethu's recommendation in her accessibility review, the PageLayout component now renders HTML5 landmark elements (header, aside, footer) to improve the navigation experience for people using assistive technologies (like screen readers).

html5 landmarks in pagelayout component

Merge checklist

  • Added/updated tests
  • Added/updated documentation
  • Tested in Chrome
  • Tested in Firefox
  • Tested in Safari
  • Tested in Edge

Take a look at the What we look for in reviews section of the contributing guidelines for more information on how we review PRs.

because the dividers are only decorative
@changeset-bot
Copy link

changeset-bot bot commented Mar 17, 2022

🦋 Changeset detected

Latest commit: 8106309

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/react Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Mar 17, 2022

size-limit report 📦

Path Size
dist/browser.esm.js 63.61 KB (+0.02% 🔺)
dist/browser.umd.js 63.95 KB (+0.02% 🔺)

@@ -286,6 +286,7 @@ const Pane: React.FC<PageLayoutPaneProps> = ({
const computedDividerWhenNarrow = dividerWhenNarrow === 'inherit' ? divider : dividerWhenNarrow
return (
<Box
as="aside"
Copy link
Contributor Author

@colebemis colebemis Mar 17, 2022

Choose a reason for hiding this comment

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

Waiting on an answer to this question about <aside>: https://github.com/github/primer/issues/782#issuecomment-1069606557

@colebemis colebemis marked this pull request as ready for review March 17, 2022 05:04
@colebemis colebemis requested review from a team and siddharthkp March 17, 2022 05:04
@@ -114,7 +114,6 @@ const HorizontalDivider: React.FC<DividerProps> = ({variant = 'none', variantWhe
const {padding} = React.useContext(PageLayoutContext)
return (
<Box
role="separator"
Copy link
Collaborator

Choose a reason for hiding this comment

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

ooh interesting, what does removing this do?

Copy link
Member

@siddharthkp siddharthkp Mar 17, 2022

Choose a reason for hiding this comment

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

If doesn't have role= separator, should this have aria-hidden=true instead?

Made that exact change for ActionList.Divider: #1757

Choose a reason for hiding this comment

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

Good callout @siddharthkp. I believe my recommendation was to use both role="presentation" and aria-hidden="true". @colebemis, I'll update the recommendation in the a11y review issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is this necessary to do on a div element?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Without adding role or aria-hidden, it like looks divider already does not appear in the accessibility tree:

CleanShot 2022-03-17 at 16 25 07@2x

What do role and aria-hidden do for us in this case?

Copy link
Member

Choose a reason for hiding this comment

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

Ooh because it's an empty div, it would probably just get "Ignored" in the tree

Copy link
Contributor

@rezrah rezrah left a comment

Choose a reason for hiding this comment

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

👍 nice

Copy link
Member

@siddharthkp siddharthkp left a comment

Choose a reason for hiding this comment

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

other than the Divider, everything looks good to me!

@colebemis colebemis enabled auto-merge (squash) March 23, 2022 17:04
@colebemis colebemis temporarily deployed to visual-testing March 23, 2022 17:22 Inactive
@colebemis colebemis merged commit adbcd3b into main Mar 23, 2022
@colebemis colebemis deleted the page-layout-a11y branch March 23, 2022 17:27
@primer-css primer-css mentioned this pull request Mar 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants