Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

The Great Accessibility Bake Off (A11y Camp Sydney)

208 views

Published on

It’s always better to bake in accessibility from the very beginning than tack it on after you've already built something. Making accessibility decisions up front in your web app can save your users a lot of frustration and save you a lot of time. But how do you know what to bake in, how to mix it all together, and whether you’ve made something good?

Let’s review the key ingredients of web accessibility — such as semantic HTML, keyboard interactivity, and a dash of ARIA — and discuss some tried-and-true recipes for accessible web development. We’ll also knead through technically challenging accessibility feats to achieve more inclusive interaction patterns. With these techniques in your recipe book, making an accessible website will be a piece of cake!

Published in: Technology
  • Be the first to comment

  • Be the first to like this

The Great Accessibility Bake Off (A11y Camp Sydney)

  1. 1. The Great Accessibility Bake Off
  2. 2. @cordeliadillon Cordelia McGee-Tubb Web Accessibility Engineer
  3. 3. Making products, services, and spaces that everyone can use and enjoy in all contexts, regardless of their abilities
  4. 4. Visual
  5. 5. Visual Motor
  6. 6. Visual Motor Auditory
  7. 7. Visual Motor Auditory Cognitive
  8. 8. Creating flexible systems that consider all users’ experiences from the very start, not just via tacked-on accommodations
  9. 9. Baking accessibility in
  10. 10. Set Timer
  11. 11. Set Timer <div class=“button--primary” onClick=“setTimer()”> Set Timer </div>
  12. 12. Set Timer <div class=“button--primary” onClick=“setTimer()” tabindex=“0”> Set Timer </div>
  13. 13. Set Timer <div class=“button--primary” onClick=“setTimer()” tabindex=“0” onKeyDown=“setTimer(e)”> Set Timer </div>
  14. 14. Set Timer <div class=“button--primary” onClick=“setTimer” tabindex=“0” onKeyDown=“setTimer(e)” role=“button”> Set Timer </div>
  15. 15. Set Timer <button onClick=“setTimer()”> Set Timer </button>
  16. 16. Set Timer <button class=“button--primary” onClick=“setTimer()”> Set Timer </button>
  17. 17. Image sources: http://ind.pn/2qIL6Qp and http://bit.ly/2pCoqDD
  18. 18. Image sources: http://ind.pn/2qIL6Qp and http://bit.ly/2pCoqDD
  19. 19. Image source: https://www.yahoo.com/style/anglophiles-and-baking-enthusiasts-received-a-106546370621.html
  20. 20. Image source: http://ind.pn/2qINXsS
  21. 21. You don’t have to be an accessibility expert to make great, accessible UIs.
  22. 22. Image source: https://www.yahoo.com/style/anglophiles-and-baking-enthusiasts-received-a-106546370621.html
  23. 23. Image source: http://ind.pn/2qINXsS
  24. 24. Main Ingredients
  25. 25. You will need... ❏ Semantic HTML ❏ A dash of ARIA ❏ Alt attributes for images ❏ Names for all interactive items ❏ Sufficient text contrast ❏ Mouse-keyboard parity Web Content Accessibility Guidelines: https://www.w3.org/TR/WCAG20/
  26. 26. Semantic HTML is the core ingredient for accessible web UIs.
  27. 27. <button> <article> <input> <table> <main> <ul> <nav> <li> <a href> <h1> <h2> <section> <div> <span> <a>
  28. 28. ...but as we move from websites to web apps, sometimes we need to spice up our HTML with ARIA.
  29. 29. Accessible Rich Internet Applications
  30. 30. https://www.w3.org/TR/wai-aria-1.1/ Accessible Rich Internet Applications
  31. 31. ARIA can communicate elements’ role, state, and properties to assistive technology when semantic HTML won’t suffice.
  32. 32. ARIA can communicate elements’ role, state, and properties to assistive technology when semantic HTML won’t suffice.
  33. 33. Use alternative text to make sure images’ meaning comes through.
  34. 34. Informational: Short, descriptive alt text <img alt=“Cupcake” src=“icon-final-FINAL.png”/>
  35. 35. Informational: Short, descriptive alt text <img alt=“Cupcake with cherry on top” src=“cupcake1.png”/> <img alt=“Cupcake with sprinkles” src=“cupcake2.png”/>
  36. 36. Redundant or decorative: Empty alt text <img alt=“” src=“icon-final-final.png”/> <span class=“uppercase”>Cupcakes</span> CUPCAKES <svg aria-hidden=“true”>...</svg> <span class=“uppercase”>Cupcakes</span>
  37. 37. Use good text contrast.
  38. 38. WCAG 2.0 AA Guidelines: 4.5:1 for regular text 3:1 for large text http://leaverou.github.io/contrast-ratio/ http://wave.webaim.org
  39. 39. Good morning, Accessibility Campers! I’m happy to be in Sydney again. Talking with y’all about baking. What’s your favorite cake? Do you say “frosting” or “icing”? Is quiche a pastry? Do you like chocolate? Can you still see me? Shout “CUPCAKES!” if you can read this.
  40. 40. 21:1 9.89:1 5.74:1 2.85:1 2.01:1 1.61:1 1.41:1 1.15:1 1.14:1 Good morning, Accessibility Campers! I’m happy to be in Sydney again. Talking with y’all about baking. What’s your favorite cake? Do you say “frosting” or “icing”? Is quiche a pastry? Do you like chocolate? Can you still see me? Shout “CUPCAKES!” if you can read this.
  41. 41. Judging Criteria
  42. 42. Does it look amazing? Does it taste amazing? Is it well-baked?
  43. 43. Does it look amazing? Does it taste amazing? Is it well-baked? Does it look amazing? Does it function as expected? Did you over/under-engineer it?
  44. 44. Test everything you make with... ❏ a mouse ❏ a keyboard ❏ a screen reader ❏ multiple screen readers ❏ NVDA (Windows) ❏ JAWS (Windows) ❏ VoiceOver (built-in to OS X!) ❏ grayscale mode ❏ real users!
  45. 45. Signature Challenge
  46. 46. Subscribe <input type=“text”/> <input type=“email” required /> <input type=“checkbox” /> <input type=“submit” value=“Subscribe” /> 1. The fields themselves
  47. 47. Subscribe <label for=“name”>Name</label> <input id=“name” type=“text”/> <label for=“email”>Email</label> <input id=“email” type=“email” required /> <input id=“bakeoff” type=“checkbox” /> <label for=“bakeoff”>Yes, …</label> <input type=“submit” value=“Subscribe” /> 2. Associated, visible labels Name Email* Yes, I want to be a contestant on “The Great Accessibility Bake Off.”
  48. 48. Subscribe <label for=“name”>Name</label> <input placeholder=“Name” type=“text”/> <label for=“email”>Email</label> <input placeholder=“Email” type=“email” required /> <input id=“bakeoff” type=“checkbox” /> <label for=“bakeoff”>Yes, …</label> <input type=“submit” value=“Subscribe” /> No placeholders as labels Yes, I want to be a contestant on “The Great Accessibility Bake Off.” Name Email*
  49. 49. Subscribe <label for=“name”>Name</label> <input placeholder=“Name” type=“text”/> <label for=“email”>Email</label> <input placeholder=“Email” type=“email” required /> <input id=“bakeoff” type=“checkbox” /> <label for=“bakeoff”>Yes, …</label> <input type=“submit” value=“Subscribe” /> No placeholders as labels Yes, I want to be a contestant on “The Great Accessibility Bake Off.” What should I put here again? Email*
  50. 50. Subscribe <label for=“name”>Name</label> <input id=“name” type=“text”/> <label for=“email”>Email</label> <input id=“email” type=“email” required /> <input id=“bakeoff” type=“checkbox” /> <label for=“bakeoff”>Yes, …</label> <input type=“submit” value=“Subscribe” /> 2. Associated, visible labels Name Email* Yes, I want to be a contestant on “The Great Accessibility Bake Off.” I know what I should put here!
  51. 51. 3. Visible focus indicators Subscribe Name Email* Yes, I want to be a contestant on “The Great Accessibility Bake Off.” :focus { outline: none; } Don’t just remove default
  52. 52. 3. Visible focus indicators Subscribe Name Email* Yes, I want to be a contestant on “The Great Accessibility Bake Off.” :focus { outline: none; box-shadow: 0 0 0 2px rgb(103, 78, 167); } :focus { outline: none; } Don’t just remove default Replace it with something!
  53. 53. Subscribe <label for=“name”>Name</label> <input id=“name” type=“text”/> <label for=“email”>Email</label> <input id=“email” type=“email” required aria-describedby=“email-error” /> <span class=“error” id=“email-error”> Your email… </span> <input id=“bakeoff” type=“checkbox” /> <label for=“bakeoff”>Yes, …</label> <input type=“submit” value=“Subscribe” /> 4. Associated errors Name Email* Yes, I want to be a contestant on “The Great Accessibility Bake Off.” Cordelia Email address must include @ sign. cordelia
  54. 54. Subscribe <label for=“name”>Name</label> <input id=“name” type=“text”/> <label for=“email”>Email</label> <input id=“email” type=“email” required aria-describedby=“email-error” /> <span class=“error” id=“email-error”> Your email… </span> <input id=“bakeoff” type=“checkbox” /> <label for=“bakeoff”>Yes, …</label> <input type=“submit” value=“Subscribe” /> 5. No color reliance Name Email* Yes, I want to be a contestant on “The Great Accessibility Bake Off.” Cordelia Email address must include @ sign. cordelia
  55. 55. Subscribe <label for=“name”>Name</label> <input id=“name” type=“text”/> <label for=“email”>Email</label> <input id=“email” type=“email” required aria-describedby=“email-error” /> <span class=“error” id=“email-error”> Your email… </span> <input id=“bakeoff” type=“checkbox” /> <label for=“bakeoff”>Yes, …</label> <input type=“submit” value=“Subscribe” /> 5. No color reliance Name Email* Yes, I want to be a contestant on “The Great Accessibility Bake Off.” Cordelia Email address must include @ sign. cordelia
  56. 56. Subscribe <label for=“name”>Name</label> <input id=“name” type=“text”/> <label for=“email”>Email</label> <input id=“email” type=“email” required aria-describedby=“email-error” /> <span class=“error” id=“email-error”> Your email… </span> <input id=“bakeoff” type=“checkbox” /> <label for=“bakeoff”>Yes, …</label> <input type=“submit” value=“Subscribe” /> 5. No color reliance Name Email* Yes, I want to be a contestant on “The Great Accessibility Bake Off.” Cordelia Email address must include @ sign. cordelia
  57. 57. https://www.sitepoint.com/replacing-radio-buttons-without-replacing-radio-buttons/
  58. 58. Technical Challenge
  59. 59. Our tried-and-true semantic HTML isn’t sufficient in this case.
  60. 60. Let’s follow the given ARIA recipe.
  61. 61. https://www.w3.org/TR/wai-aria-practices-1.1/#TreeView
  62. 62. https://www.w3.org/TR/wai-aria-practices-1.1/#TreeView
  63. 63. https://www.w3.org/TR/wai-aria-practices-1.1/#TreeView
  64. 64. https://www.w3.org/TR/wai-aria-practices-1.1/#TreeView
  65. 65. https://www.w3.org/TR/wai-aria-practices-1.1/#TreeView
  66. 66. What do you do if it’s not working? 1. Double check the spec 2. Double check your code 3. Google it 4. Check for known bugs in browsers and screen readers http://whoseline.a11yideas.com/bugs.html 5. Ask around! http://web-a11y.herokuapp.com/
  67. 67. http://accessibleculture.org/articles/2013/02/not-so-simple-aria-tree-views-and-screen-readers/
  68. 68. Showstopper Challenge
  69. 69. Think less about the method and more about the outcome.
  70. 70. Think less about the method and more about the outcome. Drag-and-drop Move something
  71. 71. Put into buckets
  72. 72. Put into buckets Rearrange lists
  73. 73. Put into buckets Rearrange lists Move on canvas
  74. 74. Put into buckets Rearrange lists Move on canvas
  75. 75. Salesforce’s Opportunity Kanban board
  76. 76. Salesforce’s Opportunity Kanban board
  77. 77. Salesforce’s Opportunity Kanban board
  78. 78. Putting things in buckets 1. Press Space on an item to open a menu of buckets. 2. Press Arrow keys to select a bucket in that list. 3. Press Enter to move item into that bucket. Inform user of interaction pattern: “Press space bar to select and move.”
  79. 79. Rearranging a list 1. Press Space on an item to enter drag mode. 2. Press Arrow keys to move element up or down. 3. Press Space to drop item. Inform user of interaction pattern and state: “Press space bar to select and move.” “Grabbed, current position: 1 of 5” “Dropped, final position: 3 of 5”
  80. 80. Wait, what about ARIA? ● ARIA 1.0 ○ drag-and-drop authoring suggestions ○ aria-grabbed attribute ○ aria-dropeffect attribute ● ARIA 1.1 ○ no authoring suggestions ○ aria-grabbed and aria-dropeffect are deprecated ○ (but don’t worry too much!)
  81. 81. Dropbox file browsing
  82. 82. Dropbox file browsing
  83. 83. Even more ways to move! ● Delete key for moving things into Trash bins ● Cut, Copy, and Paste support Positioning on a canvas x: 100 px 42 pxy: ● Arrow keys ● Input fields
  84. 84. Give users choice and flexibility. They’ll decide which methods are best for them.
  85. 85. Thanks! @cordeliadillon

×