What you get for free
• Focusable via the keyboard or screen reader
• Clickable by mouse, enter key and space bar
• Accessible name and state provided to assistive tech
• An interaction is expected when clicked
Slide 24
Slide 24 text
No content
Slide 25
Slide 25 text
Using a
Open Modal
Slide 26
Slide 26 text
Extra Work
Open Modal
Slide 27
Slide 27 text
More Extra Work
function handleBtnKeyPress(e) {
// Check to see if space or enter were pressed
if ( e.keyCode === 32 || e.keyCode === 13) {
// Open modal dialog
openModal(e);
}
}
Source: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_button_role
Perceivable
Information and user interface
components must be presentable to
users in ways they can perceive
Operable
User interface components and
navigation must be operable
Understandable
Information and the operation of user
interface must be understandable
Robust
Content must be robust enough
that it can be interpreted reliably
by a wide variety of user agents,
including assistive technologies
Slide 41
Slide 41 text
Perceivable
Information and user interface
components must be presentable to
users in ways they can perceive
Operable
User interface components and
navigation must be operable
Understandable
Information and the operation of user
interface must be understandable
Robust
Content must be robust enough
that it can be interpreted reliably
by a wide variety of user agents,
including assistive technologies
Slide 42
Slide 42 text
Text Alternatives
Slide 43
Slide 43 text
Contrast Ratio
http://leaverou.github.io/contrast-ratio
Slide 44
Slide 44 text
Perceivable
Information and user interface
components must be presentable to
users in ways they can perceive
Operable
User interface components and
navigation must be operable
Understandable
Information and the operation of user
interface must be understandable
Robust
Content must be robust enough
that it can be interpreted reliably
by a wide variety of user agents,
including assistive technologies
Slide 45
Slide 45 text
Keyboard Accessible
Slide 46
Slide 46 text
Perceivable
Information and user interface
components must be presentable to
users in ways they can perceive
Operable
User interface components and
navigation must be operable
Understandable
Information and the operation of user
interface must be understandable
Robust
Content must be robust enough
that it can be interpreted reliably
by a wide variety of user agents,
including assistive technologies
Slide 47
Slide 47 text
Specify Language
Slide 48
Slide 48 text
Provide Instructions
Slide 49
Slide 49 text
Perceivable
Information and user interface
components must be presentable to
users in ways they can perceive
Operable
User interface components and
navigation must be operable
Understandable
Information and the operation of user
interface must be understandable
Robust
Content must be robust enough
that it can be interpreted reliably
by a wide variety of user agents,
including assistive technologies
Slide 50
Slide 50 text
Write Valid Code
My Web Page
My Web Page
Slide 51
Slide 51 text
Label Elements
Username
X
Slide 52
Slide 52 text
No content
Slide 53
Slide 53 text
Lighthouse
Slide 54
Slide 54 text
Chrome Developer Tools > Audits > Perform an Audit
Slide 55
Slide 55 text
pa11y
Slide 56
Slide 56 text
No content
Slide 57
Slide 57 text
On-the-Fly
Accessibility Testing
Slide 58
Slide 58 text
npm install -g pa11y
pa11y example.com
Slide 59
Slide 59 text
No content
Slide 60
Slide 60 text
No content
Slide 61
Slide 61 text
No content
Slide 62
Slide 62 text
No content
Slide 63
Slide 63 text
No content
Slide 64
Slide 64 text
No content
Slide 65
Slide 65 text
Continuous Integration
Slide 66
Slide 66 text
No content
Slide 67
Slide 67 text
No content
Slide 68
Slide 68 text
npm install -g pa11y-ci
pa11y-ci
Slide 69
Slide 69 text
{
"urls": [
“https://bitsofco.de”,
],
"defaults": {
"hideElements": “.sr-only”,
“ignore”: [
“notice”,
“WCAG2AA.Principle1.Guideline1_4.1_4_6_AAA”
],
“actions”: [
“set field #email to [email protected]”,
“click element #subscribe”,
]
}
}
.pa11yci
Slide 70
Slide 70 text
{
"urls": [
“https://bitsofco.de”,
],
"defaults": {
"hideElements": “.sr-only”,
“ignore”: [
“notice”,
“WCAG2AA.Principle1.Guideline1_4.1_4_6_AAA”
],
“actions”: [
“set field #email to [email protected]”,
“click element #subscribe”,
]
}
}
Slide 71
Slide 71 text
{
"urls": [
“https://bitsofco.de”,
],
"defaults": {
"hideElements": “.sr-only”,
“ignore”: [
“notice”,
“WCAG2AA.Principle1.Guideline1_4.1_4_6_AAA”
],
“actions”: [
“set field #email to [email protected]”,
“click element #subscribe”,
]
}
}
Slide 72
Slide 72 text
{
"urls": [
“https://bitsofco.de”,
],
"defaults": {
"hideElements": “.sr-only”,
“ignore”: [
“notice”,
“WCAG2AA.Principle1.Guideline1_4.1_4_6_AAA”
],
“actions”: [
“set field #email to [email protected]”,
“click element #subscribe”,
]
}
}
Slide 73
Slide 73 text
{
"urls": [
“https://bitsofco.de”,
],
"defaults": {
"hideElements": “.sr-only”,
“ignore”: [
“notice”,
“WCAG2AA.Principle1.Guideline1_4.1_4_6_AAA”
],
“actions”: [
“set field #email to [email protected]”,
“click element #subscribe”,
]
}
}