You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Clarify accessibility criteria descriptions
I have not been able to look through everything in the accessibility instruction file. But the changes I'm submitting attempt to clarify / correct content that needed it.
* Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* Apply suggestion from @scottaohara
* Apply suggestion from @scottaohara
---------
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copy file name to clipboardExpand all lines: instructions/a11y.instructions.md
+23-21Lines changed: 23 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,17 +25,17 @@ Comprehensive accessibility rules for web application development. Every anti-pa
25
25
| 1.2.1 Audio/Video-only | A | Provide transcript (audio) or text alternative (video). |
26
26
| 1.2.2 Captions (Prerecorded) | A | All prerecorded video has synchronized captions. |
27
27
| 1.3.1 Info and Relationships | A | Structure (headings, lists, tables, labels, landmarks) programmatically conveyed. |
28
-
| 1.3.2 Meaningful Sequence | A |DOM reading order matches visual order. |
28
+
| 1.3.2 Meaningful Sequence | A |When the sequence that content is presented affects its meaning, the visual and programmatic ordering of content should align. |
29
29
| 1.3.3 Sensory Characteristics | A | Instructions don't rely solely on shape, size, position, or sound. |
30
-
| 1.3.4 Orientation | AA | Content not restricted to single orientation unless essential. |
31
-
| 1.3.5 Identify Input Purpose | AA | Input fields have `autocomplete` attributes for user data (name, email, tel). |
30
+
| 1.3.4 Orientation | AA | Content is not restricted to single orientation unless essential. |
31
+
| 1.3.5 Identify Input Purpose | AA | Input fields have `autocomplete` attributes when collecting information about the user. |
32
32
| 1.4.1 Use of Color | A | Color is not the only means of conveying info. |
33
33
| 1.4.3 Contrast (Minimum) | AA | Text: 4.5:1 normal, 3:1 large (18pt / 14pt bold). |
34
-
| 1.4.4 Resize Text | AA | Text resizable to 200% without loss of content. |
35
-
| 1.4.10 Reflow | AA |Content reflows at 320px CSS width (no horizontal scroll). |
34
+
| 1.4.4 Resize Text | AA | Text resizable to 200% without loss of content or functionality. |
35
+
| 1.4.10 Reflow | AA |Sections of content can fit within 320px CSS width viewports without needing to scroll in two dimensions to read. |
36
36
| 1.4.11 Non-text Contrast | AA | UI components and graphics: 3:1 against adjacent colors. |
37
-
| 1.4.12 Text Spacing | AA | No loss of content with overridden line-height (1.5x), spacing. |
38
-
| 1.4.13 Content on Hover/Focus | AA |Tooltips: dismissible, hoverable, persistent. |
37
+
| 1.4.12 Text Spacing | AA | No loss of content or functionality with user-overridden line-height (1.5x), or specified paragraph spacing, letter spacing, and word spacing adjustments. |
38
+
| 1.4.13 Content on Hover/Focus | AA |Popup content that appears on hover or focus is: dismissible, hoverable, persistent. |
39
39
40
40
### Operable
41
41
@@ -52,13 +52,13 @@ Comprehensive accessibility rules for web application development. Every anti-pa
52
52
| 2.4.4 Link Purpose | A | Link purpose determinable from text or context. |
53
53
| 2.4.6 Headings and Labels | AA | Headings and labels describe topic or purpose. |
54
54
| 2.4.7 Focus Visible | AA | Keyboard focus indicator is visible. |
55
-
| 2.4.11 Focus Not Obscured | AA | Focused element not entirely hidden by sticky headers/footers. *(New in 2.2)*|
55
+
| 2.4.11 Focus Not Obscured | AA | Focused element not entirely hidden by other overlaying elements (such as sticky headers or footers). *(New in 2.2)*|
56
56
| 2.5.1 Pointer Gestures | A | Multi-point gestures have single-pointer alternative. |
57
-
| 2.5.2 Pointer Cancellation | A | Activation on up-event, not down-event. |
58
-
| 2.5.3 Label in Name | A | Accessible name contains the visible label text. |
57
+
| 2.5.2 Pointer Cancellation | A | Activation on up-event, unless activation can be aborted, reversed, or down-event activation is essential. |
58
+
| 2.5.3 Label in Name | A | Accessible name contains the label text as it is visually presented. |
59
59
| 2.5.4 Motion Actuation | A | Device motion has UI alternative and can be disabled. |
60
60
| 2.5.7 Dragging Movements | AA | Drag-and-drop has click/tap alternative. *(New in 2.2)*|
61
-
| 2.5.8 Target Size (Minimum) | AA |Touch targets at least 24x24 CSS px. *(New in 2.2)*|
61
+
| 2.5.8 Target Size (Minimum) | AA |Interactive controls have a target size, or spacing of at least 24x24 CSS px. *(New in 2.2)*|
62
62
63
63
### Understandable
64
64
@@ -102,7 +102,7 @@ Comprehensive accessibility rules for web application development. Every anti-pa
102
102
## Five Rules of ARIA
103
103
104
104
1.**Prefer native HTML** — Use `<button>` not `<div role="button">`. Native elements have built-in keyboard, focus, and semantics.
105
-
2.**Don't change native semantics** — Don't add `role="heading"` to a `<button>`. Use the correct element.
105
+
2.**Don't change native semantics where prohibited** — Don't add `role="heading"` to a `<button>`. Use the correct element.
106
106
3.**All ARIA controls must be keyboard operable** — If `role="button"`, handle Enter and Space key events.
107
107
4.**Don't use `aria-hidden="true"` on focusable elements** — Hidden from assistive tech but still focusable creates a "ghost" element.
108
108
5.**All interactive elements need an accessible name** — Via label, `aria-label`, `aria-labelledby`, or visible text content.
@@ -147,7 +147,7 @@ Maintain logical nesting: `h1 > h2 > h3 > h4`. Style headings with CSS, not by c
147
147
148
148
-**Severity**: IMPORTANT
149
149
-**Detection**: Pages using only `<div>` without `<nav>`, `<main>`, `<header>`, `<footer>`
-**Detection**: `aria-hidden="true"` on focusable elements (button, input, a, [tabindex])
231
231
-**WCAG**: ARIA Rule 4
232
232
233
-
Use `inert` attribute or remove from tab order entirely.
233
+
Do not leave focusable elements inside `aria-hidden="true"` content or use `aria-hidden="true"` on focusable elements. Rather, for native controls that support it, such as `<button>` or `<input>`, use `disabled` if disabling the control is the intended behavior. For `<a>` elements or arbitrary elements made focusable with `[tabindex]`, remove focusability instead (for example, remove `href` or `tabindex`). If the content should be completely non-interactive and hidden from assistive technology, use `inert`, `hidden`, or remove it from the DOM.
234
234
235
235
### A3: Missing Required ARIA Properties
236
236
237
237
-**Severity**: CRITICAL
238
238
-**Detection**: `role="tab"` without `aria-selected`, `role="checkbox"` without `aria-checked`
<divrole="alert">Failed to save. Please try again.</div>
@@ -302,7 +304,7 @@ Invalid roles are ignored by assistive technology. Common mistakes: `role="input
302
304
-**Detection**: `(?:onClick|@click|\(click\))` on `<div>` or `<span>` without keyboard handler
303
305
-**WCAG**: 2.1.1 (A)
304
306
305
-
Use `<button>` instead. If div is required: add `role="button"`, `tabIndex={0}`, and handle Enter/Space.
307
+
Use `<button>` instead. If a div is required: add `role="button"`, `tabIndex={0}`, handle Enter and Space key activation.
306
308
307
309
### K2: Positive `tabindex` Values
308
310
@@ -318,7 +320,7 @@ Only use `tabindex="0"` (add to tab order) and `tabindex="-1"` (programmatic foc
318
320
-**Detection**: Modal/overlay without Escape key handler or focus trapping
319
321
-**WCAG**: 2.1.2 (A)
320
322
321
-
Use native `<dialog>` with `showModal()` — it provides focus trapping, Escape-to-close, and focus return automatically. Use `inert` attribute on background content to prevent interaction outside the dialog (96%+ browser support). If custom implementation is needed: trap Tab within the dialog, close on Escape, return focus to the trigger element on close.
323
+
Use native `<dialog>` with `showModal()` — it prevents keyboard focus from moving to the inert non-dialog content. Additionally, it has built in Escape key to dismiss, and focus will automatically return to the invoking element (if available). If a custom modal dialog implementation is needed: trap Tab within the dialog or use the `inert` attribute for non-dialog content (do not use `inert` on an element that contains the dialog), dismiss on Escape (unless user confirmation of an action is essential), return focus to the trigger element on close, or to best logical location if triggering element is no longer present upon dismissal.
Pair hover with focus events. Use `onFocus`/`onBlur` alongside `onMouseEnter`/`onMouseLeave`.
358
360
359
-
### K7: Focus Not Returned After Modal Close
361
+
### K7: Focus Not Returned After Custom Modal Close
360
362
361
363
-**Severity**: IMPORTANT
362
-
-**Detection**: Dialog close without restoring focus to trigger
364
+
-**Detection**: Custom modal dialog close without restoring focus to trigger
363
365
-**WCAG**: 2.4.3 (A)
364
366
365
-
Store reference to trigger element. On modal close, call `triggerElement.focus()`.
367
+
Store reference to trigger element or to best logical location if triggering element is no longer present upon close. On modal close, call `triggerElement.focus()`.
0 commit comments