Web accessibility: not optional, it is the job
There is a very common temptation when people talk about web accessibility, and it is to treat it as that task you do at the end, if there is time and if the client asks for it. I have thought for years that this is badly framed, because an accessible website is not a website with an added extra: it is a website done well. And most of the time, what is more, it does not cost that much.
What we are talking about
Accessibility is the degree to which any person, regardless of their abilities, can use what you have built. Universal design goes one step further and seeks to make the product work for everyone from the start, without having to adapt it later for anyone in particular.
It is not a minor matter nor a whim: in the field of telecommunications it is regulated by law. And behind that law there is a fairly reasonable principle, which is that information must be within everyone’s reach.
The guidelines: the WCAG
The frame of reference is the WCAG, the W3C’s web content accessibility guidelines. They rest on four principles worth memorising, because they sum up almost everything:
- Perceivable: the information has to be able to be perceived, with alt text, enough contrast, etc.
- Operable: it has to be usable, with a keyboard, without depending only on the mouse.
- Understandable: the content and how it works must be understandable.
- Robust: it has to work with different assistive technologies.
Within this there are three levels of conformance: A, AA and AAA, from least to most demanding. The sensible goal, and the one I usually set as a minimum, is AA.
The seven principles of universal design
There was an architect, Ron Mace, who back in the eighties set out something that works for us programmers just as it is. His seven principles are: equitable use, flexibility in use, simple and intuitive use, perceptible information, tolerance for error, low physical effort and enough size and space. Reading them with a programmer’s eyes, not one of them is spare.
What you do day to day
Getting down to specifics, there are a handful of things that make the difference and that you can do without setting up a separate project:
- Enough contrast in texts, buttons and links.
- Visible focus: when navigating with the keyboard, you should see where you are. Losing focus across the page is maddening.
- Keyboard navigation: everything interactive must be reachable and usable without a mouse.
- Alt text on images that contribute something, and empty alt on decorative ones.
- Forms with properly associated labels, and error messages that explain what is going on.
- A declared language on the page, and a coherent heading order.
Why it is worth it
Because an accessible website is, almost always, a more usable website for everyone. The contrast that helps someone with low vision also helps someone looking at their phone in bright sun. Visible focus and the keyboard help those who navigate fast and do not want to let go of the keys. And well-labelled forms help everyone avoid mistakes.
It is, deep down, the same criterion I apply to other parts of the trade: if something is well made, it shows in every case, not only in the case you thought it up for.