Skip to content
OAIT Design System

Design system / Foundations

Accessibility

The accessibility rules every OAIT product meets, in every language, theme, and product: the baseline, contrast, focus, targets, keyboard, screen readers, forms, motion, forced colors, zoom, languages, images, time limits, how to test, and the failures the audit found, turned into rules.

This page holds canonical §13 and the family's 28-rule baseline (D-BCP-25, D-BCP-26). Each component page gives that component's own keyboard and ARIA contract; this page gives what every component and page shares. The binding source is canonical.md; decisions are in the decision log; every checked color pair is in the contrast report.

Rules at a glance

  1. WCAG 2.2 level AA on every page, in every language the product ships (English, Arabic, French), in every theme it ships, and under the Tamakkan accent, plus the family rules on this page (D-BCP-25).
  2. Every control has a 48 × 48px target (56px for the main action). Links inside running text are the only exemption, and they get no minimum height (D-LAY-12, D-ARC-05).
  3. One focus ring: 3px solid --color-focus-ring, 2px outside the edge, at least 3:1 against the element and its ground. Never removed, never animated, never a box-shadow; containers re-point its color (D-SEM-11, D-ARC-06, D-COL-20).
  4. Text reaches 4.5:1 on its ground in every theme; 3:1 only from 24px. Control edges, focus rings, and chart marks reach 3:1. The token build checks every pair (D-COL-23, V-6).
  5. Never by color alone: status is a word, an icon, and a color; selection is a fill plus a check, a filled glyph, or a 2px edge; links in sentences are underlined (D-BCP-25, D-CAI-14).
  6. "Skip to content" is the first focusable element of every page and moves focus to <main id="main" tabindex="-1"> (D-CSN-49, C-2).
  7. Landmarks on every page, one h1 first in main, no skipped heading levels, no headings inside art (D-BCP-25).
  8. Everything works by keyboard. DOM order is visual order; Escape closes overlays and focus returns to what opened them (canonical §13).
  9. Every field has a visible label. Every error is words plus an icon, tied with aria-describedby, marked aria-invalid="true", and focus moves to it or to the error summary (D-CAI-10).
  10. One polite role="status" region per page, mounted empty with the page; role="alert" only for blocking errors (D-CSN-25).
  11. The server writes <html lang dir>; every part in another language carries lang; names, titles, and errors are translated (D-BCP-30, D-BCP-27).
  12. Reduced motion switches motion off; anything that moves by itself for more than 5 seconds has the Pause control (D-SEM-17, D-SEM-21).
  13. Forced colors: every control, card, and floating surface keeps a transparent 1px border; focus is an outline; icons follow currentColor (D-SEM-10, D-CAI-20).
  14. No horizontal scroll at 320px; text zooms to 200%; text containers take min-height, never fixed heights; meaningful text is 12px or more (canonical §13, D-TYP-17).
  15. No CAPTCHA puzzles, paste always works, help sits in the same place on every page, and no product locks the orientation (D-BCP-25).

The baseline

WCAG 2.2 AA is the floor on every page. The family adds rules where WCAG asks for less than the products need, or where the audit found the same failure in more than one product (D-BCP-25). Global ID's approved spec already binds 48px targets, 4.5:1 text, no color-only status, and reduced motion; every other family rule answers a failure the audit measured.

Where the family asks for more than WCAG

Topic WCAG 2.2 AA asks The family requires IDs
Target size 24 × 24px, with spacing exceptions (2.5.8) 48 × 48px for every control, 56px for the main action; only links in running text are exempt D-LAY-12
Focus a visible indicator (2.4.7), not hidden by other content (2.4.11) one ring: 3px, 2px outside the edge, 3:1 against the element and the ground, measured for every context D-SEM-11, D-COL-20
Large text 3:1 from 24px, or from about 18.66px bold (1.4.3) 3:1 from 24px only (headline-sm and larger, hero, display, numeral styles); title-md (18px, 700) needs 4.5:1 canonical §2.13
Contrast scope the pairs a page shows every pair a role may form, in light, dark, and the Tamakkan accent, failed by the token build D-COL-23, V-6
Text size no minimum 12px for any text that carries meaning, 16px in inputs, 28px on the projector stage D-TYP-17
Motion from interaction AAA only (2.3.3) reduced motion switches every animation and transition off D-SEM-21
Authentication no cognitive test without an alternative (3.3.8) no CAPTCHA puzzles at all: a honeypot and a rate limit D-BCP-25
Status messages announced without focus (4.1.3) one polite region per page, mounted at load; every toast has a role D-CSN-25
Errors identified and described in text (3.3.1, 3.3.3) words plus an icon, aria-invalid, aria-describedby, focus moved, a focused summary in long forms D-CAI-10
Languages and themes each page as served every language and every theme a product ships passes on its own D-BCP-25

The 28 rules and their tests

Every template passes all 28, in every language and theme it ships. The table is D-BCP-25's, with the values canonical.md settles: rule 9 counts large text from 24px only.

# Rule WCAG 2.2 Family standard Test
1 Skip link 2.4.1 "Skip to content" is the first focusable element; on focus it shows 12px from the top and 16px from the inline start as a 48px pill on --z-skip-link; it targets <main id="main" tabindex="-1"> Tab once on every template
2 Landmarks 1.3.1 header, labeled navs, one main, footer; labeled asides axe landmark rules
3 Headings 1.3.1, 2.4.6 one h1, first in main; no skipped levels; aside headings after the h1 in the DOM; never in illustrations heading outline per template
4 Target size 2.5.8 48 × 48px (56px main action); an ::after extends a smaller visual; inline links in sentences exempt, with no min-height hit-area test in e2e
5 Focus ring 2.4.7, 1.4.11 outline: 3px solid var(--color-focus-ring); outline-offset: 2px; −4px inside containers that clip; 3:1 against element and ground; containers re-point the color; never a box-shadow alone; never transitioned ring pairs in the token check; focus screenshots
6 Focus not obscured 2.4.11 no sticky element covers a focused one; scroll padding equals each sticky bar Tab through with the bars showing
7 Focus management 2.4.3 DOM order is visual order; a route or step change focuses the h1; dialogs hold and return focus; a failed submit focuses the first invalid field or the summary keyboard walkthrough
8 Keyboard 2.1.1, 2.5.7 everything by keyboard; radios and tabs use arrow keys (reversed in RTL); Escape closes overlays; every drag has a single-pointer alternative keyboard walkthrough
9 Text contrast 1.4.3 4.5:1 in every theme and product (3:1 only from 24px); placeholders are never instructions and stay at full strength token check; axe
10 Non-text contrast 1.4.11 control edges 3:1 (outline); hairlines only as decoration; selected and unselected 3:1 apart token check
11 Not by color alone 1.4.1 status is word, icon, and color; selection is color plus an edge or a check; links in sentences underlined review
12 Names 4.1.2, 2.5.3, 3.3.2 a visible label on every field; accessible names start with the visible text; icon-only buttons named; names translated axe; accessibility tree per language
13 Errors 3.3.1, 3.3.3 words plus an icon; aria-invalid; aria-describedby; a summary (role="alert", focused, links) when two or more fail in a form of more than five fields; novalidate so browser bubbles are never the only feedback e2e empty submits
14 Status messages 4.1.3 one polite role="status" region per page, present at load (snackbars, counts, "Address copied"); role="alert" for blocking errors; toasts have a role region present at load; screen-reader smoke test
15 Language 3.1.1, 3.1.2 server-rendered <html lang dir>; lang on other-language parts; translated <title>s and names per-language crawl
16 Motion 2.2.2, 2.3.3 the global reduced-motion switch; scripts read the media query and assume reduced motion on the server; anything moving more than 5 seconds has the Pause control and waits on hover and focus 0 running animations under reduced motion
17 Forced colors 1.4.11 filled controls and cards keep a transparent 1px border; focus is an outline; icons currentColor; marks one color forced-colors screenshot per template
18 Reflow and spacing 1.4.10, 1.4.4, 1.4.12 no horizontal scroll at 320px; text to 200%; min-height, never fixed heights on text containers 320px screenshots
19 Small text family real text 12px or more; smaller only inside aria-hidden art that has a text alternative font-size census
20 Authentication 3.3.8 no CAPTCHA puzzles; honeypot and rate limit; paste allowed; autocomplete tokens; passkeys offered review
21 Redundant entry 3.3.7 never ask twice in a flow; prefill what is known review
22 Consistent help 3.2.6 "Contact us" or "Get help" in the same place (footer, account menu) on every page review
23 Consistency 3.2.3, 3.2.4 the same components and the same glossary across products copy lint
24 Timing 2.2.1 snackbars with an action stay 10 seconds and wait on hover and focus; sessions warn before they end and offer more time e2e
25 Orientation 1.3.4 no orientation lock manifest check
26 Link purpose 2.4.4 link text says where it goes; new-tab links are announced copy review
27 Page titles 2.4.2 "{Page} · {Product}", translated; error pages name the state crawl
28 Disclosures 1.3.1, 4.1.2 a visible indicator (the rotating expand_more) and aria-expanded review

Contrast

What must reach what

What Minimum Where it is checked Rule
Body text, labels, links, helper and error lines, and placeholders 4.5:1 the token build Placeholders are full-strength on-surface-variant (9.33:1 on a light field fill, 11.30:1 dark), never faded (D-COL-11)
Text of 24px and larger: headline-sm and up, hero, display, numerals 3:1 the token build title-lg (20px) and title-md (18px, 700) still need 4.5:1 (canonical §2.13)
Projector stage text 7:1 stage review Projectors wash colors out; nothing below 28px (canonical §11, template 11)
A standalone icon that carries meaning 3:1 the token build Icons use the text roles, so they reach 4.5:1 in practice (canonical §8.2)
The edge that identifies a control (a field, a checkbox or radio box, an outlined button, or a segmented group) 3:1 the token build outline, never outline-variant alone (V-1, V-2)
The focus ring 3:1 against the element and against its ground the token build Re-point --color-focus-ring per context (Focus)
Selected against unselected 3:1, and a cue that is not color review primary-container plus check, a filled glyph, or a 2px primary-ink edge (D-CAI-14)
Chart marks 3:1 on the chart grounds the token build Only on surface, surface-container-lowest, card-outlined-container (V-3)
Disabled content exempt none on-surface at --opacity-state-disabled-content (38%); never used to signal invalid input (D-CAI-06)
Decoration: hairlines, skeletons, micro text inside aria-hidden art exempt none border-outline-variant (about 1.6:1) and bg-skeleton (1.30:1) identify nothing (D-COL-23)

The allowed pairs

node tokens/build.mjs --check checks 57 rules and 564 pairs in light, dark, and the Tamakkan accent, with no known failure: a new pair that fails is fixed, never waived (D-COL-23, V-6). If the pair you need is not in this table, it is not checked: change the ground or the text, never the hex.

Text or mark Grounds it may sit on Lowest, light Lowest, dark Tamakkan (light / dark)
on-surface every surface from surface to surface-container-highest, surface-raised, both card containers, the four pastels, primary-container 13.14:1 7.19:1 same
on-surface-variant the same 14 grounds 7.16:1 5.46:1 same
primary-ink, and the ring the same 14 grounds plus secondary-container, tertiary-container, warning-container, error-container 5.47:1 5.45:1 5.45:1 / 5.44:1
error, warning, info, success every surface to surface-container-highest, surface-raised, both card containers, and their own container 4.97:1 5.45:1 same
secondary, tertiary (small accents) surface, surface-container-lowest, surface-container-low, both card containers 5.82:1 10.01:1 same
on-primary on primary the orange fill (and the on-art button's white fill) 6.19:1 6.19:1 5.70:1 / 5.70:1
on-secondary, on-tertiary, on-success, on-warning, on-info, on-error their own fill 6.45:1 7.68:1 same
Every on-…-container and on-pastel-… its own container or pastel 13.12:1 7.22:1 on-primary-container 9.41:1 / 8.32:1
on-cat-…-container (person-type chips) its own categorical container 11.53:1 7.36:1 same
inverse-on-surface / inverse-on-surface-variant / inverse-primary inverse-surface 11.63 / 7.75 / 7.74:1 13.83 / 9.22 / 9.21:1 ink 7.73:1 / 9.19:1
on-card-art the -mid stops of categorical and passport art; large text only toward the -to stops 5.85:1 (3.23:1 on -to) same same
on-passport-jobs the gold Global Jobs passport 5.68:1 same same
outline (control edges) every surface, surface-raised, both card containers, primary-container 3.47:1 3.71:1 same; 3.87:1 / 4.62:1 on the violet tint
mark-ink the surfaces a mark sits on 6.61:1 12.28:1 same
chart-1 … chart-8 surface, surface-container-lowest, card-outlined-container 3.08:1 3.49:1 same
surface on on-surface (the focused skip link) the skip link pill 16.30:1 14.32:1 same
surface-container-lowest and surface on primary-ink (the on switch's thumb, the Radix checkbox's check), 3:1 the primary-ink fill 6.79:1 10.85:1 6.77:1 / 10.84:1

Measured beyond the build, because the format cannot declare composites (canonical §2.13):

  • Under the 8% hover layer, primary-ink keeps 4.53:1 or more on every surface, container, and pastel, the Tamakkan accent included.
  • Header glass over the inverse band keeps on-surface-variant at 6.12:1; a selected table row (bg-primary-container/30) keeps it at 8.64:1.
  • Accepted, not declared: pressed composites (momentary; the lowest is 4.09:1, primary-ink in a pressed row over the dark pastel-sand), disabled content, the orange fill's edge against the page (the label identifies the button), hairlines, the light sequential chart steps, micro text inside hidden card art.

The traps

AI tools and Material 3 habits produce these. Each was measured.

Trap Measured Write instead IDs
The orange fill as text, an icon, or a thin line: text-primary, border-primary, accent-primary 2.63:1 on the page, 2.76:1 on white text-primary-ink, border-primary-ink, accent-primary-ink D-COL-02, D-COL-03
primary as a progress fill or an on switch track 2.13:1 on its surface-container-highest track bg-primary-ink D-CSN-28, D-ARC-11
White on the orange fill 2.76:1 text-on-primary (6.19:1) D-COL-02
The dark outline on dark pastels and status containers 2.93–2.97:1 filled, tonal, or text controls there, or the control on a surface-container-lowest choice card V-1
outline-variant as the only edge of a field, a checkbox or radio box, an outlined button, or a segmented group about 1.6:1 border-outline (4.51:1 on the field fill) V-2
A focus ring nobody re-pointed primary-ink 1.85:1 on the light inverse-surface, 2.58:1 on the orange fill; white 1.33:1 on the gold Jobs passport re-point --color-focus-ring on the container D-COL-20, V-4
Secondary text or placeholders with an opacity modifier 3.96:1 (oait.app at 70%), 4.35:1 (Tamakkan) full-strength text-on-surface-variant D-COL-11
Charts inside filled or elevated cards, dialogs, menus chart-1 2.91:1 on surface-container-low; chart-4 2.95:1 and chart-6 2.71:1 on the dark surface-raised the three chart grounds only V-3
HBDI hues as marks on their own fills chart-3 2.88:1 on pastel-mint; chart-6 1.77:1 on the dark burgundy container letters in the fill's on-color; hues only as radar marks and card edges on the card surface V-3
shadcn.css together with data-product bg-primary stays orange while text-on-primary turns white: 2.76:1 never combine them V-5
A snackbar without its edge in dark inverse-surface is 1.18:1 from the dark page shadow-elevation-3 and a 1px outline border (5.85:1) D-ARC-08

Every theme and every language

  • The tokens do not change with the language, so every pair holds in Arabic and French. Arabic is never set smaller than the Latin it replaces; the Arabic eyebrow is 13px (D-TYP-14).
  • Check each theme a product ships. Default: each product sets <html data-theme="light"> until its dark review passes, then removes it (oait.app already follows the system; the Games stage is dark); run this page's checks in dark as part of that review. If declined, dark stays for oait.app and the Games stage only.
  • Under <html data-product="tamakkan"> the seven accent tokens change and the build checks them again; the lowest values are listed above (D-COL-15).

Focus

The ring

Property Value Token
Style a solid outline, never a box-shadow none
Width 3px --size-focus-ring
Offset 2px outside the edge --size-focus-offset
Offset inside containers that clip −4px: the ring sits 1px inside the edge --size-focus-inset
Shape follows the element's radius; text links take rounded-8px (Shape)
Color re-pointed on the container by context --color-focus-ring
Motion none: width, offset, and color are set at rest none

The rule is canonical §6.3. It ships in reference/css/base.css; a Tailwind product writes it in its base layer after Tailwind's preflight:

@layer base {
  :where(*) { outline-width: var(--size-focus-ring); outline-offset: var(--size-focus-offset); outline-color: var(--color-focus-ring); }
  :focus-visible { outline: var(--size-focus-ring) solid var(--color-focus-ring); outline-offset: var(--size-focus-offset); }
}
  • Components never restyle the ring. They may only move it inside: tabs, segmented buttons, list rows, table cells, and accordion rows set outline-offset: var(--size-focus-inset) on :focus-visible (Tailwind focus-visible:-outline-offset-4), because their container clips an outside ring. Anything else inside a clipping container takes base.css's .oa-focus-inset class, which moves the ring the same way (canonical §6.3, D-SEM-11, D-ARC-06).
  • Text fields show the ring and their primary-ink border together; neither replaces the other (D-SEM-11, D-CAI-20).
  • A clickable card draws the ring on its stretched title link's ::after, with the card's radius (D-CSN-04).
  • Over photos, video, or multi-stop art that has no context color, add the halo: base.css's .oa-focus-halo draws box-shadow: 0 0 0 2px var(--color-surface) on :focus-visible, so the surface color fills the gap between the control's edge and the ring (Tailwind focus-visible:ring-2 focus-visible:ring-surface). The class sets the halo alone: a control that also casts an elevation shadow composes the two in its own CSS. The halo adds to the outline; it never replaces it (canonical §6.3).
  • In forced colors the ring takes the system Highlight color (base.css).
  • Never write outline: none, outline: 0, or all: unset in component CSS, never draw a ring with box-shadow or inset-ring, and never transition outline-color or outline-offset: a ring that fades in is the wrong color for its first 150ms, and a box-shadow ring disappears in forced colors (D-SEM-11, canonical §17).

Re-pointing the color

The geometry never changes; only the color does, set once on the container (D-COL-20, D-ARC-07, V-4).

Context Set on the container Lowest contrast
Every surface, container, and pastel nothing: --color-focus-ring is primary-ink 5.45:1 (Tamakkan 5.44:1)
Inverse band, snackbar --color-focus-ring: var(--color-inverse-primary) 7.74:1 (Tamakkan 7.73:1)
Focusable content inside an orange fill (bg-primary), whose ring is drawn on the fill. A filled button or FAB keeps the default ring, because its ring lies outside the fill (on-primary there is 1.08:1 on the dark page) --color-focus-ring: var(--color-on-primary) 6.19:1 (Tamakkan's violet fill 5.70:1)
Card and passport art --color-focus-ring: var(--color-on-card-art) 3.23:1
The gold Global Jobs passport --color-focus-ring: var(--color-on-passport-jobs) 5.68:1
<!-- Tailwind: the arbitrary property goes on the container, never on each control -->
<section class="rounded-hero border border-transparent bg-inverse-surface px-5 py-10 text-inverse-on-surface [--color-focus-ring:var(--color-inverse-primary)] sm:px-10 lg:px-16 lg:py-16">
  …
</section>
  • Re-point only for what sits on the colored ground. A filled orange button on the page keeps the default ring, because its ring is drawn outside it, on the page (D-COL-20).
  • The "Sign in with Global ID" kit keeps fixed portable colors; its next release draws the family geometry in fixed #8f4200 (#ffb68a on a dark host), the light and dark values of primary-ink written as literals so the kit works outside the family's tokens (C-6).

Focus order and focus management

DOM order is visual order: the text column before the art, the listing's h1 before its filters, the main action where it appears (D-LAY-08, canonical §13). Never move a focusable element with order or row-reverse, and never mirror a layout with them (canonical §14.2). Default: the text comes first on Global ID's landing on phones; if declined, only the non-interactive card art moves up with order-first, and the type chips stay after the buttons, so the focus order does not change.

Focus moves only at these moments:

Moment Focus goes to IDs
A page loads nowhere: Tab once reaches the skip link D-CSN-49
The skip link is followed <main id="main" tabindex="-1">, which draws no ring (below) C-2
A route changes in a single-page app, or a step changes (sign-in, setup, a stepper) the new h1 or step heading, given tabindex="-1"; it keeps the base ring (below) canonical §13, D-CSN-20
A dialog or bottom sheet opens the first field of a form; Cancel in a destructive confirm; the main button in an information dialog. It stays inside; the page is inert D-CSN-21
A dialog, sheet, or the phone menu sheet closes (Escape, the scrim, Close, Cancel, a choice) the control that opened it D-CSN-12, D-CSN-21
A menu, popover, language list, or tooltip closes with Escape its trigger D-CSN-23
A submit fails the first invalid field; the error summary when two or more fail in a form of more than five fields D-CAI-10
An input chip is removed the next chip, or "Clear filters" when none is left D-CAI-18
A snackbar or a status message appears nowhere: focus stays; the polite region announces it D-CSN-25
Content updates in place (filters applied, a count changes) nowhere: the status region says what changed ("15 jobs match these filters.") canonical §11
// After a route or step change: focus the new heading, so screen readers start from it.
const heading = document.querySelector('main h1')
heading.setAttribute('tabindex', '-1')
heading.focus()
  • main is the one element that draws no ring: when the skip link moves focus to it, base.css sets main[tabindex="-1"]:focus { outline-style: none; }, because the ring would frame the whole page, and the next Tab draws it on the first control inside (D-CAI-08, D-CSN-49).
  • A heading focused by script keeps the base ring, like every control (canonical §6.3). Browsers draw it only when :focus-visible applies: after a step change it shows when the person pressed Enter or Space, and not after a click (measured in Chromium), so it tells a keyboard user where the new step starts without framing the heading for mouse users.

Focus not obscured

  • Sticky chrome never covers a focused element (WCAG 2.4.11). Web pages with the sticky header set html { scroll-padding-top: calc(var(--size-scroll-offset) + env(safe-area-inset-top)); } (96px plus the top inset of standalone apps; Tailwind scroll-pt-[calc(var(--size-scroll-offset)+env(safe-area-inset-top))] on <html>), which keeps that room above every focused field and every anchor target (D-LAY-15, D-LAY-17). Canonical §4.10 also names scroll-margin-top on anchor targets; never set it as well: the two add up to 192px (measured in Chromium), so the family uses the scroll padding alone.
  • Above a sticky bottom action bar, scroll-padding-bottom equals the bar's height plus 16px while it shows (D-CSN-50).
  • Short viewports (landscape phones, and 200–400% zoom) turn sticky headers and sticky bars static with short:static, at (max-height: 30rem), so the content keeps its room (D-LAY-17, D-ARC-30).

Targets

--size-touch-target (48px) is the least hit area of every control on every product; WCAG 2.5.8 asks for 24px. The 44px floor of oait.app, Global Games, and Tamakkan retires (D-LAY-12).

Control Visual Hit area How
Small button (--size-button-sm) 40px 48px relative after:absolute after:inset-x-0 after:-inset-y-[5px]
Medium button (--size-button-md), icon button, segmented button, medium chip 48px 48px its own box (h-12, size-12)
Large button (--size-button-lg): the main action, the "Sign in with Global ID" kit 56px 56px h-14, or min-h-14 when the label may wrap
Small chip in admin filter rows 32px 48px relative after:absolute after:inset-x-0 after:-inset-y-[9px]
Checkbox and radio 20px the whole <label> row, at least 48px tall the label wraps the native input
Switch 52 × 32px track 64 × 48px the button around the track
Standalone link, back link, footer link text 48px tall inline-flex min-h-12 items-center
Link inside a sentence text exempt no minimum height, so line spacing stays even
Text field, select 56px 56px h-14
  • The ::after sits on the padding box, which the 1px border shrinks, so the extender counts the border: after:-inset-y-1 gives only 46px on a 40px button (D-ARC-05).
  • Extended controls in a row keep 8px (40px buttons) or 16px (32px chips) between them, so their hit areas never overlap (D-ARC-05).
  • When ::after is taken, as on a stretched card link, extend through the padding box instead (D-ARC-05).
  • Text-bearing controls that may wrap take min-h-12 or min-h-14, never a fixed height: Arabic line heights and French labels grow them (D-LAY-12).
  • Every icon control has a 48 × 48px target whatever its glyph size (canonical §8.2).

Keyboard

Everything a pointer can do, a keyboard can do, in the same order the screen shows it (canonical §13).

Keys

Key What it does
Tab, Shift+Tab moves to the next or previous control, in reading order
Enter follows a link, presses a button, submits a form
Space presses a button, ticks a checkbox, toggles a switch, presses a toggle button
Arrow keys move between radios of a group and between tabs, and through an action menu; left and right reverse in Arabic
Home, End the first or last tab, or menu item
Escape closes the topmost dialog, sheet, menu, popover, language list, or tooltip, and returns focus to its trigger

Patterns per component

The family follows the WAI-ARIA Authoring Practices (APG). Native elements come first: actions are <button> (type="button" unless it submits), navigation is <a href>, never role="button" on a link or a clickable div (D-CAI-01).

Component Pattern Keyboard Focus and state Page
Link native <a href> Enter text links take the ring on rounded-8px Link
Button, icon button native <button> Enter, Space an icon button carries aria-label and the plain tooltip with the same words Button, Icon button
Toggle button: filter chip, segmented button, platform tile, "Show password" <button> with aria-pressed Enter, Space; Tab between them the name never changes between states Chip, Segmented button
Checkbox native, in a <label> row Space groups are a fieldset with a legend Checkbox, radio, and switch
Radio group, single-choice chips, choice cards native radios in a fieldset arrow keys move and select; Tab enters and leaves the group the browser reverses left and right in RTL by itself (measured in Chromium; confirm Safari and Firefox in the manual pass) Choice card
Switch <button type="button" role="switch"> with aria-checked Space, Enter applies at once; named by its visible setting Checkbox, radio, and switch
Tabs APG tabs, automatic activation Left and Right (reversed in RTL), Home, End; Tab moves into the panel inset ring; tabs that change the URL are a <nav> of links with aria-current="page" Tabs
Disclosure list: language switcher, account links a button with aria-expanded and a list of links or buttons in the Tab order; no role="menu" Enter or Space opens; Tab moves through; Escape closes the current item has aria-current="true"; closes on Escape, an outside press, focus leaving, and a choice Menu, Language switcher
Action menu: row actions, "More" APG menu button Enter, Space, or Down opens on the first item; Up and Down move; Home, End; Escape closes closes on Escape, an outside press, focus leaving, and a choice; focus returns to the button Menu
Dialog, bottom sheet, side sheet APG modal dialog: native <dialog> with showModal(), or Radix Dialog Tab and Shift+Tab stay inside; Escape closes initial focus per type; the page behind is inert; focus returns Dialog, Bottom sheet, Side sheet
Accordion and FAQ native <details> and <summary>; controlled disclosures are a button with aria-expanded and aria-controls Enter, Space inset ring; the expand_more indicator rotates Accordion, FAQ
Tooltip role="tooltip", referenced by aria-describedby appears at once on focus; Escape hides it supplementary only, never the title attribute Tooltip
Data table a native table in a region with tabindex="0" and a name Tab reaches the region and its controls; arrow keys scroll the region a full-height sort button in each sortable header; the header cell carries aria-sort Table
Snackbar buttons inside the polite host Tab reaches its action and "Close message" its timer waits while it has focus Snackbar
Card stack, platform strip toggle tiles in a role="group" with a visible label, and the Pause control Enter, Space picks a card picking stops the auto-advance for good Platform strip, Pause control

Pointer alternatives

  • Every drag has a single-pointer alternative (WCAG 2.5.7). Swipe-to-dismiss on a bottom sheet is optional and never the only way out; there is no drag-and-drop upload, custom slider, or custom listbox in 1.0: files use a native input inside a button-styled label (D-CAI-11, D-CSN-22).
  • Hover never carries anything essential: tooltips are supplementary, and a card's hover shadow is feedback only (D-CSN-24, D-SEM-15).
  • The card-stack tilt follows the mouse only and is decoration (D-SEM-20).

The first focusable element of every page, in every shell: hidden above the window until it takes focus, then fixed 12px from the top and 16px from the inline start, on the highest layer of the ladder (--z-skip-link, 80), a 48px on-surface pill with surface text in label-lg, plus the ring. It is its own class, never a screen-reader-only utility and its undo, which loses the padding (D-CSN-49, D-CAI-08, D-ARC-26, C-2).

<body>
  <a class="oa-skip-link" href="#main">Skip to content</a>
  <!-- header -->
  <main id="main" tabindex="-1">…</main>
</body>
<!-- Tailwind: fixed, parked above the window until focused -->
<a href="#main" class="fixed top-3 start-4 z-80 inline-flex min-h-12 items-center rounded-full bg-on-surface px-5 py-3 text-label-lg text-surface -translate-y-[calc(100%+1.5rem)] focus:translate-y-0">Skip to content</a>
English Arabic French
Skip to content الانتقال إلى المحتوى Aller au contenu (native review)

Never "Skip to main content" (C-2).

Screen readers

Landmarks

Landmark Element Name IDs
Banner <header>: the site header or the app bar none D-CSN-09
Navigation <nav> "Main" for the header's links; each footer group by its visible title (Global Jobs: "Job seekers", "Employers", "Help"); "Breadcrumb"; "Pagination" D-CSN-15, D-CSN-17, D-CSN-18
Main one <main id="main" tabindex="-1"> none D-BCP-25
Complementary <aside> its job: "Filters", "Apply for this job" (Global Jobs) D-BCP-25
Search <form role="search"> "Search jobs" (Global Jobs) D-CAI-11
Content info <footer> none D-CSN-15

Headings and titles

  • One h1 per page, the first heading in <main>; no skipped levels; the headings of an aside come after the h1 in the DOM (D-BCP-25).
  • Illustrations and device mock-ups never contain heading elements; their words live in one hidden sentence (D-BCP-25, D-BCP-40).
  • Headings describe their section. A FAQ section has an h2; its questions are not headings (canonical §10.25, §12.5).
  • <title> is "{Page} · {Product}", translated except the product name; error pages name the state: "Page not found · Global Jobs" (D-BCP-17, D-CSN-30).

Names

The accessible name starts with the visible label, in the page language, so speech input matches what people see (WCAG 2.5.3, canonical §12.5).

Control Visible Accessible name
Language switcher, three languages translate icon, "English" "Language: English" · "اللغة: العربية" · "Langue : Français"
Language toggle, two languages translate icon, "العربية" "العربية" plus hidden "Switch to Arabic" in the page language
Report button "Report" "Report this job" (Global Jobs)
Filters button with a count badge "Filters", badge "1" "Filters, 1 filter on"
Password visibility visibility icon "Show password", the same in both states, with aria-pressed
Icon buttons an icon "Close", "Menu" · "القائمة", "Close message" · "إغلاق الرسالة" · "Fermer le message", "Pause animation", "More actions for {name}"
Lock-up link mark and product name the product name: "Global Jobs", never "Global Jobs — home"
"Sign in with Global ID" kit "Global ID" "Sign in with Global ID" · "تسجيل الدخول باستخدام ⁦Global ID⁩" · "Se connecter avec Global ID"
A link that opens a new tab its text and north_east its text plus hidden "(opens in a new tab)" · "(يُفتح في نافذة جديدة)" · "(s’ouvre dans un nouvel onglet)" (native review)
  • Icon-only buttons always have aria-label and the plain tooltip with the same words; never the title attribute alone (canonical §10.2).
  • An input chip names the action and then its value: "Remove filter: Full-time" (Global Jobs, canonical §10.9). It is the one name canonical gives that leads with an action; it still contains the visible text, which is what WCAG 2.5.3 requires.
  • A count is part of the control's name, not a separate announcement: "Filters, 1 filter on" (canonical §10.26).
  • Product names stay Latin inside Arabic. In HTML: <bdi lang="en" translate="no">Global ID</bdi>; in plain-text names (an aria-label, a title), the isolates U+2066 … U+2069 around the Latin run, as in the kit's Arabic name above (D-BCP-03, canonical §14.2).

Descriptions and hidden text

  • aria-describedby links a field to its hint or error, then its lock line; a switch to its hint; a dialog to its description; a control to its tooltip (D-CAI-10, D-CSN-21, D-CSN-24).
  • Text for screen readers only uses .oa-visually-hidden (Tailwind sr-only): "(opens in a new tab)", "Switch to Arabic", a figure's sentence. Never display: none or the hidden attribute for text that must be read, except as the target of aria-describedby, which reads hidden text.
  • Decorative things are hidden: icons aria-hidden="true" with translate="no"; kit shapes, glows, and the hand-drawn underline aria-hidden="true"; a mark beside its name alt=""; a status dot beside its words (D-BCP-25, D-BCP-37).
  • Art that means something is hidden as a whole and replaced by one visually hidden sentence: "Sample Global ID cards, one for each type: Student, Faculty, Staff, Guest, and Alumni." · "نماذج من بطاقات Global ID، واحدة لكل نوع: طالب وعضو هيئة التدريس وموظف وضيف وخريج." (Global ID; D-BCP-38).

Live regions

Message Region Example (Global ID's shipped strings where three are given) IDs
A past-tense confirmation, with an optional Undo the snackbar host: role="status" aria-live="polite", one per page, mounted empty "Mobile number saved" · "تم حفظ رقم الهاتف" · "Numéro de mobile enregistré"; after Undo "Change undone" · "تم التراجع عن التغيير" · "Modification annulée" D-CSN-25
A count after the content changes in place the page's polite status region "15 jobs match these filters." (Global Jobs) canonical §11
An inline confirmation that reverts after --duration-dwell-confirm (2,400ms) a polite region present from load "Copy address" → "Address copied"; "Codes copied." · "نُسخت الرموز." · "Codes copiés." D-CAI-18
The selected count of a bulk bar a polite region present from load the count of selected rows D-CSN-34
A state that lasts (live, waiting) the words beside the dot or spinner; when the state changes after load, they sit in a polite region present from load (canonical §13) "Ready to scan" · "جاهز للمسح" · "Prêt à scanner"; "Getting your scan code…" · "جارٍ تحضير رمز المسح…" · "Préparation de votre code à scanner…" D-CSN-27, D-CSN-28
Loading a known layout [aria-busy="true"] on the region and one hidden "Loading {thing}…"; the skeleton blocks are hidden "Loading {thing}…" D-CSN-29
Progress role="progressbar" with values and a name, and the value in words "Profile 80% complete" · "اكتمل 80% من ملفك الشخصي" · "Profil complété à 80 %" D-CSN-28
A blocking error after an action an error banner above the main button, role="alert" "That email or password isn’t right." D-CSN-26
A failed submit with two or more errors in a form of more than five fields the error summary: role="alert", tabindex="-1", focused "Your message was not sent" (Global Jobs) D-CSN-26
A field error never a live region: tied by aria-describedby, read when focus lands "Enter an email address, like name@example.com." D-CAI-10
  • Mount the host empty with the page and write messages into it later: a region inserted together with its text is often not announced (D-CSN-25).
  • One snackbar at a time; a new one replaces it. Never role="alert" on a snackbar, never focus it, never an icon or a color code in it (D-CSN-25).
  • Field messages are never live regions: on a four-error submit they would all speak at once (D-CAI-10).
  • Every toast has a role. A product that uses Sonner configures it as canonical §10.21 gives: unstyled toasts with the snackbar classes, one visible at a time, a close button, 6 and 10 seconds, and the focus ring restored (D-CSN-25).
<!-- Once per page, after the page content, empty at load (the snackbar component fills it) -->
<div class="oa-snackbar-host" role="status" aria-live="polite"></div>

Forms and errors

Fields

  • Every field has a visible <label for> above it; optional fields add "(optional)" in words, never an asterisk; groups are a fieldset with a legend (D-CAI-09, D-CAI-10, D-CAI-12).
  • Placeholders are only "For example: …", never a label, an instruction, or the only format hint; they stay at full on-surface-variant (D-CAI-10).
  • Each field has its type, inputmode, and autocomplete token; paste always works; values are 16px so phones do not zoom (canonical §10.4, §13).
  • Latin-only values (email, phone, code, password) sit in boxes with dir="ltr"; Arabic name inputs take dir="rtl" (D-BCP-30).
  • A locked value is read-only, never disabled: it stays focusable, shows a lock icon, and says why in words ("From the Registrar") (canonical §10.4, §11).
  • The submit is never disabled to signal missing input: people press it and get the errors (D-CAI-06).

Errors

When What happens IDs
Typing, before the first submit nothing: no error while a person is still typing D-CAI-10
A submit with errors in a form of five fields or fewer, or with one error in a longer form each invalid field gets its error line and aria-invalid="true"; focus moves to the first invalid field D-CAI-10
A submit with two or more errors in a form of more than five fields the same, plus the error summary at the top of the form, which takes focus canonical §10.4, §13
After the first submit each field is checked again as it changes, so an error clears as soon as it is fixed D-CAI-10
A problem that belongs to no field (server, rate limit, signed out) an error banner above the main button with role="alert"; the typed values stay canonical §10.4
  • Forms set novalidate, so browser bubbles are never the only feedback (canonical §13).
  • An error replaces the helper line: a filled 16px error icon and words in text-error font-medium; the label stays on-surface; the edge turns error (D-CAI-10).
  • Error copy is verb first, says what to do, and gives an example when a format matters; never "please", "invalid", or "oops" (D-BCP-20).

The field, as in reference/snippets/inputs.html:

<div class="oa-field">
  <label class="oa-field__label" for="tf-email">Email</label>
  <div class="oa-field__control" dir="ltr">
    <input class="oa-field__input" id="tf-email" name="email" type="email" autocomplete="email" autocapitalize="none" spellcheck="false" value="lina.haddad@" aria-invalid="true" aria-describedby="tf-email-error">
  </div>
  <p class="oa-field__error" id="tf-email-error"><span class="oa-icon oa-icon--filled" aria-hidden="true" translate="no">error</span>Enter an email address, like name@example.com.</p>
</div>

The error summary, as in Banner: one link per invalid field, each repeating that field's error; following a link puts focus in the field (D-CSN-26):

<div class="oa-banner oa-banner--error" role="alert" tabindex="-1" aria-labelledby="fb-summary-title">
  <span class="oa-icon oa-icon--md oa-icon--filled oa-banner__icon" aria-hidden="true" translate="no">error</span>
  <div class="oa-banner__content">
    <h2 id="fb-summary-title" class="oa-banner__title">Your message was not sent</h2>
    <p class="oa-banner__message">Check the highlighted fields.</p>
    <ul class="oa-banner__list">
      <li><a class="oa-link oa-link--standalone" href="#fb-contact-topic"><span class="oa-link__label">Choose what your message is about.</span></a></li>
      <li><a class="oa-link oa-link--standalone" href="#fb-contact-reply"><span class="oa-link__label">Enter your email or phone number so we can reply.</span></a></li>
      <li><a class="oa-link oa-link--standalone" href="#fb-contact-message"><span class="oa-link__label">Write your message (up to 4,000 characters).</span></a></li>
    </ul>
  </div>
</div>
// On submit: show the errors, then move focus once.
form.addEventListener('submit', (event) => {
  const invalid = showErrors(form) // your validator: sets aria-invalid and each error line, returns the invalid fields in order
  if (invalid.length === 0) return
  event.preventDefault()
  const summary = form.querySelector('.oa-banner--error[tabindex="-1"]')
  const target = invalid.length >= 2 && summary ? summary : invalid[0]
  target.focus()
})

The forms and settings pattern holds the full flow; Text field holds every field state.

Authentication

  • No CAPTCHA puzzles: a hidden honeypot field and a rate limit (WCAG 3.3.8, D-BCP-25).
  • Paste works in every field, password and code fields included; autocomplete is username, current-password, new-password, or one-time-code, so password managers and the phone's code autofill work (canonical §13, D-BCP-25).
  • A one-time code is one mono field with inputmode="numeric" and autocomplete="one-time-code", never split boxes (canonical §10.4).
  • Passkeys are offered in plain words: "Use face or fingerprint instead"; "Sign in with face or fingerprint" · "تسجيل الدخول بالوجه أو البصمة" · "Se connecter avec le visage ou l’empreinte" (Global ID).
  • Never reveal whether an account exists; never ask twice for what the flow already knows (WCAG 3.3.7, D-BCP-20).

Motion

Rule How IDs
Reduced motion switches motion off the base-layer switch in base.css: every animation and transition none !important, smooth scrolling off, ::backdrop and view transitions in rules of their own D-SEM-21
Scripts follow the same setting check matchMedia('(prefers-reduced-motion: reduce)') live, listen for changes, and assume "reduce" until the browser answers (server rendering) D-SEM-21
Every state still changes instantly: overlays appear and go, the switch thumb jumps, the ID card faces swap, spinners and live dots stand still beside their words canonical §7.7
Anything that moves by itself for more than 5 seconds can be paused the 48px Pause control inside the moving region: "Pause animation" with pause, then "Play animation" with play_arrow; it sets [data-motion="paused"] on the region and stops the auto-advance for the visit; hidden under reduced motion D-SEM-17, C-4
Auto-advance waits while the pointer is over the region or focus is inside it; stops for good once a person picks an item; never under reduced motion D-SEM-17
Loops stay where they belong ambient loops (float, sheen, seal, drift) only in marketing hero art; status loops only while their state lasts, always with words; one-shots finish within 5 seconds D-SEM-17
Nothing flashes no more than three flashes in any one second; celebration particles hidden under reduced motion D-SEM-22
Nothing waits for an event that never comes never wait for transitionend or animationend to change state: the switch removes them D-SEM-21
  • WCAG 2.2.2: pausing on hover and the reduced-motion setting are not mechanisms every person can find; the visible control is (D-SEM-17).

The motion foundation has the switch, the script contract, and the table of what still happens; Ambient motion and the Pause control has the Pause script.

Forced colors

Windows contrast themes replace every color with a system color and remove every box-shadow. Build so that no edge, focus, or state depends on a fill or a shadow (D-SEM-10, D-CAI-20, canonical §13):

Rule Why
Every control, card, and floating surface keeps a 1px border, transparent at rest the mode draws transparent borders in a system color, so the edge survives
Focus is an outline; base.css turns it to Highlight outlines survive; box-shadows compute to none
Selected states keep a non-color cue: check, the filled glyph, a 2px edge; a selected choice card adds outline: 2px solid Highlight fills become system colors
Disabled controls use GrayText in the reference CSS the 12% and 38% mixes are replaced
Icons follow currentColor; marks are one color they follow the system text color
Glass bars go opaque the mode keeps a background's alpha
Never separate a surface by shadow-elevation-1 or shadow-elevation-3 alone shadows are removed

Zoom, reflow, and text spacing

Rule How IDs
Reflow at 320px (WCAG 1.4.10; also 1280px at 400% zoom) mobile-first layouts from 320px, no horizontal page scroll; data tables keep their columns and scroll inside a focusable, named region D-LAY-02, D-CSN-34
Text to 200% (1.4.4) browser zoom to 200% loses nothing: containers grow, nothing is clipped; the viewport meta is exactly width=device-width, initial-scale=1, viewport-fit=cover, never with maximum-scale or user-scalable=no, which block zoom on phones D-LAY-17
Text spacing (1.4.12) text containers take min-height, never a fixed height; labels wrap, never truncate (the one exception is the app bar's context chip, which truncates first, canonical §10.15); truncate only user data in tables, with the full value available D-TYP-17, canonical §13
Short viewports short:static turns sticky headers and bars static at (max-height: 30rem), which is where 200–400% zoom and landscape phones land D-LAY-17
Long values emails, URLs, and IDs break with wrap-anywhere; mono secrets such as an API key with break-all D-TYP-17
French at 360px French runs about 26% longer than English overall and up to 32% for short labels; test every screen at 360px; buttons wrap rather than truncate D-TYP-15
Minimum text 12px for meaningful text, 16px in inputs; smaller only inside aria-hidden art whose meaning is given in text D-TYP-17
Orientation (1.3.4) no orientation in the manifest and no orientation lock D-BCP-11, D-BCP-25

Language of the page and its parts

  • The server renders <html lang dir>: lang="en" dir="ltr", lang="ar" dir="rtl", lang="fr" dir="ltr"; dir="rtl" is for Arabic only. Screen readers choose their voice from lang, so a wrong attribute reads Arabic with an English voice (D-BCP-30).
  • lang goes on every element in another language than the page: each endonym in the language list ("English", "العربية", "Français"), card faces (the English front and the Arabic back set their own lang and dir), and quoted text (canonical §14.2).
  • Inside Arabic, Latin runs are isolated so they keep their order:
Content inside Arabic Markup
Product names <bdi lang="en" translate="no">Global ID</bdi>
Emails, URLs, domains <bdi dir="ltr">name@example.com</bdi>
Phones, IDs, codes <bdi dir="ltr" translate="no">GU-25-000123</bdi>; inputs dir="ltr"
Signed numbers, units, numeric dates <bdi dir="ltr">+2</bdi>, <bdi dir="ltr">08 / 2030</bdi>
User content dir="auto", plus lang when it is known
Plain text (<title>, an aria-label, notifications) U+2066 … U+2069 around the Latin run
  • Every product ships English and Arabic complete: no untranslated chrome, title, accessible name, or error (canonical §14.1).
  • Directional icons flip through the registry, never per use; checks, media controls, clocks, numbers, and codes never mirror (Iconography, D-BCP-33).

The languages and right-to-left foundation holds the full rules.

Images, icons, and media

  • Alt text is in the page language and starts with what matters on this page; never "image of". A photo that identifies a person names the person; an avatar beside its name, a mark beside its name, and a decorative character take alt="" (Imagery, D-BCP-36).
  • Hero art, card stacks, and collages are aria-hidden="true" as a whole, with one visually hidden sentence when they carry meaning. Device previews keep the visible caption "Illustrative product preview" at 12px or more (D-BCP-38, D-BCP-40).
  • Never put words a person needs inside an image: text lives in HTML.
  • An SVG that carries meaning has a <title> (canonical §8.1); icons in controls are hidden and the control carries the name (Iconography).
  • Charts: a legend for two or more series, values in text roles, never status by a chart color; HBDI quadrants always lettered (D-COL-19).
  • Person types always show their label and icon beside their color (D-COL-18).
  • No product ships video or audio today. When one does, WCAG 2.2 AA applies as it does to everything else (captions, a text alternative, a visible pause), and nothing autoplays under reduced motion (canonical §7.7).

Time limits

Limit Rule IDs
Snackbars --duration-dwell-snackbar (6 seconds), --duration-dwell-snackbar-action (10 seconds) with an action; the timer waits while the snackbar is hovered or focused; an Undo that matters also has a second path D-CSN-25
Sessions warn before a session ends and offer more time: WCAG 2.2.1 asks for at least 20 seconds to extend with one simple action canonical §13
Auto-advance waits on pointer and focus, stops with the Pause control or a pick D-SEM-17
Inline confirmations revert after --duration-dwell-confirm (2,400ms), in a polite region D-CAI-18
One-time links and codes (security limits) say the limit in words when it starts, and say what to do after: "This link works once and expires in 72 hours. After that, ask the Identity & Access Office for a new one."; "It works once, for the next 15 minutes."; "The code changes every 30 seconds. Use the one showing now." (Global ID) canonical §12.5

Consistent help

  • "Contact us" or "Get help" sits in the same place on every page of a product: the footer, and the account menu in app shells (WCAG 3.2.6, D-BCP-25).
  • The same components and the same glossary across products, so one learned pattern works everywhere (WCAG 3.2.3, 3.2.4, D-BCP-21).
English Arabic French
Contact us التواصل معنا (native review) Nous contacter (native review)
Get help الحصول على مساعدة (native review) Obtenir de l’aide

Testing

Every template gets the same checks before it ships, in every language and theme the product ships (canonical §13, D-BCP-25).

Check How Passes when
Token contrast node tokens/build.mjs --check 0 failures
Page audit the harness below, at 390 and 1440px, light, dark, and right to left it prints GATE PASSED
Skip link Tab once the skip link shows, is 48px tall, and moves focus to main
Heading outline a script over h1–h6 one h1, first in main; no skipped levels
Targets the hit-area test below every control 48 × 48px (inline links exempt)
Forced colors page.emulateMedia({ forcedColors: 'active' }) and a screenshot every edge, the ring, and every selection still show
Reflow 320px and 360px screenshots, French included no horizontal scroll; nothing cut, nothing overlapping
Languages lang and dir per language; the title and accessibility tree of each language attached to the report lang and dir right; a person finds every name, title, and error translated in each tree
Rules engine axe with the WCAG 2.2 A and AA tags 0 violations
Reduced motion page.emulateMedia({ reducedMotion: 'reduce' }) 0 running animations; transitions 0s

The page audit

The package ships its checker in tools/ (tools/README.md says how to install it). From the package root:

node tokens/build.mjs --check
node tools/audit-page.cjs reference/kitchen-sink.html audit-out --tokens tokens/oait.css --variants light,dark,rtl,dark-rtl,tamakkan,dark-tamakkan --widths 390,1440 --full --root . --gate
  • The kitchen sink always runs in all six variants. Any other page adds tamakkan,dark-tamakkan when the change touches primary*, the ring, or mark-accent (CONTRIBUTING.md §5).
  • For each variant and width it reports console errors, horizontal overflow, text contrast of every visible text node against its real background, colors that are not tokens, controls with a hit area under 48px (under 24px fails the gate), controls without a name, images without alt, and the fonts that rendered. It writes a screenshot of each.
  • It treats only text of 24px and up as large, as the family does (canonical §2.13): bold text between 18.66 and 24px, which WCAG would allow at 3:1, must reach 4.5:1 to pass.
  • node tools/twcheck.mjs . components/ patterns/ rejects text-primary and palette colors in Tailwind classes; point it at a product's own source the same way.

Playwright and axe

The suite every template copies. It follows Global ID's end-to-end patterns (boundingBox, emulateMedia, getAnimations, the side-scroll check) and adds axe through @axe-core/playwright.

// e2e/a11y.spec.ts: the family checks for one template, in every language the product ships.
import AxeBuilder from '@axe-core/playwright'
import { expect, type Page, test } from '@playwright/test'

const PATH = '/' // the template under test
const LANGUAGES = [
  { lang: 'en', dir: 'ltr', skip: 'Skip to content' },
  { lang: 'ar', dir: 'rtl', skip: 'الانتقال إلى المحتوى' },
  { lang: 'fr', dir: 'ltr', skip: 'Aller au contenu' },
] as const

// Cookie products (Global ID, Games, the Tamakkan app) choose the language with oait_locale.
// URL products (oait.app, Global Jobs, the Tamakkan landing) open `/${lang}${PATH}` instead.
async function open(page: Page, baseURL: string | undefined, lang: string) {
  if (!baseURL) throw new Error('Set use.baseURL in playwright.config.ts')
  await page.context().addCookies([{ name: 'oait_locale', value: lang, url: baseURL }])
  await page.goto(PATH)
}

/** How far the page scrolls sideways: 0 when nothing sticks out. */
const sideScroll = (page: Page) =>
  page.evaluate(() => document.documentElement.scrollWidth - document.documentElement.clientWidth)

for (const { lang, dir, skip } of LANGUAGES) {
  test.describe(`${PATH} in ${lang}`, () => {
    test.beforeEach(async ({ page, baseURL }) => open(page, baseURL, lang))

    test('the server sets lang and dir; the accessibility tree goes to the report', async ({ page }, testInfo) => {
      await expect(page.locator('html')).toHaveAttribute('lang', lang)
      await expect(page.locator('html')).toHaveAttribute('dir', dir)
      // A person reads each language's title and tree for names and errors left untranslated.
      const tree = await page.locator('body').ariaSnapshot()
      await testInfo.attach(`tree-${lang}`, { body: `${await page.title()}\n${tree}`, contentType: 'text/plain' })
    })

    test('Tab once shows the skip link, and Enter moves focus to main', async ({ page }) => {
      await page.keyboard.press('Tab')
      const link = page.getByRole('link', { name: skip })
      await expect(link).toBeFocused()
      await expect(link).toBeInViewport()
      expect((await link.boundingBox())?.height).toBeGreaterThanOrEqual(48)
      await page.keyboard.press('Enter')
      await expect(page.locator('main#main')).toBeFocused()
    })

    test('one h1, first in main, and no skipped heading levels', async ({ page }) => {
      await expect(page.locator('main h1')).toHaveCount(1)
      const levels = await page.locator('h1, h2, h3, h4, h5, h6').evaluateAll((headings) =>
        headings
          // What a screen reader reaches: not a closed dialog, sheet, or menu, not hidden art.
          .filter((heading) => heading.checkVisibility() && !heading.closest('[aria-hidden="true"]'))
          .map((heading) => Number(heading.tagName.slice(1))),
      )
      expect(levels.filter((level) => level === 1)).toHaveLength(1)
      expect(levels[0]).toBe(1)
      levels.forEach((level, i) => {
        if (i > 0) expect(level - (levels[i - 1] ?? level), `heading ${i + 1}`).toBeLessThanOrEqual(1)
      })
    })

    test('every control has a 48 by 48px target', async ({ page }) => {
      const small = await page
        .locator('a[href], button, input:not([type="hidden"]), select, textarea, summary, [role="switch"], [tabindex="0"]')
        .evaluateAll((controls) => {
          const half = 23 // probe 1px inside each edge of a 48px box: hit-testing rounds the point
          return controls.flatMap((control) => {
            if (!control.checkVisibility()) return []
            // Links inside running text are exempt and keep no minimum height.
            const style = getComputedStyle(control)
            if (control.tagName === 'A' && style.display === 'inline' && control.closest('p, li, td')) return []
            // A 20px checkbox or radio, and a hidden file input, count by their label.
            const target =
              control instanceof HTMLInputElement && ['checkbox', 'radio', 'file'].includes(control.type)
                ? (control.labels?.[0] ?? control)
                : control
            target.scrollIntoView({ block: 'center', inline: 'center', behavior: 'instant' })
            const box = target.getBoundingClientRect()
            if (box.bottom <= 0 || box.top >= innerHeight) return [] // parked off screen, like the skip link
            const x = box.left + box.width / 2
            const y = box.top + box.height / 2
            // Hit-testing counts an ::after extender as part of its control.
            const points: Array<[number, number]> = [[x, y - half], [x, y + half], [x - half, y], [x + half, y]]
            const covered = points.every(([px, py]) => {
              const hit = document.elementFromPoint(px, py)
              return hit !== null && (hit === target || target.contains(hit))
            })
            const name = control.getAttribute('aria-label') ?? control.textContent ?? ''
            return covered ? [] : [`${control.tagName.toLowerCase()} "${name.trim().slice(0, 40)}"`]
          })
        })
      expect(small).toEqual([])
    })

    test('no horizontal scroll at 320px; screenshots at 320 and 360px', async ({ page }, testInfo) => {
      for (const width of [320, 360]) {
        await page.setViewportSize({ width, height: 800 })
        expect(await sideScroll(page), `${width}px`).toBe(0)
        const body = await page.screenshot({ fullPage: true })
        await testInfo.attach(`reflow-${lang}-${width}`, { body, contentType: 'image/png' })
      }
    })

    test('forced colors: a screenshot of every edge, the ring, and each selection', async ({ page }, testInfo) => {
      await page.emulateMedia({ forcedColors: 'active' })
      await page.keyboard.press('Tab')
      const body = await page.screenshot({ fullPage: true })
      await testInfo.attach(`forced-colors-${lang}`, { body, contentType: 'image/png' })
    })

    test('reduced motion stops every animation and transition', async ({ page }) => {
      await page.emulateMedia({ reducedMotion: 'reduce' })
      await page.reload()
      const motion = await page.evaluate(() => {
        const probe = document.createElement('div')
        probe.style.transition = 'opacity 1s'
        document.body.append(probe)
        const transition = getComputedStyle(probe).transitionDuration
        probe.remove()
        return { running: document.getAnimations().length, transition }
      })
      expect(motion).toEqual({ running: 0, transition: '0s' })
    })

    test('the polite status region is on the page from load, empty', async ({ page }) => {
      expect(await page.locator('[role="status"][aria-live="polite"]:empty').count()).toBeGreaterThan(0)
    })

    test('axe finds no WCAG 2.2 A or AA violation', async ({ page }) => {
      const { violations } = await new AxeBuilder({ page })
        .withTags(['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa', 'wcag22aa'])
        .analyze()
      expect(violations).toEqual([])
    })
  })
}
  • Install @axe-core/playwright as an exact dev dependency. It takes playwright-core as a peer: keep that at the version of @playwright/test, or a second copy is installed and TypeScript rejects new AxeBuilder({ page }).
  • Run it in light, and in dark for a product that ships dark: add test.use({ colorScheme: 'dark' }) in a second describe.
  • The reflow and forced-colors screenshots, and each language's accessibility tree, are attached to the report (npx playwright show-report); a person reviews them for each release, as the manual checks below say.
  • The suite was measured in Chromium. Before adding it to a WebKit project, check that Tab reaches links there: Safari skips links on Tab by default, which would fail the skip-link check on a compliant page.

Flows add their own checks. Two that every product needs: an empty submit on a sign-in form (template 2) and a one-field edit (template 6). The names come from the products: "Sign in" and "Email" from the sign-in forms, and Global ID's Me page, where the "Change mobile number" button opens the dialog "Change your mobile number" with its "Mobile" field. Use your product's routes and names, and keep exact: true: a plain "Sign in" also matches "Sign in with Global ID".

test('an empty submit focuses the first invalid field and ties its error', async ({ page }) => {
  await page.goto('/sign-in')
  await page.getByRole('button', { name: 'Sign in', exact: true }).click()
  const email = page.getByRole('textbox', { name: 'Email', exact: true })
  await expect(email).toBeFocused()
  await expect(email).toHaveAttribute('aria-invalid', 'true')
  await expect(email).toHaveAccessibleDescription(/^Enter/)
})

test('a dialog takes focus, holds it, and gives it back', async ({ page }) => {
  await page.goto('/me')
  const opener = page.getByRole('button', { name: 'Change mobile number', exact: true })
  await opener.click()
  const dialog = page.getByRole('dialog', { name: 'Change your mobile number', exact: true })
  await expect(dialog.getByRole('textbox', { name: 'Mobile', exact: true })).toBeFocused()
  // Tab and Shift+Tab may pass through the browser's own controls, never the page behind the dialog.
  for (const key of ['Tab', 'Tab', 'Tab', 'Tab', 'Shift+Tab', 'Shift+Tab', 'Shift+Tab', 'Shift+Tab']) {
    await page.keyboard.press(key)
    const behind = await dialog.evaluate((box) => {
      const active = document.activeElement
      return active !== null && active !== document.body && !box.contains(active)
    })
    expect(behind, `${key} reached the page behind the dialog`).toBe(false)
  }
  await page.keyboard.press('Escape')
  await expect(dialog).toBeHidden()
  await expect(opener).toBeFocused()
})

Manual checks

Automated checks miss what only a person notices: a confusing order, a name that is technically present but wrong, an announcement that comes twice. Before each release, a person runs these on every changed template.

Check How Look for
Keyboard unplug the mouse; Tab from the address bar to the footer and back with Shift+Tab the ring on every stop, never hidden under sticky chrome; order equals reading order; no trap; Escape closes every overlay and focus returns; arrows in tabs and radios, reversed in Arabic
VoiceOver Safari on an iPhone and on a Mac the rotor's landmarks and headings; every control's name, role, and state; snackbars and counts announced once; errors read when focus lands
TalkBack Chrome on an Android phone the same, with swipe navigation and double-tap; the bottom bar and sheets reachable
NVDA Firefox or Chrome on Windows the same in browse mode and focus mode; tables read with their headers; dialogs announced with their title
Zoom the browser at 200%, then a 1280px window at 400%; a phone in landscape nothing cut or overlapping; one scroll direction; sticky bars turn static on short screens
Arabic the page in Arabic the layout mirrors; directional icons flip and media icons do not; numbers, codes, and Latin names keep their order ("+2", not "2+"); the Arabic voice reads the page
French the page in French at 360px labels wrap and never truncate; only the app bar's context chip ("Console d’administration") may truncate, and it gives way before the lock-up name
Forced colors a Windows contrast theme every control's edge, the ring, every selection, and every status still show
Reduced motion the system setting on nothing moves; every state still changes; the Pause control is gone
Dark the system in dark, for a product that ships dark the same checks; overlays rise above the page; snackbars keep their edge

Failures found in the audit, turned into rules

The scans of the five live products found these, measured on the real pages (the accessibility section of each site audit). Each is now a rule on this page. Items are the drift report's P1 items, fixed first in the rollout, except TK-2.10.

Failure Product and place Measured Rule now Items
Loops and auto-advance with no way to stop them Global ID landing hero: the card stack advances; gu-float-stack 6s, gu-sheen 7s, gu-spin 9s, and drift 14s and 18s loop fails WCAG 2.2.2 in production the Pause control on every region that moves for more than 5 seconds ID-1.01 (D-SEM-17)
A Pause control that stops only the rotation oait.app hero, a 44px button the float, sheen, and seal keep looping "Pause animation" pauses every loop in its region; 48px OA-1.09 (D-SEM-17, C-4)
Box-shadow focus rings Tamakkan product pages: outline: none with a double box-shadow ring gone in forced colors the outline ring TK-1.03 (D-SEM-11)
Rings below 3:1 Global Jobs toast (a gray box-shadow); Global Games on the forest band; Global ID Home apps tile ring in the primary fill (#f47920); Tamakkan's lilac "motion" ring 1.61:1; 2.40:1; 2.76:1; 1.31:1 one ring, its color re-pointed by context JB-1.03, GG-1.02, ID-1.04, TK-1.03 (D-COL-20)
Rings of other sizes Global Jobs 2px; Global Games five width and offset pairs (3/3, 3/5, 2/4, 3/4, 2/3px); Tamakkan landing offset 5px; Global ID station rows 2px — 3px, 2px outside, −4px inside clipping containers JB-1.06, GG-1.02, TK-1.03, ID-1.08 (D-SEM-11)
Animated rings oait.app (outline-color in a color transition); Global ID hero chips the wrong color for 150–200ms set at rest, never animated OA-1.14, ID-1.08 (D-SEM-11)
Fields that hide the ring Global ID text fields (a 2px border instead of the ring) — the ring over the field's own edge ID-1.07 (D-CAI-20)
An invisible control Tamakkan's ◐ theme toggle on the dashboard 1.00:1 in light the family's header toggle (a 48px dark_mode icon button, "Dark theme") and "Appearance: System / Light / Dark" in settings TK-1.02 (D-CSN-56)
A 44px floor, and smaller Global Games: 44px controls, "Forgot password?" 98 × 36px, the menu button 36px wide below 400px, "Owner administration" 106 × 19.8px; Tamakkan 44px on every button; oait.app 44px links, chips, and Pause, 40px footer links, a 20px-tall email link — 48 × 48px GG-1.03, TK-2.10, OA-1.10 (D-LAY-12)
A 44px minimum height on links inside paragraphs Global Jobs min-h-11 inline links line spacing stretched inline links exempt, with no minimum height JB-1.05 (D-CAI-08)
No skip link, or a broken one Global ID on every page; Global Games /training, /demo, /owner/sign-in; Tamakkan on 10 page types; oait.app's renders 116 × 24px; Global Jobs' orange "Skip to main content" — .oa-skip-link, "Skip to content", a 48px pill on --z-skip-link ID-1.02, GG-1.07, TK-1.06, OA-1.07, JB-1.09 (D-CSN-49, C-2)
Headings out of order Global Jobs /en/jobs: the "Filters" h2 before the h1; Global Games: h3s in hero mock-ups before the first h2, the sign-in story h2 before the h1; Tamakkan: an h2 inside an illustration, no h1 on /hbdi and /career-gps, two on the dashboard — one h1 first in main; no skipped levels; no headings in art JB-1.07, GG-1.08, TK-1.06 (D-BCP-25)
No main landmark Tamakkan /login.html — one <main id="main" tabindex="-1"> per page TK-1.06 (D-BCP-25)
Art before the text on phones Global ID landing reading order text first (the D-LAY-08 client call, under Focus order) ID-1.13 (D-LAY-08)
Focus left on the submit button; errors not tied to fields oait.app contact form no aria-describedby, no focus management errors tied and focused OA-1.06 (D-CAI-10)
Browser bubbles as the only error Global Games forms, no aria-invalid — novalidate, field messages, aria-invalid GG-1.09 (D-CAI-10)
A banner or a summary on a short form's empty submit Global ID's password step: the banner "Enter your email and your password." and no field errors; Global Jobs' two-field /en/sign-in: the error summary ("Enter an email address, like name@example.com.") takes focus above the field errors, with native required — novalidate; an error under each field and focus on the first invalid one; a banner only for problems no field owns; the summary only when two or more fail in a form of more than five fields ID-1.17, JB-1.11 (D-CAI-10, D-CSN-26)
A menu with no focus management Global Games details menu — the modal side sheet: focus in, held, returned GG-1.10 (D-CSN-12)
Toasts without a role Tamakkan: 3-second toasts, some carrying validation; no live region on /hbdi no role the snackbar in the polite host, 10 seconds with an action; field errors in the form TK-1.05 (D-CSN-25)
Selection by color only oait.app chips drawn inverted and radio cards; Tamakkan answers, Likert scales, and language buttons without a checked state — native radios in choice cards; primary-container plus check OA-1.13, TK-1.04 (D-CAI-14, D-CAI-15)
Orange text too light oait.app #b05717 card links, and its Academy button hovered; Global ID's guest notice link on lavender 4.48:1; 4.19:1; 3.86:1 text-primary-ink; in a notice, the notice's on-color, underlined OA-1.02, ID-1.03 (D-COL-03)
The orange fill as a line or a value Global ID progress fill and switch track; three admin checkboxes; oait.app's radio dot 2.13:1 on the track; the fill is 2.63:1 as a line on the page bg-primary-ink, accent-primary-ink ID-1.05, ID-1.06, OA-1.03 (D-ARC-11, D-CSN-28)
Faded placeholders oait.app at 70%; Tamakkan landing 3.96:1; 4.35:1 full-strength on-surface-variant OA-1.04, TK-1.15 (D-CAI-10)
Field edges as hairlines; a selected segment that does not show oait.app fields; Tamakkan fields and segments 1.62:1 light, 1.98:1 dark; 1.29–1.98:1; segments 1.12:1 border-outline; tabs with the 3px indicator OA-1.05, TK-1.10 (V-2, D-CSN-16)
Data colors below 3:1 Tamakkan HBDI green and yellow 2.28:1 and 1.53:1 chart-3 and chart-5, always lettered TK-1.16 (D-COL-19)
The fill orange as text in the inverse band Global Jobs, and its ring 4.78:1, legible but the wrong role inverse-primary; the ring re-pointed JB-1.04 (D-ARC-07)
Edges lost in forced colors Global ID's filled "Sign in" button and the white auth card the main button reads as plain text a transparent 1px border on every filled control and card ID-1.09 (D-CAI-20)
A name that hides the visible label oait.app's header language link, named "Read this page in Arabic" over "العربية" fails WCAG 2.5.3 <span lang="ar">العربية</span> plus hidden "Switch to Arabic" OA-1.11 (D-BCP-29)
A field named only by its placeholder Tamakkan /app phone input ("70 123 456") — a visible label TK-1.08 (D-CAI-09)
A truncated label Global ID's notched phone field, "+961 Lebanc" — the label above, wrapping (the D-CAI-09 client call, under Fields) ID-1.15 (D-CAI-09)
Untranslated names and chrome Global Jobs: the kit's name stays English on /ar; Global Games: English strings on /ar; Tamakkan: untranslated chrome, the /ar 404, the English-only /hbdi — every name, title, and error translated JB-1.02, GG-1.12, TK-1.13 (D-BCP-27)
Numbers that reorder in Arabic Global Games: "+2" shown as "2+" — <bdi dir="ltr">+2</bdi> GG-1.05 (D-BCP-30)
Directional icons that do not mirror Global ID's "Continue" in Arabic — the mirroring registry ID-1.10 (D-BCP-33)
Text under 12px exposed to screen readers Global Games mock-ups at 7–10px and 10px captions; Tamakkan art at 7–9px, small print at 10–11px — 12px or more; smaller only inside aria-hidden art GG-1.04, GG-1.11, TK-1.07 (D-TYP-17)
A lock-up name hidden on phones Global Jobs, named "Global Jobs — home", dir="ltr" forced — the name always visible, named "Global Jobs", following the page direction JB-1.10 (D-BCP-09)
A 404 with the home page's title Global Jobs — "Page not found · Global Jobs" JB-1.08 (D-CSN-30)
A header that breaks at 390px Global Jobs: the 56px CTA wraps — no call to action in the header (D-CSN-53): the S lock-up, the 48px Global ID circle, and the menu button fit 360px; below 640px the language switcher and "Sign in" move into the menu sheet JB-1.01 (D-CSN-09)
Navigation that disappears on phones oait.app below 1024px; Tamakkan landing below 760px — the 48px menu button and its side sheet OA-1.08, TK-1.14 (D-CSN-12)
An orientation lock Tamakkan manifest, "orientation": "portrait" fails WCAG 1.3.4 no orientation TK-1.12 (D-BCP-25)

Do and don't

Do Don't
Re-point --color-focus-ring once on the inverse band Write a ring color on each control, or leave primary-ink at 1.85:1 on the band
Draw focus with the outline from base.css outline: none plus a box-shadow ring
Extend a 40px button with after:-inset-y-[5px] after:-inset-y-1, which gives 46px
Leave links inside sentences at their line height Put min-h-11 on inline links
Write orange text as text-primary-ink Write text-primary (2.63:1)
Show status with a word, an icon, and a color A colored dot alone
Mount the polite host with the page Create a live region when the message arrives
Tie each error to its field and focus the first one Leave focus on the submit button
One h1, first in main A sidebar h2 before the h1
Hide card art as a whole and give one sentence Real headings and 7px text inside a mock-up
A visible Pause control on looping hero art Rely on hover or the reduced-motion setting alone
"Skip to content", 48px, first on the page No skip link, or a 116 × 24px one
lang="ar" on the endonym in an English page An English voice reading Arabic
<bdi dir="ltr">+2</bdi> inside Arabic "+2" that turns into "2+"