Accessibility is a major topic in the software engineering industry, it's basically making anyone, even people with disabilities to be able to use your app
As a frontend engineer, I build "pixel-perfect" UIs, spending hours choosing the trendiest hex codes and spending hours on css animations. While these may look like all I do, there's still a silent, important part I also spend a lot of time on for the users who do not care about my crazy hover effects, box shadows or liquid glass effect.
Accessibility isn't a feature I implement because it is a "nice to have" feature, or so I can pass legal compliances, I do it so anyone and everyone can have access to information on my site, irrespective of physical or cognitive abilities
Why does it matter
For a user with visual impairments, your website isn't a collection of collored text and buttons, it's a structured tree of information interpreted using a screen reader. If the site is built without accessibility in mind, the user hits a wall, not knowing what your site is about or even how to navigate
The Frontend Devβs Toolkit
As frontend devs, our job is to give the users a great User Experience too and here are ways you can improve your site accessibility
-
Using Semantic HTML: This is the oldest trick in the book and the easiest way to improve accessibility. Stop using
<div>for everything and start using<header>,<nav>,<main>, and<button>.
Bad:
<div onclick="submit()">Submit</div>
Good:
<button type="submit">Submit</button>
This simple code tells users that the component is a submit button.
ARIA roles: For components where html elements alone do not do justice (eg tabs, accordion, etc), ARIA attributes bridge the gap providing extra context to what the element does and which state it's in (e.g, aria-expanded="true").
Keyboard Navigation: Not everyone uses a mouse, some people rely on the Tab key to navigate apps. It's crucial to ensure that the tab order follows the visual order of the page
Color Contrast and Text: While some users can see, but have color blindness or low vision, it's still essential to carry them along. Text and other elements should have clear contrast from background.
Every Image should also have an alt text. If it's decorative, usealt=""and if it contains info, describe the information clearly in the alt attribute
Accessibility do not just help people with permanent disabilities, it also helps people using their phone in bright sunlight, users without access to their mouse, just keyboard or people with broken arm while also helping people with slow Internet connection
Conclusion
Accessibility isn't about limiting you creativity, but about expanding your reach - Building apps that even blind people can "see".
Building with accessibility in mind means you aren't just writing codes, you're also advocating that the web is for everyone. Be that engineer who builds bridges, not barriers
Make your site be so good that the quality isn't just seen, but it's also felt
Top comments (0)