Sub topic 11
Including accessibility requirements in the handoff
This chapter assumes you have read the chapters on component states and on typography and color specs. You should also know basic HTML and CSS, and what a design token is. Accessibility requirements belong in the handoff because a developer can't see most of them in a static frame. Keyboard order, screen reader names, and focus rings are invisible in a mockup, so if you don't write them down, they usually don't get built.
What to specify
Cover five areas for every screen or component.
- Contrast. State the ratio for each text and color pairing, and the target level.
- Focus. Show the focus indicator and the keyboard order.
- Semantics. Name the element type and heading levels.
- Names and text alternatives. Give the accessible name of controls and the alt text for images.
- Target size and motion. Give minimum sizes for clickable areas and say what happens when the user prefers reduced motion.
Contrast
Check every text and background pair against WCAG 2.2 level AA. Body text needs at least 4.5:1. Large text (about 24px, or 19px bold) and UI parts such as input borders and focus rings need at least 3:1. Record the result next to the token pair instead of leaving the developer to measure it.
| Pair | Ratio | Result |
|---|---|---|
| White text on `color.brand.primary` (#1f5fd1) | about 5.8:1 | Passes AA for body text |
| `color.text.default` (#1a1a1a) on white | above 16:1 | Passes |
| `color.text.disabled` (#8a8a8a) on white | about 3.5:1 | Below 4.5:1, but disabled controls are exempt |
Note which values are exempt, such as disabled text, so the developer doesn't "fix" them. Also, never use color as the only signal. An error state should add an icon or text message, not only a red border.
Focus and keyboard order
Every interactive element needs a visible focus state, and the component-states chapter already lists it. Add the reading and tab order as a numbered overlay on the frame. The order should follow the visual order unless you explain why it differs. The focus rule from the earlier chapter looks like this in code:
.button:focus-visible {
outline: 2px solid var(--color-brand-primary);
outline-offset: 2px;
}The 2px outline in the brand color against a white page is well above the 3:1 requirement. Say so in the note, and state that the outline must never be removed without a replacement.
Semantics and accessible names
Tell the developer what each element is. A box that looks like a button but navigates to another page is a link, and a control that toggles something needs a state. Annotate heading levels as h1 to h6, and mark the landmarks: header, nav, main, footer. For icon-only buttons, give the exact accessible name. The developer can then write markup like this:
<button type="button" class="button" aria-label="Close dialog">
<svg aria-hidden="true" width="16" height="16" viewBox="0 0 16 16" focusable="false">
<path d="M3 3l10 10M13 3L3 13" stroke="currentColor" stroke-width="2" fill="none"/>
</svg>
</button>For images, write the alt text in the handoff, as in the hero image from the asset chapters. Mark purely decorative images so they get an empty alt="".
Target size and motion
Specify a minimum target of 24 by 24 CSS pixels, which is the WCAG 2.2 AA minimum. Aim for 44 by 44 on touch layouts. A small icon can keep its visual size if its padding extends the clickable area, so annotate the padding.
For motion, give a reduced-motion alternative for every animation. Typically a slide or fade becomes an instant change.
@media (prefers-reduced-motion: reduce) {
.panel {
transition: none;
}
}Exercise
A design shows a small "x" icon button, 16px square, with no label, and gray text (#767676) on a white card. List two accessibility notes you would add to the handoff.
Show answer
First, give the icon button an accessible name (for example "Close dialog") and specify padding so the clickable area is at least 24 by 24 CSS pixels. Second, record the contrast ratio of the gray text on white. #767676 on white is about 4.5:1, so it just passes AA for body text, and you should note that it must not get lighter.