Slide 1
Lost in Translation Manuel Matuzović
Fronteers, Utrecht 2022
@mmatuzo
Slide 2
@mmatuzo Speaking at React Finland 2019
Slide 3
Source: alistapart.com/article/my-accessibility-journey-what-ive-learned-so-far
@mmatuzo
Slide 4
Source: alistapart.com/article/my-accessibility-journey-what-ive-learned-so-far
@mmatuzo
Slide 5
Slide 6
Source: buttoncheatsheet.com
@mmatuzo
Slide 7
Source: info.cern.ch/hypertext/WWW/MarkUp/Tags.html
@mmatuzo
Slide 8
Slide 9
We are not as good at writing HTML as we think we are. @mmatuzo
Slide 10
<main> <section id=”main-content”> <header id=”main-header”> <section class=”container-fluid”> <section class=”row”> <article class=”content col-sm-12”> <section class=”content-inner”> <div class=”content__body”> <article class=”slider”> <section class=”slide”> … </section> </article> </div> </section> </article> </section> </section> </header> </section> </main>
Source: https://www.htmhell.dev/10-section-is-no-replacement-for-div
@mmatuzo
Slide 11
Source: htmhell.dev
@mmatuzo
Slide 12
Slide 13
<h1>Product Status</h1> <h2>Is the product available?</h2> <div> <h3> <div> <div> <i> <h3> It‘s <a>available</a>. </h3> </i> </div> </div> </h3> </div> Source: https://www.htmhell.dev/19-heading-in-the-wrong-direction/
@mmatuzo
Slide 14
<div class=”btn”>Click here!</div>
@mmatuzo
Slide 15
The Elements of HTML 1. <div> 2. <script>
That’s it, that’s all. #yolo
@mmatuzo
Slide 16
The Elements of HTML 1. <header>
10. <summary>
19. <ins>
2. <footer>
11. <dialog>
20. <caption>
3. <main>
12. <address>
21. <track>
4. <section>
13. <button>
22. <output>
5. <article>
14. <blockquote>
23. <label>
6. <aside>
15. <abbr>
24. < eldset>
7. <progress>
16. <kbd>
25. <textarea>
8. <meter>
17. <mark>
26. <video>
9. <details>
18. <del>
27. …
fi
@mmatuzo
Slide 17
Source: codepen.io/plfstr/full/zYqQeRw
@mmatuzo
Slide 18
Designers know too little about HTML.
@mmatuzo
Slide 19
Some people just don’t care.
@mmatuzo
Slide 20
<div class=”nav”> <div> <div>about</div> <div>thoughts</div> </div> </div>
Source: htmhell.dev/18-main-divigation
@mmatuzo
Slide 21
<div class=”nav”> <a href=”/about”> <button>about</button> </a> <a href=”/thoughts”> <button>thoughts</button> </a> </div>
@mmatuzo
Slide 22
We put too much trust and hope in ARIA.
@mmatuzo
Slide 23
Source: webaim.org/projects/million/
@mmatuzo
Slide 24
Home pages with ARIA present averaged 70% more detected errors than those without ARIA.
Source: webaim.org/projects/million
@mmatuzo
Slide 25
Slide 26
If you can use a native HTML element or attribute with the semantics and behavior you require already built in, instead of re-purposing an element and adding an ARIA role, state or property to make it accessible, then do so. Source: w3.org/TR/using-aria
@mmatuzo
Slide 27
Use native HTML if possible. No ARIA is better than bad ARIA.
@mmatuzo
Slide 28
Slide 29
Most common issues
Source: webaim.org/projects/million
@mmatuzo
Slide 30
Source: hidde.blog/common-a11y-issues
@mmatuzo
Slide 31
Source: christianheilmann.com/2022/04/12/one-million-broken-web-sites-and-a-way-to-prevent-that
@mmatuzo
Slide 32
Most common issues • Low contrast text • Missing alternative text for images • Empty links • Missing form input labels • Empty buttons • Missing document language
Slide 33
We’re wrongfully downplaying the complexity of HTML due to the simplicity of its syntax. @mmatuzo
Slide 34
There’s more to HTML than tags and attributes.
@mmatuzo
Slide 35
Most common issues • Low contrast text • Missing alternative text for images • Empty links • Missing form input labels • Empty buttons • Missing document language
Slide 36
Accessibility issues don’t just come from what’s visible in a design, but from what’s not visible. @mmatuzo
Slide 37
Design to Code Translation
Exploration
@mmatuzo
Slide 38
Design to Code Translation
Exploration
Understanding
@mmatuzo
Slide 39
Design to Code Translation
Exploration
Understanding
Development
@mmatuzo
Slide 40
Design to Code Translation
Lost in Translation
Lack of knowledge
💥 Exploration
💥💥 Understanding
Not caring
Development
@mmatuzo
Slide 41
Our decisions have consequences • Basic understanding • Information • Orientation • Overview • Navigation
Slide 42
Slide 43
Slide 44
Slide 45
Slide 46
Slide 47
❌
<svg> <path d=”” /> </svg>
@mmatuzo
Slide 48
❌
<div class=”btn”> <svg> <path d=”” /> </svg> </div>
@mmatuzo
Slide 49
❌
<button> <svg> <path d=”” /> </svg> </button>
@mmatuzo
Slide 50
❌
<button aria-label=”Change theme”> <svg aria-hidden=”true”> <path d=”” /> </svg> </button>
@mmatuzo
Slide 51
❌ <button> Change theme <svg aria-hidden=”true”> <path d=”” /> </svg> </button>
@mmatuzo
Slide 52
❌ <button> <span class=”sr-only”>Change theme</span> <svg aria-hidden=”true”> <path d=”” /> </svg> </button>
@mmatuzo
Slide 53
✅ <button aria-expanded=”false”> <span class=”sr-only”>Change theme</span> <svg aria-hidden=”true”> <path d=”” /> </svg> </button>
@mmatuzo
Slide 54
✅ <button aria-expanded=”false” aria-controls=”theme-panel”> <span class=”sr-only”>Change theme</span> <svg aria-hidden=”true”> <path d=”” /> </svg> </button>
@mmatuzo
Slide 55
The Perfect Button • Focusable, interactive element (<button>)
Slide 56
The Perfect Button • Focusable, interactive element (<button>) • Accessible name (a label)
Slide 57
The Perfect Button • Focusable, interactive element (<button>) • Accessible name (a label) • Correct role (button)
Slide 58
The Perfect Button • Focusable, interactive element (<button>) • Accessible name (a label) • Correct role (button) • Communicate state ([aria-expanded])
Slide 59
The Perfect Button • Focusable, interactive element (<button>) • Accessible name (a label) • Correct role (button) • Communicate state ([aria-expanded]) • Communicate relationship ([aria-controls])
Slide 60
Slide 61
Slide 62
Source: htmhell.dev/20-close-buttons
@mmatuzo
Slide 63
❌
<button aria-expanded=”true” aria-controls=”theme-panel”> ✕ </button>
@mmatuzo
Slide 64
✅ <button aria-expanded=”true” aria-controls=”theme-panel”> <span class=”sr-only”>Close</span> <span aria-hidden=”true”> ✕ </span> </button>
@mmatuzo
Slide 65
Slide 66
Source: nordbayern.de
@mmatuzo
Slide 67
Source: natur-im-siedlungsraum.ch
@mmatuzo
Slide 68
Source: nabu-hadamar.de
@mmatuzo
Slide 69
Slide 70
Slide 71
Slide 72
Slide 73
Slide 74
<h1>
<h2> (Featured Posts)
@mmatuzo
Slide 75
<h2> (Most Viewed Posts)
@mmatuzo
Slide 76
<h2> (Most Viewed Posts)
<h2> (Most Commented Posts)
@mmatuzo
Slide 77
A Sound Document Outline • Meaningful labels • Clean hierarchy (Avoid skipping levels) • Enough but not too many headings
Slide 78
<header> <nav> <main>
@mmatuzo
Slide 79
Slide 80
Slide 81
Slide 82
Source: smashingmagazine.com/2022/06/voice-control-usability-considerations-partially-visually-hiddenlink-names
@mmatuzo
Slide 83
<section aria-label=”Quick summary” class=”article__summary”> <span id=”article__start” class=”summary__heading” aria-hidden=”true”> Quick summary ↬ </span> Overcorrecting for one form of disability may… </section>
@mmatuzo
Slide 84
Slide 85
<!DOCTYPE html> <html lang=”de”> <head> <meta charset=”UTF-8”> <meta name=”viewport” content=”width=device-width, initial-scale=1.0”> <title>Ein div ist keine Schaltfläche</title> </head> <body> <h1>Ein div ist keine Schaltfläche</h1> </body> </html>
@mmatuzo
Slide 86
<!DOCTYPE html> <html lang=”de”> <head> <meta charset=”UTF-8”> <meta name=”viewport” content=”width=device-width, initial-scale=1.0”> <title>Ein div ist keine Schaltfläche</title> </head> <body> <h1>Ein div ist keine Schaltfläche</h1> </body> </html>
@mmatuzo
Slide 87
The lang Attribute • Screen readers • Hyphenation • Quotation marks • Spell checking • The default font selection for CJK languages • Translation
Slide 88
Slide 89
Developers, prioritise HTML!
@mmatuzo
Slide 90
Learn who your users are and how they’re using the web.
@mmatuzo
Slide 91
Stop belittling HTML.
@mmatuzo
Slide 92
Universities, schools, teachers, course coordinators, prioritise HTML! @mmatuzo
Slide 93
Rewrite your curriculums, they don’t work.
@mmatuzo
Slide 94
Authors, prioritise HTML!
@mmatuzo
Slide 95
Write and speak more about HTML.
@mmatuzo
Slide 96
Use accessible HTML in your demos.
@mmatuzo
Slide 97
Learn how to test your sites with automatic testing tools.
@mmatuzo
Slide 98
96.8% of home pages had detected WCAG 2 failures!
Source: webaim.org/projects/million
@mmatuzo
Slide 99
Learn how to test your sites with the keyboard and screen readers. @mmatuzo
Slide 100
Slide 101
Additional Resources
@mmatuzo
Slide 102
Source: htmhell.dev/20-close-buttons
@mmatuzo
Slide 103
Source: htmhell.dev/11-the-trigram-for-heaven
@mmatuzo
Slide 104
Source: htmhell.dev/26-tasty-buttons
@mmatuzo
Slide 105
Source: matuzo.at/blog/lang-attribute
@mmatuzo