(a11y)
And how to build accessible components
Slides :
@KeziahMoselle
Front-end Developer
@ HOME
What is Accessibility ?
An introduction to ARIA
Create accessible components
Bonus (quick tips)
"Accessibility is about people.
Accessibility is about including and protecting people in minoritized groups."
- Lindsey Kopacz
Web Content Accessibility Guidelines
Image source:
Accessible Rich Internet Applications
Context
User
ARIA
Extra
informations
Do I need ARIA ?
<div
id="saveChanges"
tabindex="0"
role="button"
>
Save
</div>
<button id="saveChanges">
Save
</button>
A button made with ARIA
A button
role="button"
aria-pressed
aria-expanded
aria-label
aria-labelledby
...
Associated states
Associated properties
aria-relevant
aria-readonly
aria-labelledby
...
aria-checked
aria-expanded
aria-hidden
...
<!-- This will skip the <nav> and go to the main content -->
<a class="visually-hidden" href="#main">
Skip to main content
</a>
<nav role="navigation">
<ul>
<li><a href="/">Home</a></li>
<li><a href="/about">About</a></li>
<li><a href="/blog">Blog</a></li>
</ul>
</nav>
<main id="main" role="main">
<!-- page specific content -->
</main>
<a class="visually-hidden" href="#main">
Skip to main content
</a>
/* Old way */
.visually-hidden {
position:absolute;
left:-10000px;
top:auto;
width:1px;
height:1px;
overflow:hidden;
}
/* Modern way */
.visually-hidden {
clip: rect(1px, 1px, 1px, 1px);
clip-path: inset(50%);
height: 1px;
width: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
}
@media (prefers-reduced-motion: reduce) {
button {
animation: none;
}
}
@media (prefers-reduced-motion: no-preference) {
button {
animation: akeyframe 0.3s;
}
}
window.matchMedia('(prefers-reduced-motion: reduce)')
/*
{
media: "(prefers-reduced-motion: reduce)"
matches: false
onchange: null
}
*/
Icons:
Slides :