Sub topic 11
Including Accessibility Requirements in the Handoff
Prerequisites and scope
This chapter assumes you have read the earlier chapters on design tokens, typography and color specs, and component states. You should know how a token such as --color-brand-primary reaches the CSS, and what a state list for a button looks like. You should also be able to read short HTML and CSS snippets.
The chapter covers the accessibility decisions that belong in a design file: contrast, focus, structure, names, target size, text scaling, and motion. It does not cover auditing a finished site. The reference point is WCAG 2.2 level AA, the standard most teams and legal requirements use.
Why accessibility belongs in the handoff
Developers build what the handoff shows. If a design shows only a mouse hover, the developer has no spec for keyboard focus. They will then accept the browser default or invent something. If the design shows an error as a red border, the developer will build exactly that, and users who cannot distinguish red will miss it.
Many accessibility failures are design decisions that were never written down. Putting them in the handoff has three effects:
- The developer does not have to guess.
- The reviewer has something concrete to test against.
- Fixes cost a spec edit instead of a rebuild.
Who decides what
Some requirements are visual, so the designer owns them. Others live in the code, but the designer must state the intent. The table shows a workable split.
| Requirement | Designer specifies | Developer implements |
|---|---|---|
| Color contrast | Token pairs and their measured ratios | The tokens as CSS custom properties |
| Focus indicator | Shape, color, thickness, offset | `:focus-visible` rule |
| Reading and tab order | Numbered order on the frame | DOM order that matches it |
| Headings and landmarks | Level of each heading, region names | Semantic elements such as `h2`, `nav`, `main` |
| Image text alternatives | Alt text, or "decorative" | `alt` attribute |
| Form labels and errors | Label text, error wording, error placement | `label`, `aria-describedby`, validation |
| Motion | Duration, easing, reduced-motion fallback | Transitions and a media query |
Specifying color and contrast
State contrast as measured ratios on named token pairs, not as "looks readable". WCAG AA sets these minimums:
- Normal text needs 4.5:1 against its background.
- Large text needs 3:1. Large means at least 24 CSS px, or 18.66 CSS px if bold.
- User interface components and meaningful graphics, such as input borders, icons, and focus rings, need 3:1 against adjacent colors.
Using the tokens from the earlier chapter, a contrast table in the handoff might read:
| Foreground token | Background | Ratio (approx.) | Use | Result |
|---|---|---|---|---|
| `color.text.default` (#1a1a1a) | white | above 16:1 | Body text | Pass |
| white | `color.brand.primary` (#1f5fd1) | 5.8:1 | Button label | Pass, text |
| `color.brand.primary` (#1f5fd1) | white | 5.8:1 | Focus ring | Pass, 3:1 needed |
| `color.text.disabled` (#8a8a8a) | white | 3.4:1 | Disabled label | Exempt, see note |
Measure with a contrast checker and record the number. A pair that passes in the design tool but changes in implementation, for example because of opacity, is a common source of regressions.
Never use color as the only carrier of meaning (WCAG 1.4.1). An error state needs an icon or text, not only a red border. A selected tab needs a shape change or weight change, not only a different hue.
Specifying focus and keyboard behavior
Every interactive element needs a visible focus state. This is the state most often missing from handoffs, because designers work with a pointer. In your component state sheet, add the focus state next to hover and make it distinct from hover.
Give the developer exact values: thickness, offset, color token, and corner shape. The focus rule from the earlier state chapter is a good example:
.button:focus-visible {
outline: 2px solid var(--color-brand-primary);
outline-offset: 2px;
}The 2 px outline in #1f5fd1 has a 5.8:1 ratio against white, so it meets the 3:1 requirement. If the same button sits on a dark panel, the spec needs a second focus color, because the ring must also contrast with that background. State this for each background the component appears on.
Three more points to put in the file:
- Tab order. Overlay numbered markers on the frame to show the intended order. The order should follow the visual reading order, usually left to right and top to bottom. If the visual layout and the intended order differ, say so explicitly, because the developer will otherwise have to choose.
- Focus not hidden. WCAG 2.2 (2.4.11) requires that a focused element is not entirely covered by other content. Sticky headers and cookie banners are the usual cause. Note the header height so the developer can add scroll padding.
- Custom widgets. For menus, tabs, dialogs, and carousels, list the keys: Tab, arrow keys, Enter, Space, and Escape. Say where focus goes when a dialog opens and where it returns when it closes.
Specifying structure and reading order
Screen reader users move through headings and landmarks the way sighted users scan a layout. The developer cannot infer heading levels from font sizes, because a visually large title may be a level 2 or level 3.
Annotate each frame with:
- The heading outline, for example
h1page title,h2section titles,h3card titles. Do not skip levels. - The landmark regions: header, navigation, main, complementary, footer. Label each navigation if there is more than one, such as "Primary" and "Footer".
- A skip link to the main content, if the page has repeated navigation, with the visual design of its focused state.
Heading levels describe structure, not size. A designer can show an h3 styled larger than an h2, but it is easier to maintain if the type scale and heading levels line up.
Specifying names, labels, and alt text
Every control needs an accessible name. For buttons with visible text, the visible text is the name. For icon-only buttons, you must supply one. Write the name in the annotation: "Close dialog", not "X".
For images, decide per image whether it is informative or decorative, and write the alt text in the handoff. This ties into the export chapter: the alt text belongs next to the asset name, not in a separate document. The responsive image example from earlier shows the result in code:
<picture>
<source type="image/webp" srcset="hero-800.webp 800w, hero-1600.webp 1600w" sizes="(min-width: 960px) 50vw, 100vw">
<img src="hero-800.jpg" srcset="hero-800.jpg 800w, hero-1600.jpg 1600w" sizes="(min-width: 960px) 50vw, 100vw" width="800" height="450" alt="Team reviewing a design on a shared screen">
</picture>Good alt text describes the purpose of the image in context, not its pixels. If the image is purely decoration, write "decorative" in the annotation, and the developer will use an empty alt="". Do not leave it blank in the file, because a missing note is ambiguous.
Form fields need a visible label that stays visible. Placeholder text is not a label, because it disappears when the user types and often has weak contrast.
Specifying target size and text scaling
WCAG 2.2 (2.5.8) sets a minimum target size of 24 by 24 CSS px for pointer inputs, with some exceptions for spacing. Many design systems use 44 by 44 px for touch, which matches the stricter AAA level and common platform guidance. Specify the size of the clickable area, not only the icon. A 16 px icon can sit inside a 44 px button.
Text must stay usable when users enlarge it. Two checks go into the handoff:
- Text can be resized to 200% without loss of content (1.4.4). Specify type in relative units such as
rem, and avoid fixed-height containers that clip text. - Content reflows at a 320 CSS px width without horizontal scrolling for most content (1.4.10). This lines up with your smallest breakpoint frame, so check that the narrowest frame works at this width.
Specifying motion and reduced motion
For every animation, state what the reduced-motion version looks like. Users can ask their operating system to limit motion, and CSS exposes that choice through prefers-reduced-motion. A short spec line such as "Card lift: 200 ms ease-out, translate 4 px. Reduced motion: no translation, color change only" gives the developer a complete rule:
.card {
transition: transform 200ms ease-out, box-shadow 200ms ease-out;
}
.card:hover {
transform: translateY(-4px);
}
@media (prefers-reduced-motion: reduce) {
.card {
transition: none;
}
.card:hover {
transform: none;
outline: 2px solid var(--color-brand-primary);
}
}Auto-playing motion that lasts longer than five seconds needs a pause or stop control (2.2.2). Anything that flashes more than three times per second must be avoided altogether.
Specifying errors and status messages
An error state needs more than a red field. Specify all of the following:
- An icon or text prefix, so color is not the only signal.
- The message wording, written to say what went wrong and how to fix it.
- The placement, usually directly below the field, linked in code to the input.
- The focus behavior on submit, such as moving focus to the first invalid field or to an error summary.
A minimal implementation of that spec looks like this:
<label for="email">Email address</label>
<input id="email" type="email" aria-invalid="true" aria-describedby="email-error">
<p id="email-error">Error: enter an address like [email protected].</p>Loading and success states also need announcements. If a toast appears with no focus change, the developer needs to know it should be announced through a live region. Mark these in the annotations.
Putting it in the file
The diagram shows where accessibility checks fit in the sequence you already follow for specs.
A short accessibility block next to each component keeps the information where the developer looks. A template that works in most tools:
- Role: button, link, dialog, tab, and so on.
- Accessible name: the exact text.
- Keys: the keyboard interactions.
- Focus: where it goes and what it looks like.
- Contrast: token pairs and ratios.
- Motion: fallback behavior.
- Notes: anything unusual.
Common errors
- Hover without focus. Only the mouse states are specified. Add
:focus-visibleto every state sheet. - Contrast checked on the wrong layer. Opacity and overlays change the final color. Measure what the user sees.
- Color-only meaning. Errors, links inside body text, and chart series need a second cue.
- Heading levels chosen by size. Annotate the level, not the font size.
- Alt text left to the developer. The developer rarely knows the intent of an image. Write it.
- Icon-only buttons with no name. Add a name for each.
- Fixed-height containers. Text enlarged by the user gets clipped. Spec min-height or flexible height.
Exercises
Exercise
A designer specifies a hover style that darkens a card's background and moves it up 4 px, with no other states. List three accessibility additions the handoff needs for this card.
Show answer
(1) A visible focus state, for example a 2 px outline with a 2 px offset that has at least 3:1 contrast against the card and page backgrounds. (2) A reduced-motion fallback that removes the 4 px movement and uses a non-motion cue such as an outline or color change. (3) Contrast ratios for the text on the darkened hover background, since the darker color changes the pair, plus the keyboard behavior if the whole card is clickable (which element receives focus and the accessible name).
Exercise
Your form design shows an invalid field with a red border and no other change. What do you add to meet the 1.4.1 requirement that color is not the only means of conveying information, and what do you specify for the developer so a screen reader user hears the error?
Show answer
Add a second visible cue, such as an error icon and a text message below the field that says what is wrong and how to fix it. For screen reader users, specify that the message is linked to the input (for example through aria-describedby) and that the field is marked invalid (aria-invalid="true"), and state where focus goes on submit, such as the first invalid field.
Exercise
A close button is a 16 px "X" icon with a 16 px clickable area. Which WCAG 2.2 AA requirement does it risk failing, and what do you change in the spec?
Show answer
It risks failing the minimum target size of 24 by 24 CSS px (2.5.8). Specify a clickable area of at least 24 by 24 px, and preferably 44 by 44 px for touch, while keeping the 16 px icon centered inside it. Also give it an accessible name such as "Close dialog", because an icon alone has none.