WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Is ARIA required to conform to WCAG?

for

From: Patrick H. Lauke
Date: Mar 26, 2023 9:33AM


On 26/03/2023 15:53, Karen McCall wrote:
> Morning Everyone!
>
> 1. Is the use of ARIA attributes mandatory to conform to WCAG 2.x or are ARIA attributes optional? I can't find a definitive answer.

They're required *if* what you're building needs to expose its
name/role/state/value, but doesn't by default. Like a button that acts
as a toggle needs to expose when it's pressed or not pressed, so unless
you add aria-pressed="true"/aria-pressed="false" to expose its state
programmatically, you're failing 4.1.2 at least.

> * Can I have a WCAG 2.x conforming web site without using ARIA?

You can if you don't use/build any custom controls that make no
programmatic sense without ARIA.

> 2. If an ARIA attribute is used, does it affect the type of HTML tag used? For example, if a you have an <H1> tag and use ARIA attributes, does the tag now become a <P> Tag because of the ARIA attributes?

Depends which attribute. if you're adding a role, like <h1
role="button"> for instance, you've just told the browser to expose that
heading as a button. If you don't force a role, no, your elements will
remain the same, so you *can* add aria-* attributes without changing the
nature of the element (but of course, you need to actually know what
you're doing...can't just add aria attributes at random, they need to
still make sense...for instance, it would be utterly illogical - and
will likely be ignored by assistive technologies - if you did something
like <h1 aria-pressed="true"> because a heading can't have a state of
being pressed/not pressed.

I suggest learning more about aria itself and when it makes sense to use
it or not...

P
--
Patrick H. Lauke

https://www.splintered.co.uk/ | https://github.com/patrickhlauke
https://flickr.com/photos/redux/ | https://www.deviantart.com/redux
twitter: @patrick_h_lauke | skype: patrick_h_lauke