Web Accessibility: Making Websites Better For Everyone

A presentation at View Source Conference in November 2015 in Portland, OR, USA by Stephanie Hobson

Slide 1

Slide 1

WEB ACCESSIBILITY: 
 MAKING WEBSITES BETTER FOR EVERYONE

Slide 2

Slide 2

WHAT IS WEB ACCESSIBILITY?

Slide 3

Slide 3

SCREEN READER Page has fifty-eight headings and two hundred seventy-one links BBC dash Homepage Link Graphic BBC Heading level two Heading level two BBC navigation List of nine items bullet Link News bullet Link Sport bullet Link Weather bullet Link Capital bullet Link Future bullet Link Shop bullet Link TV bullet Link Radio bullet Link More… List end

Slide 4

Slide 4

HIGH CONTRAST

Slide 5

Slide 5

HIGH CONTRAST

Slide 6

Slide 6

VOICE RECOGNITION

Slide 7

Slide 7

VOICE RECOGNITION

Slide 8

Slide 8

VOICE RECOGNITION

Slide 9

Slide 9

TRACKBALL

Slide 10

Slide 10

KEYBOARD

Slide 11

Slide 11

TRY IT YOURSELF Jaws / ChromeVox Windows High Contrast Theme Tu r n o f f y o u r m o u s e
Use your elbows (not fingers)

Slide 12

Slide 12

YOU SHOULD CARE ABOUT ACCESSIBILITY

Slide 13

Slide 13

1: UX Content Information Architecture Interface Design

Slide 14

Slide 14

1: UX xkcd.com/773

Slide 15

Slide 15

2: HTML

Slide 16

Slide 16

2: HTML Semantic HTML: When the HTML markup reinforces the meaning (aka semantics) of the information on the page.

Slide 17

Slide 17

2: HTML WCAG 2.0

(Web Content Accessibility Guidelines) wave.webaim.org

Slide 18

Slide 18

Section 508 Rehabilitation Act Americans with Disabilities Act Nat’l Federation of the Deaf vs. Netflix Inc ADA Department of Justice Advance Notice Of Proposed Rulemaking Charter of Rights and Freedoms Canadian Human Rights Act Ontarians with Disabilities Act Schedules I, I.I and II of the Financial Administration Act Title III

Slide 19

Slide 19

3: CSS Don’t screw up your HTML Make small improvements

Slide 20

Slide 20

4: JAVASCRIPT Don’t screw up your HTML

Slide 21

Slide 21

4: JAVASCRIPT Don’t screw up your HTML ARIA Roles and Attributes

(Accessible Rich Internet Applications)

Slide 22

Slide 22

Slide 23

Slide 23

Slide 24

Slide 24

<div class="server">Blueberry <span class="server_button"> DETAILS &#x25B8;</span> </div> <div class="server_details"> <div>Hostname: web02.onr.example.com</div> <div>Service Tag: JCQFZK1</div> <div>Datacentre: ONR</div> <div>Rack Location: 104.6, Unit #24</div> </div>

Slide 25

Slide 25

<div class="server">Blueberry <span class="server_button"> DETAILS &#x25B8;</span> </div> <div class="server_details"> <div> Hostname: web02.onr.example.com </div> <div> Service Tag: JCQFZK1 </div> <div> Datacentre: ONR </div> </div>

Slide 26

Slide 26

<div class="server">Blueberry <span class="server_button"> DETAILS &#x25B8;</span> </div> <dl class="server_details"> <dt> Hostname: </dt><dd> web02.onr.example.com </dd> <dt> Service Tag: </dt><dd> JCQFZK1 </dd> <dt> Datacentre: </dt><dd> ONR </dd> </dl>

Slide 27

Slide 27

<div class="server">Blueberry <span class="server_button"> DETAILS &#x25B8;</span> </div> <dl class="server_details"> <dt>Hostname:</dt><dd> web02.onr.example.com</dd> <dt>Service Tag:</dt><dd> JCQFZK1</dd> <dt>Datacentre:</dt><dd> ONR</dd> </dl>

Slide 28

Slide 28

<h3 class="server">Blueberry <span class="server_button"> DETAILS &#x25B8;</span> </h3> <dl class="server_details"> <dt>Hostname:</dt><dd> web02.onr.example.com</dd> <dt>Service Tag:</dt><dd> JCQFZK1</dd> <dt>Datacentre:</dt><dd> ONR</dd> </dl>

Slide 29

Slide 29

<h3 class="server">Blueberry <span class="server_button"> DETAILS &#x25B8; </span> </h3> <dl class="server_details"> <dt>Hostname:</dt><dd> web02.onr.example.com< <dt>Service Tag:</dt><dd> JCQFZK1</dd> <dt>Datacentre:</dt><dd> ONR</dd> </dl>

Slide 30

Slide 30

$('.server_button').on( 'click' ,
function() {
$(this) .parent().next() .toggleClass('hide'); });

Slide 31

Slide 31

.server_button :hover { background-color: #000; color: #fff; }

Slide 32

Slide 32

<h3 class="server">Blueberry <span class="server_button"> DETAILS &#x25B8; </span> </h3> <dl class="server_details"> <dt>Hostname:</dt><dd> web02.onr.example.com< <dt>Service Tag:</dt><dd> JCQFZK1</dd> <dt>Datacentre:</dt><dd> ONR</dd> </dl>

Slide 33

Slide 33

<h3 class="server">Blueberry <button class="server_button"> DETAILS &#x25B8; </button> </h3> <dl class="server_details"> <dt>Hostname:</dt><dd> web02.onr.example.com</dd> <dt>Service Tag:</dt><dd> JCQFZK1</dd> <dt>Datacentre:</dt><dd> ONR</dd> </dl>

Slide 34

Slide 34

<h3 class="server">Blueberry <button class="server_button" type="button"> DETAILS &#x25B8; </button> </h3> <dl class="server_details"> <dt>Hostname:</dt><dd> web02.onr.example.com</dd> <dt>Service Tag:</dt><dd> JCQFZK1</dd> <dt>Datacentre:</dt><dd> ONR</dd> </dl>

Slide 35

Slide 35

$('.server_button').on( 'click' ,
function() {
$(this) .parent() .next() .toggle(); });

Slide 36

Slide 36

.server_button :hover { background-color: #000; color: #fff; }

Slide 37

Slide 37

.server_button :hover, .server_button:focus { background-color: #000; color: #fff; }

Slide 38

Slide 38

.server_button:hover, .server_button:focus { background-color: #000; color: #fff;

text-decoration: underline; }

Slide 39

Slide 39

<h3 class="server">Blueberry <button class="server_button" type="button"> DETAILS &#x25B8; </button> </h3> <dl class="server_details"> <dt>Hostname:</dt><dd> web02.onr.example.com</dd> <dt>Service Tag:</dt><dd> JCQFZK1</dd> <dt>Datacentre:</dt><dd> ONR</dd> </dl>

Slide 40

Slide 40

<h3 class="server">Blueberry <button class="server_button" type="button"> Details &#x25B8; </button> </h3> <dl class="server_details"> <dt>Hostname:</dt><dd> web02.onr.example.com</dd> <dt>Service Tag:</dt><dd> JCQFZK1</dd> <dt>Datacentre:</dt><dd> ONR</dd> </dl>

Slide 41

Slide 41

<h3 class="server">Blueberry <button class="server_button" type="button"> Details &#x25B8; </button> </h3> <dl class="server_details"> <dt>Hostname:</dt><dd> web02.onr.example.com</dd> <dt>Service Tag:</dt><dd> JCQFZK1</dd> <dt>Datacentre:</dt><dd> ONR</dd> </dl>

Slide 42

Slide 42

<h3 class="server"> <button class="server_button" type="button"> Blueberry </button> </h3> <dl class="server_details"> <dt>Hostname:</dt><dd> web02.onr.example.com</ <dt>Service Tag:</dt><dd> JCQFZK1</dd> <dt>Datacentre:</dt><dd> ONR</dd> </dl>

Slide 43

Slide 43

Slide 44

Slide 44

<h3 class="server"> <button class="server_button" type="button"> Blueberry </button> </h3> <dl class="server_details"> <dt>Hostname:</dt><dd> web02.onr.example.com</ <dt>Service Tag:</dt><dd> JCQFZK1</dd> <dt>Datacentre:</dt><dd> ONR</dd> </dl>

Slide 45

Slide 45

<h3> <button class="server" type="button"> Blueberry </button> </h3> <dl class="server_details"> <dt>Hostname:</dt><dd> web02.onr.example.com</dd> <dt>Service Tag:</dt><dd> JCQFZK1</dd> <dt>Datacentre:</dt><dd> ONR</dd> </dl>

Slide 46

Slide 46

Slide 47

Slide 47

.server_button .server:after { content: 'Details \25B8’; text-transform: uppercase; speak: none;

background-color: #fff; border-radius: 4px; border: 0px none; box-shadow: 0px -2px
rgba(0,0,0, 0.5) inset; color: #4D4E53;

Slide 48

Slide 48

.server_button:hover, .server_button:focus .server:hover:after, .server:focus:after {

/* same styles as before */ }

Slide 49

Slide 49

Slide 50

Slide 50

Click here

Slide 51

Slide 51

“…the time required to rapidly move to a target area is a function of the ratio between the distance to the target and the width of the target” FITTS’ LAW

  • Wikipedia FTW

Slide 52

Slide 52

Slide 53

Slide 53

<span aria-hidden="true" class="icon_check"></span> <span class="offscreen"> This server is up: </span>

Slide 54

Slide 54

<span aria-hidden="true"

  class="icon_check"></span> 
<span class="offscreen"> This server is up: </span>

Slide 55

Slide 55

.icon_check:before { content: '\π3'; speak: none; } .icon_times:before { content: '\π5'; speak: none; }

Slide 56

Slide 56

<span aria-hidden="true" class="icon_check"></span> <span class="offscreen">

This server is up: </span>

Slide 57

Slide 57

Slide 58

Slide 58

<span aria-hidden="true" class="icon_check"></span> <span class="offscreen"

 This server is up: 
</span>

Slide 59

Slide 59

.offscreen { position: absolute; height: 1px; width: 1px; overflow: hidden; clip: rect(1px 1px 1px 1px); clip: rect(1px, 1px, 1px, 1px);
}

Slide 60

Slide 60

Slide 61

Slide 61

Slide 62

Slide 62

WHAT JUST HAPPENED?

Slide 63

Slide 63

WHAT JUST HAPPENED?

  • choose the right element

Slide 64

Slide 64

WHAT JUST HAPPENED?

  • choose the right element
  • use descriptive calls to action

Slide 65

Slide 65

WHAT JUST HAPPENED?

  • choose the right element
  • use descriptive calls to action
  • make hit areas bigger

Slide 66

Slide 66

WHAT JUST HAPPENED?

  • choose the right element
  • use descriptive calls to action
  • make hit areas bigger
  • add visual cues

Slide 67

Slide 67

WHAT JUST HAPPENED?

  • choose the right element
  • use descriptive calls to action
  • make hit areas bigger
  • add visual cues in the CSS
  • don’t just add visual cues

Slide 68

Slide 68

Slide 69

Slide 69

<h3> <button class="server" type="button"> <span aria-hidden="true" class="icon_check" ></span> <span class="offscreen">This server is up: </span> Blueberry </button> </h3> <dl class="server_details"> <dt>Hostname:</dt><dd> web02.onr.example.com</dd> <dt>Service Tag:</dt><dd> JCQFZK1</dd> <dt>Datacentre:</dt><dd> ONR</dd> </dl>

Slide 70

Slide 70

<h3> <button class="server" type="button"> <span aria-hidden="true" class="icon_check" ></span> <span class="offscreen">This server is up: </span> Blueberry </button> </h3> <dl class="server_details"> <dt>Hostname:</dt><dd> web02.onr.example.com</dd> <dt>Service Tag:</dt><dd> JCQFZK1</dd> <dt>Datacentre:</dt><dd> ONR</dd> </dl>

Slide 71

Slide 71

<h3>

<button class="server" type="button"> <span aria-hidden="true" class="icon_check" ></span> <span class="offscreen">This server is up: </span> Blueberry </button>

</h3> <dl class="server_details"> <dt>Hostname:</dt><dd> web02.onr.example.com</dd> <dt>Service Tag:</dt><dd> JCQFZK1</dd> <dt>Datacentre:</dt><dd> ONR</dd> </dl>

Slide 72

Slide 72

<h3>

<button aria-controls="raspberry" class="server" type="button"> <span aria-hidden="true" class="icon_check" ></span> <span class="offscreen">This server is up: </span> Blueberry </button>

</h3> <dl id="raspberry" class="server_details"> <dt>Hostname:</dt><dd> web02.onr.example.com</dd> <dt>Service Tag:</dt><dd> JCQFZK1</dd> <dt>Datacentre:</dt><dd> ONR</dd> </dl>

Slide 73

Slide 73

<h3>

<button aria-controls="raspberry" aria-expanded="false" class="server" type="button"> <span aria-hidden="true" class="icon_check" ></span> <span class="offscreen">This server is up: </span> Blueberry </button>

</h3> <dl id="raspberry" aria-hidden="true" class="server_details"> <dt>Hostname:</dt><dd> web02.onr.example.com</dd> <dt>Service Tag:</dt><dd> JCQFZK1</dd> <dt>Datacentre:</dt><dd> ONR</dd> </dl>

Slide 74

Slide 74

$('[aria-expanded]').on('click',
function() { var id = $(this) .attr(aria-contols); /*
toggle values of
aria-expanded & aria-hidden
*/ });

Slide 75

Slide 75

<h3>

<button aria-controls="raspberry" aria-expanded="false" class="server" type="button"> <span aria-hidden="true" class="icon_check" ></span> <span class="offscreen">This server is up: </span> Blueberry </button>

</h3> <dl id="raspberry" aria-hidden="true" class="server_details"> <dt>Hostname:</dt><dd> web02.onr.example.com</dd> <dt>Service Tag:</dt><dd> JCQFZK1</dd> <dt>Datacentre:</dt><dd> ONR</dd> </dl>

Slide 76

Slide 76

<h3>

<button aria-controls="raspberry" aria-expanded="true" class="server" type="button"> <span aria-hidden="true" class="icon_check" ></span> <span class="offscreen">This server is up: </span> Blueberry </button>

</h3> <dl id="raspberry" aria-hidden="false" class="server_details"> <dt>Hostname:</dt><dd> web02.onr.example.com</dd> <dt>Service Tag:</dt><dd> JCQFZK1</dd> <dt>Datacentre:</dt><dd> ONR</dd> </dl>

Slide 77

Slide 77

.server_details[aria-hidden=true]{ display: none; }

Slide 78

Slide 78

.server[aria-expanded=false]:after{ content: 'Details \25B8'; } .server[aria-expanded=true]:after{ content: 'Details \25BE'; }

Slide 79

Slide 79

Slide 80

Slide 80

Slide 81

Slide 81

DON’T SELL IT, DO IT

Slide 82

Slide 82

BETTER FOR EVERYONE

Slide 83

Slide 83

I LIKE TO MAKE WEBSITES EVERYONE CAN USE @stephaniehobson stephaniehobson.ca

Slide 84

Slide 84

RESOURCES

  • webaim.org
  • wave.webaim.org
  • alistapart.com/article/the-accessibility-of-wai-aria
  • 24ways.org/2009/dont-lose-your-focus/
  • blog.paciellogroup.com/2010/01/high-contrast-proof-css-sprites
  • filamentgroup.com/lab/bulletproof_icon_fonts.html
  • snook.ca/archives/html_and_css/hiding-content-for-accessibility
  • snook.ca/archives/html_and_css/floated-label-pattern-css