-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Updated accessibility docs #109
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
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
# Basics | ||
|
||
Web accessibility (also known as a11y) refers to the practice of creating websites that can be used by anyone — be that a person with a disability, a slow connection, outdated or broken hardware or simply someone in an unfavorable environment. For example, adding subtitles to a video would help both your deaf and hard-of-hearing users and your users who are in a loud environment and can't hear their phone. Similarly, making sure your text isn't too low contrast will help both your low-vision users and your users who are trying to use their phone in bright sunlight. | ||
|
||
Ready start but aren’t sure where? | ||
mlama007 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Checkout the [Planning and managing web accessibility guide](https://www.w3.org/WAI/planning-and-managing/) provided by [World Wide Web Consortium (W3C)](https://www.w3.org/) | ||
mlama007 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## Skip link | ||
|
||
You should add a link at the top of each page that goes directly to the main content area so users can skip content that is repeated on multiple Web pages. | ||
mlama007 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Typically this is done on the top of `App.vue` as it will be the first focusable element on all your pages: | ||
mlama007 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
``` html | ||
<ul class="skip-links"> | ||
<li> | ||
<a href="#main" ref="skipLink">Skip to main content</a> | ||
</li> | ||
</ul> | ||
``` | ||
|
||
To hide the link unless it is focused, you can add the following style: | ||
|
||
``` css | ||
.skipLink { | ||
white-space: nowrap; | ||
margin: 1em auto; | ||
top: 0; | ||
position: fixed; | ||
left: 50%; | ||
margin-left: -72px; | ||
opacity: 0; | ||
} | ||
.skipLink:focus { | ||
opacity: 1; | ||
background-color: white; | ||
padding: .5em; | ||
border: 1px solid black; | ||
} | ||
``` | ||
|
||
Once a user changes route, bring focus back to the skip link. This can be achieved by calling focus to the `ref` provided above: | ||
mlama007 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
``` vue | ||
<script> | ||
export default { | ||
watch: { | ||
$route() { | ||
this.$refs.skipLink.focus(); | ||
} | ||
} | ||
}; | ||
</script> | ||
``` | ||
|
||
<p class="codepen" data-height="350" data-theme-id="light" data-default-tab="js,result" data-user="mlama007" data-slug-hash="VwepxJa" style="height: 350px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border: 2px solid; margin: 1em 0; padding: 1em;" data-pen-title="Skip to Main"> | ||
<span>See the Pen <a href="https://codepen.io/mlama007/pen/VwepxJa"> | ||
Skip to Main</a> by Maria (<a href="https://codepen.io/mlama007">@mlama007</a>) | ||
on <a href="https://codepen.io">CodePen</a>.</span> | ||
</p> | ||
<script async src="https://static.codepen.io/assets/embed/ei.js"></script> | ||
|
||
[Read documentation on skip link to main content](https://www.w3.org/WAI/WCAG21/Techniques/general/G1.html) | ||
mlama007 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## Structure Your Content | ||
|
||
One of the most important pieces of accessibility is making sure that design can support accessible implementation. Design should consider not only color contrast, font selection, text sizing, and language, but also how the content is structured in the application. | ||
|
||
### Headings | ||
|
||
Users can navigate an application through headings. Having descriptive headings for every section of your application makes it easier for users to predict the content of each section. When it comes to headings, there are a couple of recommended accessibility practices: | ||
|
||
- Nest headings in their ranking order: `<h1>` - `<h6>` | ||
- Don’t skip headings within a section | ||
- Use actual heading tags instead of styling text to give the visual appearance of headings | ||
|
||
[Read more about headings](https://www.w3.org/TR/UNDERSTANDING-WCAG20/navigation-mechanisms-descriptive.html) | ||
|
||
```html | ||
<main role="main" aria-labelledby="main-title"> | ||
<h1 id="main-title">Main title</h1> | ||
<section aria-labelledby="section-title"> | ||
<h2 id="section-title"> Section Title </h2> | ||
<h3>Section Subtitle</h3> | ||
<!-- Content --> | ||
</section> | ||
<section aria-labelledby="section-title"> | ||
<h2 id="section-title"> Section Title </h2> | ||
<h3>Section Subtitle</h3> | ||
<!-- Content --> | ||
<h3>Section Subtitle</h3> | ||
<!-- Content --> | ||
</section> | ||
</main> | ||
``` | ||
|
||
### Landmarks | ||
|
||
Landmarks provide programmatic access to sections within an application. Users who rely on assistive technology can navigate to each section of the application and skip over content. You can use [ARIA roles](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles) to help you achieve this. | ||
|
||
| HTML | ARIA Role | Landmark Purpose | | ||
| --------------- | ----------------------------------------------------------------- | -------------------------------------------------------------------------------------- | | ||
| header | role="banner" | Prime heading: title of the page | | ||
| nav | role="navigation" | Collection of links suitable for use when navigating the document or related documents | | ||
| main | role="main" | The main or central content of the document. | | ||
| footer | role="contentinfo" | Information about the parent document: footnotes/copyrights/links to privacy statement | | ||
| aside | role="complementary" | Supports the main content, yet is separate and meaningful on its own content | | ||
| _Not available_ | role="search" | This section contains the search functionality for the application | | ||
| form | role="form" | Collection of form-associated elements | | ||
| section | role="region" | Content that is relevant and that users will likely want to navigate to. Label must be provided for this element | | ||
|
||
:::tip Tip: | ||
It is recommended to use landmark HTML elements with redundant landmark role attributes in order to maximize compatibility with legacy [browsers that don’t support HTML5 semantic elements](https://caniuse.com/#feat=html5semantic). | ||
::: | ||
|
||
[Read more about landmarks](https://www.w3.org/TR/wai-aria-1.2/#landmark_roles) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Resources | ||
|
||
## Documentation | ||
|
||
- [WCAG 2.0](https://www.w3.org/TR/WCAG20/) | ||
- [WCAG 2.1](https://www.w3.org/TR/WCAG21/) | ||
- [Accessible Rich Internet Applications (WAI-ARIA) 1.2](https://www.w3.org/TR/wai-aria-1.2/) | ||
- [WAI-ARIA Authoring Practices 1.2](https://www.w3.org/TR/wai-aria-practices-1.2/) | ||
|
||
## Assistive Technologies | ||
|
||
- Screen Readers | ||
- [NVDA](https://www.nvaccess.org/download/) | ||
- [VoiceOver](https://www.apple.com/accessibility/mac/vision/) | ||
- [JAWS](https://www.freedomscientific.com/products/software/jaws/?utm_term=jaws%20screen%20reader&utm_source=adwords&utm_campaign=All+Products&utm_medium=ppc&hsa_tgt=kwd-394361346638&hsa_cam=200218713&hsa_ad=296201131673&hsa_kw=jaws%20screen%20reader&hsa_grp=52663682111&hsa_net=adwords&hsa_mt=e&hsa_src=g&hsa_acc=1684996396&hsa_ver=3&gclid=Cj0KCQjwnv71BRCOARIsAIkxW9HXKQ6kKNQD0q8a_1TXSJXnIuUyb65KJeTWmtS6BH96-5he9dsNq6oaAh6UEALw_wcB) | ||
- [ChromeVox](https://chrome.google.com/webstore/detail/chromevox-classic-extensi/kgejglhpjiefppelpmljglcjbhoiplfn?hl=en) | ||
- Zooming Tools | ||
- [MAGic](https://www.freedomscientific.com/products/software/magic/) | ||
- [ZoomText](https://www.zoomtext.com/) | ||
- [Magnifier](https://support.microsoft.com/en-us/help/11542/windows-use-magnifier-to-make-things-easier-to-see) | ||
|
||
## Testing | ||
|
||
- Automated Tools | ||
- [Lighthouse](https://chrome.google.com/webstore/detail/lighthouse/blipmdconlkpinefehnmjammfjpmpbjk) | ||
- [WAVE](https://chrome.google.com/webstore/detail/wave-evaluation-tool/jbbplnpkjmmeebjpijfedlgcdilocofh) | ||
|
||
- Color Tools | ||
- [WebAim Color Contrast](https://webaim.org/resources/contrastchecker/) | ||
- [WebAim Link Color Contrast](https://webaim.org/resources/linkcontrastchecker) | ||
|
||
- Other Helpful Tools | ||
- [HeadingMap](https://chrome.google.com/webstore/detail/headingsmap/flbjommegcjonpdmenkdiocclhjacmbi?hl=en…) | ||
|
||
- [Color Oracle](https://colororacle.org) | ||
|
||
- [Focus Indicator](https://chrome.google.com/webstore/detail/focus-indicator/heeoeadndnhebmfebjccbhmccmaoedlf?hl=en-US…) | ||
|
||
- [NerdeFocus](https://chrome.google.com/webstore/detail/nerdefocus/lpfiljldhgjecfepfljnbjnbjfhennpd?hl=en-US…) | ||
|
||
## Users | ||
|
||
The World Health Organization estimates that 15% of the world's population has some form of disability, 2-4% of them severely so. That is an estimated 1 billion people worldwide; making people with disabilities the largest minority group in the world. | ||
mlama007 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
There are a huge range of disabilities, which can be divided roughly into four categories: | ||
|
||
- _[Visual](https://webaim.org/articles/visual/)_ - These users can benefit from the use of screen readers, screen magnification, controlling screen contrast, or braille display. | ||
|
||
- _[Auditory](https://webaim.org/articles/auditory/)_ - These users can benefit from captioning, transcripts or sign language video. | ||
|
||
- _[Motor](https://webaim.org/articles/motor/)_ - These users can benefit from a range of [assistive technologies for motor impairments](https://webaim.org/articles/motor/assistive): voice recognition software, eye tracking, single-switch access, head wand, single-switch access, sip and puff switch, oversized trackball mouse, adaptive keyboard or other assistive technologies. | ||
|
||
- _[Cognitive](https://webaim.org/articles/cognitive/)_ - These users can benefit from supplemental media, structural organization of content, clear and simple writing. | ||
|
||
Check out the following links from WebAim to understand from users: | ||
|
||
- [Web Accessibility Perspectives: Explore the Impact and Benefits for Everyone](https://www.w3.org/WAI/perspective-videos/) | ||
- [Stories of Web Users](https://www.w3.org/WAI/people-use-web/user-stories/) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.