This document provides an overview of accessibility best practices for developers and designers. It discusses key topics like headings, landmarks, and disclosure widgets to help structure content in an accessible way. It also covers testing strategies like using a keyboard, zooming, browser extensions, screen readers and user testing to evaluate accessibility. The overall message is that accessibility needs to be considered in design and development, and thoroughly tested, to ensure usability for all people.
3. — Tim Berners-Lee
“The power of the Web is in its
universality. Access by
everyone regardless of
disability is an essential
aspect.”
4. TERMINOLOGY
Numeronym of Accessibility
Accessibility
Content should be perceivable,
operable and understandable.
Inclusive design
Designing for as many users with as many
backgrounds as possible.
Universal design
Designing for everybody in one solution
A11Y
5. ● Accessibility tree
● Screen reader
● Reading list
● Switch and other tools
WHAT IS ASSISTIVE TECHNOLOGY?
6. ACCESSIBILITY TREE
An element provides certain
traits for assistive technology
Accessible name
The text content of an element
Role
Tells assistive technology how the element
can be interacted with or presented
State
Current state, like «checked»,
«expanded», etc.
Value
Value of input fields
Element
7. Accessible name
Text content Labels
All form elements must
have a label.
Alternative
text
Alt-attribute for images,
title in SVGs, etc.
ARIA-label
Aria-label, aria-labelledby,
aria-describedby
The basis for accessible
name is child text nodes
of the element.
9. Headings give content structure, splits it up
into easily digestible parts and enable the
user to get a quick overview and find the
relevant content.
HEADINGS
10. Uses of headings
Sections Hierachy
Headings organizes content
in levels, so one section
belongs to a parent.
Table of
contents
Headings provide an
automatic table of
contents
Navigation
Headings enable the user
to quickly skip to the
relevant content
Headings mark the
beginning of a new
section of content
13. LANDMARKS
Main Article/Section
Headings organizes content
in levels, so one section
belongs to a parent.
Header/Footer
Headings provide an
automatic table of
contents
Nav
Headings enable the user
to quickly skip to the
relevant content
Headings mark the
beginning of a new
section of content
14. Skip links are links that
enable in-page navigation to
skip past large amounts or
repetitive content.
Skip links are mostly hidden
before receiving focus.
SKIP LINKS
15. • First link on page
• Mostly hidden before
receiving focus
• Activating the link moves
focus to the main tag
SKIP TO MAIN
16. OTHER USE CASES
FOR SKIP LINKS
Skip past tables, maybe
with lots of buttons, or
similar content.
Large amounts of content
Skip past content with
keyboard traps, content you
can’t guarantee
accessibility for, ads, etc.
Inaccessible content
17. <body>
<a href="#main" class="skip-link">
Skip to main content
</a>
<header>
<nav>
<ul>…</ul>
</nav>
<header>
<main id="main" tabindex="-1">
…
</main>
</body>
IMPLEMENTING A SKIP LINK
HTML
<body>
<a href="#main" class="skip-link">
Skip to main content
</a>
<header>
<nav>
<ul>…</ul>
</nav>
<header>
<main id="main" tabindex="-1">
…
</main>
</body>
18. .skip-link:not(:focus) {
clip: rect(0 0 0 0);
clip-path: inset(50%);
height: 1px;
width: 1px;
overflow: hidden;
position: absolute;
white-space: nowrap;
}
IMPLEMENTING A SKIP LINK
CSS
.skip-link:focus {
// Normal link styles
// Should have good focus indicator
}
https://www.scottohara.me/blog/2017/04/14/inclusively-hidden.html
26. Always have visual order
reflect the order in
the markup!
With one or two exceptions…
27. A card is a component with a title,
maybe some text and an optional image.
We often want the entire card to be
clickable.
CARD LAYOUT
28. Wrap the entire card in a link, and you’re
done! Right?
No!
First instinct
29. ● Keep the link text as short and
unique as possible.
● Consider the programmatical order
of the content.
● Unless there is a lot of text content,
don’t use heading tags for the title.
Accessible cards
33. ● Add an event listener to the card
element instead!
○ We only need to listen for
mouseclicks
○ Keyboard users will only need
to have access to the actual
link.
● Should add cursor styling to
highlight that the entire card is
clickable.
Making the
entire card
clickable
34. ● Remember to add space between
cards!
● Users need space tap for scrolling,
etc.
Card grid
36. TESTING YOUR COMPONENTS
FOR ACCESSIBILITY
Automated checks for
contrast, missing alt-
text, etc.
Lighthouse
Check that all interactive
components can be reached and
interacted with using a keyboard
Keyboard
Check that all content is
visible and operable on
different screen sizes
Zoom/Resize
Test with real users.
You are nowhere near
finished without this.
User testing
Check heading
structure, focus order,
etc. Also some audits
like Lighthouse.
Extensions
Check that content is
presented correctly.
Name, Role, Status and
Value. Interaction.
Screen reader
37. ● Lowest-hanging fruit
● Helps with a lot of other
issues, like screen reader
compatibility.
● Easy, anyone can do it.
● You’d be surprised how many
bugs arefound in this stage.
Keyboard
38. ● Is all content perceivable (visible)?
○ Contrast issues on dynamic
backgrounds?
● Does any content get cut off or
moved off-stage?
Zoom
39. ● Lighthouse, etc.
● Cover normal, easily
discoverable bugs that a
machine can discover.
● 25-50% of bugs can be
found this way.
Browser audit
40. ● HeadingsMap
● Axe Pro
● High contrast mode
● NerdeFocus
Browser
extensions
41. ● Lighthouse, etc.
● Cover normal, easily
discoverable bugs that a
machine can discover.
● 25-50% of bugs can be
found this way.
Screen readers
42. ● Don’t go here before you complete
the rest of the testing!
● Your real answer for whether your
webpage/application is accessible.
● Remember – users of assistive
technology are as diverse as the rest
of us!
User testing
43. CREDITS: This presentation template was created by
Slidesgo, incluiding icons by Flaticon, and
infographics & images by Freepik.
THANKS!
Do you have any questions?
@it_vegard
webstep.no
Editor's Notes
Credit to Scott O’Hara’s Inclusively Hidden article: https://www.scottohara.me/blog/2017/04/14/inclusively-hidden.html
Is not supported by IE11
Does not work for every pattern
Only needs to react to Space/Enter press on the button, which is provided natively.
Aria-expanded (true/false) lets screen reader users know the state has changed
Let’s first have a look at how this reads sequentially.
The title or product name comes first, and is wrapped in a link.
We place the «On sale!» ribbon inside the link to highlight this, but after the product name, so each link starts with a unique text.
The ribbon is then absolutely positioned.
The new and old prices are then listed, but not inside of the link. Thus, we keep link texts short and consise.
If the card had more text, that would similarly be placed outside of the link.
The image is placed last, as it should be described well with alt-text, and that should be something the user doesn’t have to read past if they are not interested.
Let’s first have a look at how this reads sequentially.
The title or product name comes first, and is wrapped in a link.
We place the «On sale!» ribbon inside the link to highlight this, but after the product name, so each link starts with a unique text.
The ribbon is then absolutely positioned.
The new and old prices are then listed, but not inside of the link. Thus, we keep link texts short and consise.
If the card had more text, that would similarly be placed outside of the link.
The image is placed last, as it should be described well with alt-text, and that should be something the user doesn’t have to read past if they are not interested.
But we have to do some tricks to make the entire card clickable, which this is all about.
The first alternative is using a pseudo-element to enlarge the clickable area of the link
First, we add position: relative to the card, so that any absolutely position child elements are placed relative to the card.
Next, we add the before pseudo-element to the link, absolutely positioning it and stretching it to all sides of the card.
This has one obvious advantage – it doesn’t require any JavaScript.
However, it also makes it impossible to select the text, as links act as «draggable» objects.
Image source: Paul Downey on Flickr: https://www.flickr.com/photos/psd/4476722372