Advertisement
Advertisement

More Related Content

Advertisement

The Great Accessibility Bake Off (A11y Camp Sydney)

  1. The Great Accessibility Bake Off
  2. @cordeliadillon Cordelia McGee-Tubb Web Accessibility Engineer
  3. Making products, services, and spaces that everyone can use and enjoy in all contexts, regardless of their abilities
  4. Visual
  5. Visual Motor
  6. Visual Motor Auditory
  7. Visual Motor Auditory Cognitive
  8. Creating flexible systems that consider all users’ experiences from the very start, not just via tacked-on accommodations
  9. Baking accessibility in
  10. Set Timer
  11. Set Timer <div class=“button--primary” onClick=“setTimer()”> Set Timer </div>
  12. Set Timer <div class=“button--primary” onClick=“setTimer()” tabindex=“0”> Set Timer </div>
  13. Set Timer <div class=“button--primary” onClick=“setTimer()” tabindex=“0” onKeyDown=“setTimer(e)”> Set Timer </div>
  14. Set Timer <div class=“button--primary” onClick=“setTimer” tabindex=“0” onKeyDown=“setTimer(e)” role=“button”> Set Timer </div>
  15. Set Timer <button onClick=“setTimer()”> Set Timer </button>
  16. Set Timer <button class=“button--primary” onClick=“setTimer()”> Set Timer </button>
  17. Image sources: http://ind.pn/2qIL6Qp and http://bit.ly/2pCoqDD
  18. Image sources: http://ind.pn/2qIL6Qp and http://bit.ly/2pCoqDD
  19. Image source: https://www.yahoo.com/style/anglophiles-and-baking-enthusiasts-received-a-106546370621.html
  20. Image source: http://ind.pn/2qINXsS
  21. You don’t have to be an accessibility expert to make great, accessible UIs.
  22. Image source: https://www.yahoo.com/style/anglophiles-and-baking-enthusiasts-received-a-106546370621.html
  23. Image source: http://ind.pn/2qINXsS
  24. Main Ingredients
  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. Semantic HTML is the core ingredient for accessible web UIs.
  27. <button> <article> <input> <table> <main> <ul> <nav> <li> <a href> <h1> <h2> <section> <div> <span> <a>
  28. ...but as we move from websites to web apps, sometimes we need to spice up our HTML with ARIA.
  29. Accessible Rich Internet Applications
  30. https://www.w3.org/TR/wai-aria-1.1/ Accessible Rich Internet Applications
  31. ARIA can communicate elements’ role, state, and properties to assistive technology when semantic HTML won’t suffice.
  32. ARIA can communicate elements’ role, state, and properties to assistive technology when semantic HTML won’t suffice.
  33. Use alternative text to make sure images’ meaning comes through.
  34. Informational: Short, descriptive alt text <img alt=“Cupcake” src=“icon-final-FINAL.png”/>
  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. 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. Use good text contrast.
  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. 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. 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. Judging Criteria
  42. Does it look amazing? Does it taste amazing? Is it well-baked?
  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. 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. Signature Challenge
  46. Subscribe <input type=“text”/> <input type=“email” required /> <input type=“checkbox” /> <input type=“submit” value=“Subscribe” /> 1. The fields themselves
  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. 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. 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. 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. 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. 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. 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. 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. 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. 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. https://www.sitepoint.com/replacing-radio-buttons-without-replacing-radio-buttons/
  58. Technical Challenge
  59. Our tried-and-true semantic HTML isn’t sufficient in this case.
  60. Let’s follow the given ARIA recipe.
  61. https://www.w3.org/TR/wai-aria-practices-1.1/#TreeView
  62. https://www.w3.org/TR/wai-aria-practices-1.1/#TreeView
  63. https://www.w3.org/TR/wai-aria-practices-1.1/#TreeView
  64. https://www.w3.org/TR/wai-aria-practices-1.1/#TreeView
  65. https://www.w3.org/TR/wai-aria-practices-1.1/#TreeView
  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. http://accessibleculture.org/articles/2013/02/not-so-simple-aria-tree-views-and-screen-readers/
  68. Showstopper Challenge
  69. Think less about the method and more about the outcome.
  70. Think less about the method and more about the outcome. Drag-and-drop Move something
  71. Put into buckets
  72. Put into buckets Rearrange lists
  73. Put into buckets Rearrange lists Move on canvas
  74. Put into buckets Rearrange lists Move on canvas
  75. Salesforce’s Opportunity Kanban board
  76. Salesforce’s Opportunity Kanban board
  77. Salesforce’s Opportunity Kanban board
  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. 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. 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. Dropbox file browsing
  82. Dropbox file browsing
  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. Give users choice and flexibility. They’ll decide which methods are best for them.
  85. Thanks! @cordeliadillon
Advertisement