How to Build an Inaccessible App

How to Build an Inaccessible App

How to Build an Inaccessible App

Why?

70% of the web is inaccessible
to people with low vision

10% have colour blindness 31% have low vision 33% have cataracts
17% have blindness or visual impairment 6% have deafness or hearing loss 2.6% have a cognitive impairment 5% have a mobility impairment
Sunlight and glare Night Mode Big fingers and small screens Injury or Illness Multi-tasking

Vision Impairment
Hearing Impairment
Mobility Impairment
Cognitive Impairment

Inaccessible Components

Buttons

https://cdpn.io/yLYgLGY

					
Click me!

					
				
button
  • Keyboard Accessible
  • Clickable
  • Tabbable
  • Focusable
div
  • Keyboard Accessible
  • Clickable
  • Tabbable
  • Focusable

Vision Impairment ✅
Mobility Impairment ✅

Inaccessible Components

Form Labels

https://cdpn.io/jObyEqq

					

					

					document.querySelectorAll("form input").forEach((i) => {
						i.addEventListener("input", (e) => {
							console.log(e.target.value);
					
							if (e.target.value && e.target.value !== "") {
								e.target.previousElementSibling.classList.add("active");
							}
						});
					});					
				

					form label {
						pointer-events: none;
						position: relative;
						top: 30px;
						left: 10px;

						&.active {
							top: -5px;
							transition: all 0.01s;
						}
					}
				

Vision Impairment ✅
Mobility Impairment ✅


					
					
					
					
				
Inaccessible Components

Icon Labels

https://cdpn.io/JjYEEVr

					
				

					
				

					a span {
						position: absolute;
						right: -200vw;
					}
				

Vision Impairment ✅
Cognitive Impairment ✅

Inaccessible Components

Hover Effects

https://cdpn.io/ExVZWyw

Vision Impairment ✅

Inaccessible Components

Tab Index

https://cdpn.io/abvJOqM

0 : Can be navigated to via keyboard

-1 : Cannot be navigated to via keyboard

1 : Will be navigated to in order


					

					

Vision Impairment ✅
Motor Impairment ✅
Cognitive Impairment ✅

Click/Touch Areas


					a {
						padding: 10px 15px;
						margin: 10px;
					}
				

Motor Impairment ✅
Cognitive Impairment ✅

Animations

⚠ Animation warning ⚠


					@media (prefers-reduced-motion) {
						.animated-element {
							animation: none;
						}
					}
				

⚠ Animation warning ⚠

Cognitive Impairment ✅

Captions and Transcripts

Vision Impairment ✅
Hearing Impairment ✅
Cognitive Impairment ✅

Doing this properly
is expensive

A 70% accurate alternative
is better than nothing

aria

aria attributes


					
aria

Button, Checkbox, Link, Radio, Searchbox, Slider, Scrollbar, Tab, Textbox, Menu, Article, Heading, Img, List, Row, Tablet, Banner, Complementary, Form, Main, Navigation, Alert, Status...

https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques
aria

Semantic HTML 🎉

Many of these widgets were later incorporated into HTML5, and developers should prefer using the correct semantic HTML element over using ARIA, if such an element exists
https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA

					
					

					
					
htmlreference.io

Vision Impairment ✅
Motor Impairment ✅
Cognitive Impairment ✅


					
There is some text here Click here

					
There is some text here Click here

					

					

					

Important content

Testing

Testing

Testing

Testing tools

https://pa11y.org

Web Content Accessibility Guidelines
WCAG

https://www.w3.org/WAI/standards-guidelines/wcag

Demo time 🤞

Testing

Deciphering tests


					

					
				

					
				

					
				
https://github.com/dequelabs/axe-core
https://whocanuse.com
https://abc.useallfive.com
https://github.com/hail2u/color-blindness-emulation

					.element {
						filter: url('filters.svg#protanopia');
						filter: url('filters.svg#protanomaly');
						filter: url('filters.svg#deuteranopia');
						filter: url('filters.svg#deuteranomaly');
						filter: url('filters.svg#tritanopia');
						filter: url('filters.svg#tritanomaly');
						filter: url('filters.svg#achromatopsia');
						filter: url('filters.svg#achromatomaly');
					}
				
https://24ways.org/2019/twelve-days-of-front-end-testing/
https://www.javascriptjanuary.com/blog/getting-started-with-front-end-testing
https://youtu.be/-__TNwVR110
https://inclusive-components.design
https://codepen.io/collection/AypYaP
  • twitter.com/amys_kapers
  • amyskapers.dev
  • blog.amyskapers.dev
  • speaking.amyskapers.dev
  • github.com/amykapernick
  • twitch.tv/amyskapers

Thank You 👏