SlideShare a Scribd company logo
1 of 43
Accessible Components
for developers and designers
By Vegard Haugstvedt, Webstep
INTRO TO
ACCESSIBILITY
01
— Tim Berners-Lee
“The power of the Web is in its
universality. Access by
everyone regardless of
disability is an essential
aspect.”
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
● Accessibility tree
● Screen reader
● Reading list
● Switch and other tools
WHAT IS ASSISTIVE TECHNOLOGY?
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
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.
EASY NAVIGATION
02
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
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
<body>
<h1>Main title</h1>
<p>…</p>
<p>…</p>
<h2>Section title</h2>
<p>…</p>
<h3>Subsection title</h3>
<p>…</p>
<h2>New section title</h2>
<p>…</p>
</body>
EXAMPLE
Landmarks provide structure
and organize content by type
and importance.
LANDMARKS
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
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
• First link on page
• Mostly hidden before
receiving focus
• Activating the link moves
focus to the main tag
SKIP TO MAIN
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
<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>
.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
OPEN / CLOSE WIDGETS
03
A disclosure widget is a component
that can hide and show content.
DISCLOSURE WIDGET
● <details>
○ <summary>Open/close</summary>
○ This content is shown when the
widget is open.
● </details>
Details/summary
- The native solution
● const DisclosureWidget = () => {
● const [isOpen, setIsOpen] = useState(false);
● return (
● <>
● <button
● aria-expanded={isOpen}
● aria-controls="disclosure_content"
● onClick={() => setIsOpen(!isOpen)}
● >
● {isOpen ? "Close" : "Open"}
● </button>
● <div id="disclosure_content">
● This content is displayed when open.
● </div>
● </>
● );
● };
Disclosure widget
- The simple solution
● button[aria-expanded]:before {
● content: "";
● display: inline-block;
● width: 0;
● height: 0;
● border-top: 0.25rem solid transparent;
● border-bottom: 0.25rem solid transparent;
● border-left: 0.5rem solid black;
● margin-right: 0.5rem;
● }
● button[aria-expanded="true"]:before {
● transform: rotate(90deg);
● }
● button[aria-expanded="false"] + * {
● display: none;
● }
● Pattern inspired by Adrian Roselli:
https://adrianroselli.com/2020/05/disclosure-widgets.html
● Use the disclosure widget with links
● Escape should close the dropdown
● Clicking outside the dropdown
should close it.
Dropdown menu
Do NOT use aria-role="menu"
on websites!
… unless you are replicating
a native application menu
LAYOUT
04
Always have visual order
reflect the order in
the markup!
With one or two exceptions…
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
Wrap the entire card in a link, and you’re
done! Right?
No!
First instinct
● 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
Card markup
● <article class="card">
● <div class="card__content">
● <a class="card__title">
● Checkered cotton shirt
● <span class="card__ribbon">
● On sale!
● </span>
● </a>
● <p class="card__price">$49</p>
● <p class="card__old-price">
● Previous price: $79
● </p>
● </div>
● <img
● class="card__image"
● src="..."
● alt="Man wearing a checkered shirt in red,
● white and blue colors."
● />
● </article>
● <article class="card">
● <div class="card__content">
● <a class="card__title">
● Checkered cotton shirt
● <span class="card__ribbon">
● On sale!
● </span>
● </a>
● <p class="card__price">$49</p>
● <p class="card__old-price">
● Previous price: $79
● </p>
● </div>
● <img
● class="card__image"
● src="..."
● alt="Man wearing a checkered shirt in red,
● white and blue colors."
● />
● </article>
● <article class="card">
● <div class="card__content">
● <a class="card__title">
● Checkered cotton shirt
● <span class="card__ribbon">
● On sale!
● </span>
● </a>
● <p class="card__price">$49</p>
● <p class="card__old-price">
● Previous price: $79
● </p>
● </div>
● <img
● class="card__image"
● src="..."
● alt="Man wearing a checkered shirt in red,
● white and blue colors."
● />
● </article>
● <article class="card">
● <div class="card__content">
● <a class="card__title">
● Checkered cotton shirt
● <span class="card__ribbon">
● On sale!
● </span>
● </a>
● <p class="card__price">$49</p>
● <p class="card__old-price">
● Previous price: $79
● </p>
● </div>
● <img
● class="card__image"
● src="..."
● alt="Man wearing a checkered shirt in red,
● white and blue colors."
● />
● </article>
Card styling
● .card {
● display: grid;
● grid-template-columns:
● repeat(auto-fit,minmax(12rem,1fr));
● }
● .card__content {
● text-align: center;
● }
● .card__image {
● order: -1;
● }
● .card__ribbon {
● position: absolute;
● ...
● }
Making the
entire card
clickable
● .card {
● position: relative;
● }
● a.card__title:before {
● content: ""
● position: absolute;
● top: 0;
● left: 0;
● right: 0;
● bottom: 0;
● }
● 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
● Remember to add space between
cards!
● Users need space tap for scrolling,
etc.
Card grid
TESTING
05
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
● 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
● Is all content perceivable (visible)?
○ Contrast issues on dynamic
backgrounds?
● Does any content get cut off or
moved off-stage?
Zoom
● Lighthouse, etc.
● Cover normal, easily
discoverable bugs that a
machine can discover.
● 25-50% of bugs can be
found this way.
Browser audit
● HeadingsMap
● Axe Pro
● High contrast mode
● NerdeFocus
Browser
extensions
● Lighthouse, etc.
● Cover normal, easily
discoverable bugs that a
machine can discover.
● 25-50% of bugs can be
found this way.
Screen readers
● 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
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

More Related Content

Similar to Accessible components for developers and designers

Web Design for Literary Theorists II: Overview of CSS (v 1.0)
Web Design for Literary Theorists II: Overview of CSS (v 1.0)Web Design for Literary Theorists II: Overview of CSS (v 1.0)
Web Design for Literary Theorists II: Overview of CSS (v 1.0)Patrick Mooney
 
How browser accessibility can enhance safe driving (AGL Summit Nov 2020)
How browser accessibility can enhance safe driving (AGL Summit Nov 2020)How browser accessibility can enhance safe driving (AGL Summit Nov 2020)
How browser accessibility can enhance safe driving (AGL Summit Nov 2020)Igalia
 
Top 10 tips for maximising accessibility - breakfast briefing March 2016
Top 10 tips for maximising accessibility - breakfast briefing March 2016Top 10 tips for maximising accessibility - breakfast briefing March 2016
Top 10 tips for maximising accessibility - breakfast briefing March 2016User Vision
 
Moodle Accessibility Hackfest '07
Moodle Accessibility Hackfest '07Moodle Accessibility Hackfest '07
Moodle Accessibility Hackfest '07Nick Freear
 
wd project.pptx
wd project.pptxwd project.pptx
wd project.pptxdsffsdf1
 
Web Accessibility for the 21st Century
Web Accessibility for the 21st CenturyWeb Accessibility for the 21st Century
Web Accessibility for the 21st Centurydreamwidth
 
Accessibility_is_not_a_mystery_presentation.pptx
Accessibility_is_not_a_mystery_presentation.pptxAccessibility_is_not_a_mystery_presentation.pptx
Accessibility_is_not_a_mystery_presentation.pptxLaurelYounis
 
Diy accessibility
Diy accessibilityDiy accessibility
Diy accessibilityCaleb Tang
 
Introduction to Web Design for Literary Theorists I: Introduction to HTML (v....
Introduction to Web Design for Literary Theorists I: Introduction to HTML (v....Introduction to Web Design for Literary Theorists I: Introduction to HTML (v....
Introduction to Web Design for Literary Theorists I: Introduction to HTML (v....Patrick Mooney
 
Accessibility Hacks Wordcamp Manchester October 2018
Accessibility Hacks Wordcamp Manchester October 2018Accessibility Hacks Wordcamp Manchester October 2018
Accessibility Hacks Wordcamp Manchester October 2018Graham Armfield
 
Accessibility Hacks version 2
Accessibility Hacks version 2Accessibility Hacks version 2
Accessibility Hacks version 2Graham Armfield
 
Accessibility Hacks Version 2
Accessibility Hacks Version 2Accessibility Hacks Version 2
Accessibility Hacks Version 2Graham Armfield
 
Introduction to HTML+CSS+Javascript.pptx
Introduction to HTML+CSS+Javascript.pptxIntroduction to HTML+CSS+Javascript.pptx
Introduction to HTML+CSS+Javascript.pptxKADAMBARIPUROHIT
 
Introduction to HTML+CSS+Javascript.pptx
Introduction to HTML+CSS+Javascript.pptxIntroduction to HTML+CSS+Javascript.pptx
Introduction to HTML+CSS+Javascript.pptxAliRaza899305
 
Introduction to HTML.pptx
Introduction to HTML.pptxIntroduction to HTML.pptx
Introduction to HTML.pptxmalrad1
 
Semantics & the Mobile Web
Semantics & the Mobile WebSemantics & the Mobile Web
Semantics & the Mobile Websurferroop
 
Accessibility and universal usability
Accessibility and universal usabilityAccessibility and universal usability
Accessibility and universal usabilitySarah Hudson
 
HTML5, CSS, JavaScript Style guide and coding conventions
HTML5, CSS, JavaScript Style guide and coding conventionsHTML5, CSS, JavaScript Style guide and coding conventions
HTML5, CSS, JavaScript Style guide and coding conventionsKnoldus Inc.
 

Similar to Accessible components for developers and designers (20)

Web Design for Literary Theorists II: Overview of CSS (v 1.0)
Web Design for Literary Theorists II: Overview of CSS (v 1.0)Web Design for Literary Theorists II: Overview of CSS (v 1.0)
Web Design for Literary Theorists II: Overview of CSS (v 1.0)
 
How browser accessibility can enhance safe driving (AGL Summit Nov 2020)
How browser accessibility can enhance safe driving (AGL Summit Nov 2020)How browser accessibility can enhance safe driving (AGL Summit Nov 2020)
How browser accessibility can enhance safe driving (AGL Summit Nov 2020)
 
Top 10 tips for maximising accessibility - breakfast briefing March 2016
Top 10 tips for maximising accessibility - breakfast briefing March 2016Top 10 tips for maximising accessibility - breakfast briefing March 2016
Top 10 tips for maximising accessibility - breakfast briefing March 2016
 
Moodle Accessibility Hackfest '07
Moodle Accessibility Hackfest '07Moodle Accessibility Hackfest '07
Moodle Accessibility Hackfest '07
 
wd project.pptx
wd project.pptxwd project.pptx
wd project.pptx
 
Web Accessbility
Web AccessbilityWeb Accessbility
Web Accessbility
 
Web Accessibility for the 21st Century
Web Accessibility for the 21st CenturyWeb Accessibility for the 21st Century
Web Accessibility for the 21st Century
 
Accessibility_is_not_a_mystery_presentation.pptx
Accessibility_is_not_a_mystery_presentation.pptxAccessibility_is_not_a_mystery_presentation.pptx
Accessibility_is_not_a_mystery_presentation.pptx
 
Bootstrap
BootstrapBootstrap
Bootstrap
 
Diy accessibility
Diy accessibilityDiy accessibility
Diy accessibility
 
Introduction to Web Design for Literary Theorists I: Introduction to HTML (v....
Introduction to Web Design for Literary Theorists I: Introduction to HTML (v....Introduction to Web Design for Literary Theorists I: Introduction to HTML (v....
Introduction to Web Design for Literary Theorists I: Introduction to HTML (v....
 
Accessibility Hacks Wordcamp Manchester October 2018
Accessibility Hacks Wordcamp Manchester October 2018Accessibility Hacks Wordcamp Manchester October 2018
Accessibility Hacks Wordcamp Manchester October 2018
 
Accessibility Hacks version 2
Accessibility Hacks version 2Accessibility Hacks version 2
Accessibility Hacks version 2
 
Accessibility Hacks Version 2
Accessibility Hacks Version 2Accessibility Hacks Version 2
Accessibility Hacks Version 2
 
Introduction to HTML+CSS+Javascript.pptx
Introduction to HTML+CSS+Javascript.pptxIntroduction to HTML+CSS+Javascript.pptx
Introduction to HTML+CSS+Javascript.pptx
 
Introduction to HTML+CSS+Javascript.pptx
Introduction to HTML+CSS+Javascript.pptxIntroduction to HTML+CSS+Javascript.pptx
Introduction to HTML+CSS+Javascript.pptx
 
Introduction to HTML.pptx
Introduction to HTML.pptxIntroduction to HTML.pptx
Introduction to HTML.pptx
 
Semantics & the Mobile Web
Semantics & the Mobile WebSemantics & the Mobile Web
Semantics & the Mobile Web
 
Accessibility and universal usability
Accessibility and universal usabilityAccessibility and universal usability
Accessibility and universal usability
 
HTML5, CSS, JavaScript Style guide and coding conventions
HTML5, CSS, JavaScript Style guide and coding conventionsHTML5, CSS, JavaScript Style guide and coding conventions
HTML5, CSS, JavaScript Style guide and coding conventions
 

More from Vegard Haugstvedt

Resistance is futile: Start writing accessible websites now!
Resistance is futile: Start writing accessible websites now!Resistance is futile: Start writing accessible websites now!
Resistance is futile: Start writing accessible websites now!Vegard Haugstvedt
 
Offline first with Couchbase Mobile
Offline first with Couchbase MobileOffline first with Couchbase Mobile
Offline first with Couchbase MobileVegard Haugstvedt
 
Booster 2017 - from accessibility n00b to pro in 1.5 hrs
Booster 2017 - from accessibility n00b to pro in 1.5 hrsBooster 2017 - from accessibility n00b to pro in 1.5 hrs
Booster 2017 - from accessibility n00b to pro in 1.5 hrsVegard Haugstvedt
 
Vegard Haugstvedt - Universelt for alle! Hvordan hele teamet kan ha et forhol...
Vegard Haugstvedt - Universelt for alle! Hvordan hele teamet kan ha et forhol...Vegard Haugstvedt - Universelt for alle! Hvordan hele teamet kan ha et forhol...
Vegard Haugstvedt - Universelt for alle! Hvordan hele teamet kan ha et forhol...Vegard Haugstvedt
 

More from Vegard Haugstvedt (6)

WCAG 2.1 for you and me
WCAG 2.1 for you and meWCAG 2.1 for you and me
WCAG 2.1 for you and me
 
WCAG 2.1 for deg og meg
WCAG 2.1 for deg og megWCAG 2.1 for deg og meg
WCAG 2.1 for deg og meg
 
Resistance is futile: Start writing accessible websites now!
Resistance is futile: Start writing accessible websites now!Resistance is futile: Start writing accessible websites now!
Resistance is futile: Start writing accessible websites now!
 
Offline first with Couchbase Mobile
Offline first with Couchbase MobileOffline first with Couchbase Mobile
Offline first with Couchbase Mobile
 
Booster 2017 - from accessibility n00b to pro in 1.5 hrs
Booster 2017 - from accessibility n00b to pro in 1.5 hrsBooster 2017 - from accessibility n00b to pro in 1.5 hrs
Booster 2017 - from accessibility n00b to pro in 1.5 hrs
 
Vegard Haugstvedt - Universelt for alle! Hvordan hele teamet kan ha et forhol...
Vegard Haugstvedt - Universelt for alle! Hvordan hele teamet kan ha et forhol...Vegard Haugstvedt - Universelt for alle! Hvordan hele teamet kan ha et forhol...
Vegard Haugstvedt - Universelt for alle! Hvordan hele teamet kan ha et forhol...
 

Recently uploaded

Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?Watsoo Telematics
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
buds n tech IT solutions
buds n  tech IT                solutionsbuds n  tech IT                solutions
buds n tech IT solutionsmonugehlot87
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 

Recently uploaded (20)

Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
 
buds n tech IT solutions
buds n  tech IT                solutionsbuds n  tech IT                solutions
buds n tech IT solutions
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 

Accessible components for developers and designers

  • 1. Accessible Components for developers and designers By Vegard Haugstvedt, Webstep
  • 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
  • 11. <body> <h1>Main title</h1> <p>…</p> <p>…</p> <h2>Section title</h2> <p>…</p> <h3>Subsection title</h3> <p>…</p> <h2>New section title</h2> <p>…</p> </body> EXAMPLE
  • 12. Landmarks provide structure and organize content by type and importance. LANDMARKS
  • 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
  • 19. OPEN / CLOSE WIDGETS 03
  • 20. A disclosure widget is a component that can hide and show content. DISCLOSURE WIDGET
  • 21. ● <details> ○ <summary>Open/close</summary> ○ This content is shown when the widget is open. ● </details> Details/summary - The native solution
  • 22. ● const DisclosureWidget = () => { ● const [isOpen, setIsOpen] = useState(false); ● return ( ● <> ● <button ● aria-expanded={isOpen} ● aria-controls="disclosure_content" ● onClick={() => setIsOpen(!isOpen)} ● > ● {isOpen ? "Close" : "Open"} ● </button> ● <div id="disclosure_content"> ● This content is displayed when open. ● </div> ● </> ● ); ● }; Disclosure widget - The simple solution ● button[aria-expanded]:before { ● content: ""; ● display: inline-block; ● width: 0; ● height: 0; ● border-top: 0.25rem solid transparent; ● border-bottom: 0.25rem solid transparent; ● border-left: 0.5rem solid black; ● margin-right: 0.5rem; ● } ● button[aria-expanded="true"]:before { ● transform: rotate(90deg); ● } ● button[aria-expanded="false"] + * { ● display: none; ● } ● Pattern inspired by Adrian Roselli: https://adrianroselli.com/2020/05/disclosure-widgets.html
  • 23. ● Use the disclosure widget with links ● Escape should close the dropdown ● Clicking outside the dropdown should close it. Dropdown menu
  • 24. Do NOT use aria-role="menu" on websites! … unless you are replicating a native application menu
  • 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
  • 30. Card markup ● <article class="card"> ● <div class="card__content"> ● <a class="card__title"> ● Checkered cotton shirt ● <span class="card__ribbon"> ● On sale! ● </span> ● </a> ● <p class="card__price">$49</p> ● <p class="card__old-price"> ● Previous price: $79 ● </p> ● </div> ● <img ● class="card__image" ● src="..." ● alt="Man wearing a checkered shirt in red, ● white and blue colors." ● /> ● </article> ● <article class="card"> ● <div class="card__content"> ● <a class="card__title"> ● Checkered cotton shirt ● <span class="card__ribbon"> ● On sale! ● </span> ● </a> ● <p class="card__price">$49</p> ● <p class="card__old-price"> ● Previous price: $79 ● </p> ● </div> ● <img ● class="card__image" ● src="..." ● alt="Man wearing a checkered shirt in red, ● white and blue colors." ● /> ● </article> ● <article class="card"> ● <div class="card__content"> ● <a class="card__title"> ● Checkered cotton shirt ● <span class="card__ribbon"> ● On sale! ● </span> ● </a> ● <p class="card__price">$49</p> ● <p class="card__old-price"> ● Previous price: $79 ● </p> ● </div> ● <img ● class="card__image" ● src="..." ● alt="Man wearing a checkered shirt in red, ● white and blue colors." ● /> ● </article> ● <article class="card"> ● <div class="card__content"> ● <a class="card__title"> ● Checkered cotton shirt ● <span class="card__ribbon"> ● On sale! ● </span> ● </a> ● <p class="card__price">$49</p> ● <p class="card__old-price"> ● Previous price: $79 ● </p> ● </div> ● <img ● class="card__image" ● src="..." ● alt="Man wearing a checkered shirt in red, ● white and blue colors." ● /> ● </article>
  • 31. Card styling ● .card { ● display: grid; ● grid-template-columns: ● repeat(auto-fit,minmax(12rem,1fr)); ● } ● .card__content { ● text-align: center; ● } ● .card__image { ● order: -1; ● } ● .card__ribbon { ● position: absolute; ● ... ● }
  • 32. Making the entire card clickable ● .card { ● position: relative; ● } ● a.card__title:before { ● content: "" ● position: absolute; ● top: 0; ● left: 0; ● right: 0; ● bottom: 0; ● }
  • 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

  1. Credit to Scott O’Hara’s Inclusively Hidden article: https://www.scottohara.me/blog/2017/04/14/inclusively-hidden.html
  2. Is not supported by IE11 Does not work for every pattern
  3. 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
  4. 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.
  5. 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.
  6. 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.
  7. Image source: Paul Downey on Flickr: https://www.flickr.com/photos/psd/4476722372