A11y 101: Wai-aria

I'm a full-stack developer from South Africa 🇿🇦. I love writing about JavaScript, HTML and CSS.
Search for a command to run...

I'm a full-stack developer from South Africa 🇿🇦. I love writing about JavaScript, HTML and CSS.
No comments yet. Be the first to comment.
In this series I'll explore the basics of accessibility and you can join me on this learning trip.
In the previous article, we had a short introduction to WAI-ARIAs and what they are. Today we'll dive a bit deeper into one of the elements: WAI-ARIA roles. The specific roles can add semantic meaning to elements where HTML might miss this context. B...
Most of you know me for my consistency, a golden arrow in my blog series. I've written 1000 articles in 1008 days! Almost an article a day, and my honeymoon was the only holiday I ever took. I'm super proud of this achievement; it has been a fantasti...

It's not the first time I'll be talking about community. I think it's an essential aspect of any successful tool. This shows in my previous explorations of Astro, Medusa, and now Vendure as well. All these products thrive in a super open, welcoming, ...

The cool part about Vendure is how easy it is to set up and how abstract each layer is. Basically, we get the following elements: External database Server Worker Admin UI Frontend While this is amazing, it also brings a bit of complexity when it co...

The previous article looked at customizing Vendure on a data and process level. In this article, we'll look at customizing emails, as they are often a big part of a webshop system. We'll be looking at two different layers of customization for customi...

Even though Vendure is a pretty significant project out of the box, in some cases, we might want to go in and modify some elements to work to our specific use case. In this article, I'll take a high-level look at some elements we can customize within...

While digging into this accessibility journey, you might have heard me say a couple of times that semantics always win. However, this wasn't always the case.
Before HTML5, we didn't have all the fancy semantic elements like header, footer, or main. These kinds of elements were always described as plain divs with some markup.
That made it nearly impossible to define these elements as assertive technologies.
Hence WAI-ARIA comes to life.
You might be wondering what it even is, and it stands for Web Accessibility Initiative - Accessible Rich Internet Applications. It's a specification written by W3C defining a set of attributes you can use to provide additional semantics.
They are divided into multiple sections:
role="value"aria-labelledby="label"aria-disabled="true".All these WAI-ARIA only helps assertive technology to understand your webpage better. They do not physically have any other impact on how your website behaves.
You might have seen a couple of examples in this A11Y series where we used some of the WAI-ARIA's, and a general rule of thumb is:
"Only use them when you have no other native method".
They should be a last resort in making things accessible when native elements aren't sufficient.
For example:
<div role="navigation"></div>
Is a valid example, but we should opt for the semantic alternative:
<nav></nav>
You might be wondering, ok, which roles can I use then, and what are the alternatives?
And that would be a bit too much to explain in this article. So more on that in the next one as we deep dive into all the roles.
Another part where the WAI-ARIA's come to live is providing dynamic content updates for screen readers.
For example, there is the aria-live, which can be used to notify screen readers when content updates. Think about notifications on the screen or new content that gets refreshed.
A great example of an element heavily relying on WAI-ARIA's is the tab element we recently built.
Look at that article and see if WAI-ARIA makes more sense now.
WAI-ARIA's can enhance semantics and accessibility but should only be used as a last resort.
There is an impressively long list of elements, for which I'll write singular articles to go more in-depth.
Thank you for reading my blog. Feel free to subscribe to my email newsletter and connect on Facebook or Twitter