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

site a11y: add missing h1s #5715

Merged
merged 1 commit into from
Dec 24, 2020
Merged

site a11y: add missing h1s #5715

merged 1 commit into from
Dec 24, 2020

Conversation

geoffrich
Copy link
Member

This resolves one of the Axe accessibility violations listed in #5678: Page must contain a level-one heading

Several pages on the site were missing h1 elements. Without this element, it's more difficult for screen readers to jump to the main content of the page.

In order to not affect how the page looks, I applied a class to the headings to hide them visually but still allow them to be accessed by assistive tech.

Copy link
Member

@tanhauhau tanhauhau left a comment

Choose a reason for hiding this comment

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

amazing!

beside probably renaming .visually-hidden to something more meaningful, such as sr-only, or screen-reader-only?

@geoffrich
Copy link
Member Author

@tanhauhau the visually-hidden name was intentional, since screen readers are not the only assistive technology that can take advantage of this class.

Bootstrap used to name their equivalent class sr-only but will be switching to visually-hidden in version 5. This class name is also used in by several a11y-focused sites in tutorials on hiding content (e.g. The A11y Project).

@Conduitry Conduitry merged commit 6aaa105 into sveltejs:master Dec 24, 2020
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.

4 participants