Skip to main content
skill CX Codex

wcag-accessibility — Claude Code skill: accessibility checks

This skill guides interface work against WCAG 2.2 AA, from contrast and keyboard access to form labels. Use it when building or reviewing user-facing UI.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add dembrandt/dembrandt-skills --skill wcag-accessibility -a claude-code
Open on GitHub

What wcag-accessibility does

The skill sets out accessibility checks for user interfaces, including text and component contrast, image alternatives, keyboard operation, visible focus, and form labels. It also covers page language, error messages, and predictable component behaviour. Interactive controls should work with a keyboard, and removing the focus outline requires a replacement style.

Its guidance follows WCAG 2.2 AA and EN 301 549, with stated thresholds for contrast and touch target size. The recommendation to use a font weight of at least 500 for muted text is identified as a house rule, not a WCAG requirement. Keep that distinction in mind when evaluating compliance with the standard itself.

What it helps with

  • check an interface against WCAG 2.2 AA
  • find text and controls with low contrast
  • add keyboard access and visible focus
  • write alternatives for images and button icons
  • associate form errors with their inputs

Example prompts for the agent

  • Check this interface against WCAG 2.2 AA.
  • Make this component work with a keyboard and screen reader.
  • Review the page’s contrast and focus indicators.

How to install wcag-accessibility

1Skills CLI (Vercel)

npx skills add dembrandt/dembrandt-skills --skill wcag-accessibility -a claude-code

2Manually: put the files in place

~/.claude/skills/wcag-accessibility/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/wcag-accessibility/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about wcag-accessibility

How do I install wcag-accessibility in Claude Code?

Run npx skills add dembrandt/dembrandt-skills --skill wcag-accessibility -a claude-code. The skill file will be available at ~/.claude/skills/wcag-accessibility/SKILL.md.

What does wcag-accessibility do?

It guides interface design and review against WCAG 2.2 AA, covering contrast, keyboard access, focus indicators, and accessible labels.

What touch target size does the skill recommend?

It gives 24×24px as the minimum for interactive elements on touch devices and 44×44px as a more comfortable recommendation.

Source text

SKILL.md · MIT
---
name: wcag-accessibility
description: WCAG 2.2 AA compliance as required by the European Accessibility Act. Use when designing, building or reviewing any user-facing interface for accessibility.
metadata:
  priority: 9
  docs:
    - "https://www.w3.org/TR/WCAG22/"
    - "https://www.etsi.org/deliver/etsi_en/301500_302000/301549/03.02.01_60/en_301549v030201p.pdf"
  pathPatterns:
    - "**/*.tsx"
    - "**/*.jsx"
    - "**/*.vue"
    - "**/*.svelte"
    - "**/*.html"
    - "**/*.css"
    - "**/*.scss"
    - "components/**"
    - "src/components/**"
    - "design-system/**"
  promptSignals:
    phrases:
      - "accessibility"
      - "wcag"
      - "a11y"
      - "contrast"
      - "contrast ratio"
      - "screen reader"
      - "aria"
      - "focus"
      - "focus visible"
      - "keyboard navigation"
      - "keyboard"
      - "colour blind"
retrieval:
  aliases:
    - wcag
    - accessibility
    - a11y
    - EN 301 549
    - European Accessibility Act
    - contrast
    - screen reader
    - aria
  intents:
    - check accessibility compliance
    - fix contrast ratio
    - add keyboard navigation
    - make component screen-reader friendly
    - meet EU accessibility requirements
  examples:
    - is this colour contrast accessible
    - make this component keyboard navigable
    - check this UI against WCAG
    - does this meet EU accessibility standards
---

# WCAG Accessibility (EN 301 549 / European Standard)

## The Standard

The **European Accessibility Act (EAA)** requires digital products and services in the EU to meet **EN 301 549**, which references **WCAG 2.2 Level AA** as the technical baseline. This is not optional — it is a legal requirement for products operating in the EU market.

**Default: always build to WCAG 2.2 AA.** Deviating requires explicit, documented justification. Do not skip accessibility requirements because of timeline pressure or design preference.

WCAG 2.2 AA organises requirements under four principles: **Perceivable, Operable, Understandable, Robust**.

---

## Perceivable

Users must be able to perceive all content and UI components.

### Colour Contrast
| Context | Minimum ratio | Enhanced (AAA) |
|---|---|---|
| Normal text (< 18pt / < 14pt bold) | **4.5 : 1** | 7 : 1 |
| Large text (≥ 18pt / ≥ 14pt bold) | **3 : 1** | 4.5 : 1 |
| UI components and graphical objects | **3 : 1** | — |

> **Check contrast on the real rendered page, not the spec (dembrandt engine, optional).** Design-time swatches lie once real text lands on real backgrounds, gradients, and overlays. `get_findings` / `render_report` run against the live DOM and surface the actual failing text/background pairs with their measured ratios — a fast way to catch the combinations a static palette review misses. See [`extract-design`](../extract-design/SKILL.md).

**Disabled elements are exempt.** WCAG explicitly excludes inactive UI components from contrast requirements (WCAG 1.4.3 exception). A disabled button may use low-contrast text — this is intentional and correct, as it communicates the unavailable state.

Do not use colour as the only means of conveying information (e.g. a red border alone to indicate an error — add an icon or text label).

**Weight is part of legibility, and the ratio cannot see it.** The contrast formula measures ink colour against background colour and nothing else. It scores a hairline and a heavy weight identically at the same hue, while perceived legibility is the product of both. So the palette's faintest legible colour and the type scale's lightest weight must not land on the same text: a muted or secondary token, the one carrying captions, labels and helper text, takes a weight of at least 500 wherever the body default reads as regular or light. *That floor is a house rule, not a WCAG requirement.* The standard has nothing to say about weight, which is exactly why the failure gets through the audit. The same physics on dark surfaces is in [[color-mode-and-theme]]. A muted colour is already the palette's least assertive choice, and pairing it with the lightest weight compounds two decisions that both mean *recede*. The result at caption sizes is text a reader has to work at consciously, while the audit reports a pass.

### Text Alternatives
- Every meaningful image needs `alt` text describing its content or function
- Decorative images use `alt=""` so screen readers skip them
- Icons used as buttons need an accessible label: `aria-label` or visually hidden text
- Charts and data visualisations need a text summary or data table alternative

### Captions and Transcripts
- Video content needs captions
- Audio-only content needs a transcript

---

## Operable

Users must be able to operate all UI components.

### Keyboard Navigation
All interactive elements must be reachable and operable by keyboard alone.

- Every button, link, input, and control must receive focus via Tab
- Focus order must follow the visual reading order of the page
- No keyboard traps — users must be able to navigate away from any component
- Modal dialogs must trap focus inside while open, and return focus to the trigger element on close

### Focus Visibility
A visible focus indicator is required on every interactive element (WCAG 2.2 strengthens focus visibility requirements).

```css
/* Minimum: do not remove focus outline without a replacement */
:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}
```

Never use `outline: none` without providing a custom focus style. The focus ring is not a design problem to eliminate — it is a navigation tool.

### Touch Target Size
Interactive elements on touch devices must be at least **24×24px** (WCAG 2.2) — **44×44px** is the recommended comfortable minimum (Apple HIG, Material Design). Small icon buttons need padding to reach this size even if the visual icon is smaller.

### No Seizure Triggers
Nothing on screen should flash more than 3 times per second.

### Skip Links
Pages with repeated navigation must provide a "Skip to main content" link as the first focusable element, so keyboard users can bypass navigation on every page.

---

## Understandable

Users must be able to understand the content and how the UI works.

### Language
- Set `lang` attribute on the `<html>` element: `<html lang="fi">` or `<html lang="en">`
- Mark inline content in a different language with `lang` on that element

### Labels and Instructions
- Every form input must have a visible label — not just a placeholder (placeholders disappear on input)
- Required fields must be indicated — do not rely on colour alone; add an asterisk and a legend
- Error messages must be associated with their input via `aria-describedby`

### Predictability
- Components that look the same must behave the same (see Consistency and Standards)
- Navigation must appear in the same location across pages
- Opening a new tab or window must be communicated in advance

### Error Identification
- Form validation errors must identify which field failed
- Errors must be described in text — not only by colour or icon

---

## Robust

Content must be interpreted reliably by assistive technologies.

### Semantic HTML
Use the correct HTML element for the job. Semantics convey role, state, and structure to screen readers for free.

```html
<!-- Correct -->
<button>Save</button>
<nav aria-label="Main navigation">...</nav>
<h1>Page title</h1>

<!-- Wrong — requires manual ARIA to replicate what the element provides natively -->
<div onclick="save()">Save</div>
<div class="nav">...</div>
<div class="heading">Page title</div>
```

### ARIA — Use Sparingly
ARIA supplements HTML semantics where native elements fall short. It does not fix broken HTML.

**Rule: no ARIA is better than incorrect ARIA.** Incorrect ARIA actively breaks screen reader output.

Required patterns:
- `aria-label` or `aria-labelledby` for components with no visible text label
- `aria-expanded` on toggles, accordions, and dropdowns
- `aria-live` regions for dynamic content updates (toast notifications, search results)
- `role="dialog"` with `aria-modal="true"` on modal overlays
- `aria-current="page"` on the active navigation item

### Status Messages
Dynamic updates (success toasts, loading states, error counts) must be announced to screen readers via `aria-live` or `role="status"` — they will not be announced automatically unless the focused element changes.

---

## The Disabled Element Exception

WCAG 1.4.3 explicitly states: *"Text or images of text that are part of an inactive user interface component… have no contrast requirement."*

This means:
- Disabled buttons, inputs, and links **may** use low-contrast text and colours
- The visual dimming of disabled states is both correct and compliant
- Do not add artificial contrast to disabled elements — the reduced contrast communicates "this is unavailable"

---

## Review Checklist

| Area | Check |
|---|---|
| Contrast | All active text ≥ 4.5:1 (normal) or 3:1 (large/UI) |
| Contrast | Disabled elements exempt — intentionally low contrast is fine |
| Colour | Colour is never the only information carrier |
| Keyboard | All interactive elements reachable and operable by keyboard |
| Focus | Visible focus indicator on every interactive element |
| Touch | Interactive targets ≥ 44×44px on touch surfaces |
| Labels | Every input has a visible label (not just placeholder) |
| Errors | Validation errors identify the field and describe the problem in text |
| HTML | Semantic elements used correctly; ARIA only where needed |
| Language | `lang` attribute set on `<html>` |
| Skip link | "Skip to main content" as first focusable element |
| Live regions | Dynamic updates announced via `aria-live` or `role="status"` |

© dembrandt · MIT · dembrandt/dembrandt-skills

Similar skills

Everything for Frontend and UI →

From the same set41

user-flows-and-guided-paths Guides the creation of multi-step wizards, checkout sequences, and onboarding journeys. Helps maintain clear step progression without trapping users. CX Codex +1 879installs responsive-paradigms Sets responsive design guidelines for AI coding agents, treating mobile, tablet, and desktop as distinct interaction paradigms rather than a single scaled layout. CX Codex +1 875installs gestalt-ui-organisation A skill that lays out controls by Gestalt principles so users see what belongs together without reading labels. Useful for toolbars, forms, navigation and dashboards. CX Codex +1 879installs visual-emphasis-and-hierarchy Enforces visual hierarchy rules in UI: button priorities, contrast, whitespace, and text emphasis. Useful when designing dashboards, cards, and CTA sections. CX Codex +1 874installs button-states A skill that defines six states for interactive elements and derives hover and active colours from the base colour in HSL. Useful when buttons in a project look unfinished. CX Codex +1 877installs component-family-consistency Keeps buttons, inputs, badges and pills on the same radius, colour logic, shadow, border and spacing. Useful when building or reviewing a component library. CX Codex +1 874installs loading-states-and-perceived-performance A coding-agent skill that picks the right spinner, skeleton or progress bar and makes a slow interface feel faster. CX Codex +1 871installs generate-ui-from-brand Turns a site URL or a DESIGN.md file into design tokens, UX decisions and a UI spec you can paste into a project. CX Codex +1 870installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor