Web Accessibility — The Hacker Way
Most people think the issue of accessibility is only for people with disabilities which is usually a small percentage of your users. But most of us encounter situational disability. We find ourselves in a situation where we can't use the keyboard, mouse, or the touchscreen, or are un able to see the screen, etc. Here are some thoughts on how to approach accessibility.
Join the DZone community and get the full member experience.Join For Free
have you heard about accessibility? do you know what that is? do you know what it takes to make your website accessible?
making your website accessible means providing the ability for everyone—regardless of disability or special needs—to use it.
unfortunately, if you put together all accessibility specifications and print it, the stack will be higher than cn tower in toronto:
this is not very encouraging. many people think that it is not worth the effort because the customer base with special needs is significantly low. however, there is a thing called situational disability that applies to all of us. moreover, when we are building our websites with accessibility in mind, we want to make them better for everyone. why? because most everybody is more comfortable when allowed to fill out forms on a website using just a keyboard (without mouse) and able to switch between fields fast. generally, everybody likes it when the focus is set on the search bar for sites because 99% of the time, the first thing you do is search for something. everybody likes properly matched colors (accessible contrast).
how do you get started? how to survive without reading tons of specifications?
3 steps to fulfill 80% standards with 20% effort
make your website
usable with keyboard
- make sure that focus outline is visible all the time and user can determine which element is currently focused
- no extra/unnecessary tab stops
- no tab-stop traps (when you cannot get out of an element with the keyboard)
implement smart focus management:
- set focus on appropriate elements after user actions (e.g., when a user navigates to a page with a login form – set the focus on the login text field; in 90% of the cases the next user action will be entering the login)
- restore focus to appropriate elements after user actions (e.g., when a user closes a menu, focus should be restored to the element that was focused on before opening the menu)
- make tab order user-friendly (remove non-actionable and non-informative tab stops)
make your website
usable with screen reader
- when element gets focused, screen reader should provide meaningful information to the user (e.g., “image satya nadella” when focused on satya’s image, or “menu collapsed” when focused on drop-down menu)
- min bar: make it good enough with one screen reader and one browser first. as of 2016-08-22 the best browser + screen reader combination is firefox + nvda (it has a text mode that prints output instead of converting it into speech: tools -> speech viewer)
- add aria tags to elements only when the screen reader cannot infer information from html (e.g. button element does not need role='button' as screen reader will infer it)
good to know
- don’t focus too much on “being compliant to the standards” at the beginning. just use common sense and your intuition. you can deep dive into the standards later on.
- make your website's most common scenarios work well first and focus on less popular pages later.
only 20% of accessibility requirements can be verified by tools. the rest has to be verified manually by:
- user studies
- an accessibility expert
resources to get started
- web accessibility tutorial
web accessibility resources
- especially: examples of accessible websites
- web accessibility: getting started (pluralsight)
if you are a web developer, you probably like it when the tool you are using enables you to do everything without the mouse. this is thanks to keyboard accessibility and smart focus management. if you play with any color contrast analyzers you will notice that colors with good contrast are easier to read and simply just look better. be aware that accessibility is about performance first. when your website is slow, it can lead to unexpected focus behaviors, unwanted user actions, or moving content. how many times have you tried to scroll to some part of a website and it wasn't moving because images were loading? i’m sure a lot.
what do you think? is the website you are working on accessible? have you ever even thought about it?
Published at DZone with permission of Jacob Jedryszek, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.