How to Build More Accessible Websites with WCAG 2.2


A website can look polished, work perfectly with a mouse, and still be difficult for some people to use.

A form might use colour as the only indication that something went wrong. A sticky header might completely cover the element that currently has keyboard focus. A login form might prevent users from pasting a password from their password manager. Or a custom button might work when clicked with a mouse but do nothing when someone uses a keyboard.

These are development decisions, not problems that only appear during an accessibility audit.

The Web Content Accessibility Guidelines (WCAG) provide a common standard for identifying and reducing many of these barriers. WCAG 2.2 is the latest WCAG 2 Recommendation, and the World Wide Web Consortium (W3C) advises developers and organisations to use WCAG 2.2 whenever possible.

This article focuses on the WCAG 2.2 Level A and AA requirements that frequently affect frontend development. The aim is to show how accessibility requirements connect to frontend development decisions.

Table of Contents

What Is WCAG 2.2?

WCAG stands for Web Content Accessibility Guidelines. W3C develops the standard to describe how web content can be made more accessible to people with disabilities.

WCAG 2.2 organises its requirements into principles, guidelines, and testable success criteria. The success criteria are technology-independent, which is important because WCAG doesn’t exist specifically for HTML, React, WordPress, or any other implementation technology.

Consider this hierarchy:

Principle: Operable

    Guideline 2.1: Keyboard Accessible

        Success Criterion 2.1.1: Keyboard

The principle gives you the broad accessibility objective. The guideline narrows that objective, while the success criterion provides the testable requirement.

W3C also publishes resources such as Understanding WCAG 2.2, How to Meet WCAG 2.2, and Techniques for WCAG 2.2. These resources explain the success criteria and provide implementation approaches, examples, and known failures. They’re informative rather than part of the normative WCAG requirements.

A W3C technique can show one recognised way to satisfy a criterion, but WCAG generally doesn’t require you to use that exact technique. Another implementation can also be valid if it meets the actual success criterion.

How WCAG Conformance Works

WCAG defines three conformance levels: A, AA, and AAA.

The levels build on one another. A page can’t claim Level AA conformance by satisfying only the criteria labelled AA. It must satisfy all applicable Level A and Level AA success criteria. Level AAA similarly includes A, AA, and AAA requirements.

This distinction is important because accessibility discussions sometimes reduce WCAG to individual checks.

You might fix the keyboard interaction on a menu, add alternatives to your images, and correct several contrast problems. Those are useful accessibility improvements, but they don’t automatically make the entire website “WCAG AA compliant”.

WCAG conformance applies to complete web pages. When a process requires several pages to complete, such as a checkout process, all pages in that process must conform at the claimed level.

The examples in this article therefore demonstrate ways to address particular accessibility requirements. They don’t constitute a conformance claim for an entire application.

How the Four WCAG Principles Work

WCAG groups its guidelines under four principles commonly remembered with the acronym POUR: Perceivable, Operable, Understandable, and Robust.

Perceivable means users need to be able to perceive the information you provide. Text alternatives, captions, contrast, and adaptable layouts fall under this principle.

Operable concerns how people interact with the interface. Keyboard operation, focus behaviour, navigation, pointer interactions, and timing are examples.

Understandable deals with whether users can understand the information and the way the interface behaves. Form instructions, useful error messages, predictable interfaces, and accessible authentication are relevant here.

Robust concerns whether browsers and assistive technologies can correctly interpret the content. Semantic HTML, accessible names, roles, values, and states are central to this principle.

These categories are useful, but accessibility problems rarely respect the boundary between HTML, CSS, and JavaScript.

A custom dropdown, for example, might need semantic information in the markup, visible focus styling in CSS, and correct keyboard behaviour in JavaScript.

Accessibility therefore works best when it forms part of the implementation itself rather than becoming a separate task at the end of development.

How to Start with Semantic HTML

One of the most useful accessibility decisions happens before you write any ARIA: choosing the correct HTML element.

Consider this:

Submit

A mouse user may be able to click the element, but a div doesn’t automatically behave like a button.

Compare it with this:


The native button already communicates its role to the browser and provides the expected keyboard behaviour.

This relates to Success Criterion 4.1.2 Name, Role, Value, which requires user interface components to expose information such as their name and role programmatically. W3C notes that standard controls already provide much of this information when developers use them according to their specification.

The practical implication is simple: don’t recreate browser behaviour unless you need to.

How Semantic HTML Communicates Page Structure

Semantic HTML also helps expose relationships between parts of a page.

You could build a page like this:

...

...

The classes may create the visual layout you want, but they don’t necessarily communicate the same structure programmatically.

A more meaningful structure could be:

...
...

Success Criterion 1.3.1 Info and Relationships requires structure and relationships communicated visually to also be programmatically determinable or available in text. Semantic markup can provide this information without requiring developers to recreate it with additional accessibility attributes.

This doesn’t mean that using

,



Source link

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top