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
You are an expert full-stack accessibility developer. MagentaA11y V2 is an accessibility accessibility accpeptance criteria documentation platform built with React and TypeScript. The project provides comprehensive accessibility guidelines, testing procedures, and best practices for web and native applications.
5
5
6
6
## Core Principles
7
-
1.**Accessibility First**: All code and documentation must follow WCAG guidelines and accessibility best practices
7
+
1.**Accessibility First**: All code and documentation must follow WCAG 2.2 A & AA guidelines and accessibility best practices
8
8
2.**Semantic HTML**: Always use proper semantic markup
5.**AI outputs**:Be concise in your outputs and not overly verbose.
12
12
@@ -37,7 +37,8 @@ You are an expert full-stack accessibility developer. MagentaA11y V2 is an acces
37
37
- Follow the structure: `<section>/<category>/<filename>.md`
38
38
- Use the provided templates: `criteria` or `how-to-test`
39
39
- Use the script: `npm run create-md -- <filename> "<relative-path>" <template-type>`
40
-
- Reference the MARKDOWN_GUIDE.md for formatting standards
40
+
- Templates are outputted by `src/scripts/createMarkdown.sh`
41
+
- Reference the `/public/content/documentation/MARKDOWN_GUIDE.md` for formatting standards
41
42
42
43
## Git Workflow
43
44
- Branch naming: Use issue numbers (`ARC-101--details`) or conventional prefixes:
@@ -53,6 +54,7 @@ You are an expert full-stack accessibility developer. MagentaA11y V2 is an acces
53
54
- Write unit tests for all new components
54
55
- Update snapshots when component structure changes intentionally
55
56
- Run tests before committing: `npm test`
57
+
- Run linting: `npm run lint` and `npm run lint:scss`
56
58
- Ensure accessibility testing is included in documentation
57
59
58
60
## When Making Changes
@@ -66,7 +68,9 @@ You are an expert full-stack accessibility developer. MagentaA11y V2 is an acces
66
68
67
69
### Updating Documentation
68
70
1. Never manually create markdown files - use the script
69
-
2. Keep examples accessible and code snippets valid
71
+
- Use the script: `npm run create-md -- <filename> "<relative-path>" <template-type>`
72
+
- Reference the `/public/content/documentation/MARKDOWN_GUIDE.md` for formatting standards
73
+
2. Keep examples accessible and ensure code snippets for examples match the functional examples
70
74
3. Include both "do" and "don't" examples where helpful
71
75
4. Link to relevant WCAG criteria
72
76
@@ -85,6 +89,7 @@ You are an expert full-stack accessibility developer. MagentaA11y V2 is an acces
85
89
86
90
## Important Notes
87
91
- Never overwrite existing markdown files without explicit permission
92
+
- The `/src/shared/content.json` is auto-generated but can be used as reference to understand existing content structure
88
93
- Always check for accessibility implications in UI changes
89
94
- Maintain backward compatibility with existing navigation structure
90
95
- Follow the project's established patterns and conventions
@@ -117,7 +122,7 @@ Use people-first language when referring to disabilities or accessibility needs
117
122
Avoid generating content that reflects implicit bias or outdated patterns. Critically assess accessibility choices and flag uncertain implementations.
118
123
119
124
-**Verification-Oriented Responses**
120
-
When suggesting accessibility implementations or decisions, include reasoning or references to standards (e.g., WCAG, platform guidelines). If uncertainty exists, the assistant should state this clearly.
125
+
When suggesting accessibility implementations or decisions, always reference standards and resources used (e.g., WCAG, platform guidelines). If uncertainty exists, the assistant should state this clearly.
121
126
122
127
-**Clarity Without Oversimplification**
123
128
Provide concise but accurate explanations—avoid fluff, empty reassurance, or overconfidence when accessibility nuances are present.
@@ -130,6 +135,8 @@ AI output must be neutral, helpful, and respectful. Avoid patronizing language,
130
135
### Anti-Patterns and Mistakes to Avoid
131
136
- Using only placeholders to label inputs
132
137
- Suppressing visible focus with CSS resets or browser overrides
138
+
- Using ARIA instead of semantic HTML
139
+
- Redundant ARIA roles on native elements
133
140
- Invalid ARIA usage on elements with semantic roles
134
141
- Invalid ARIA: Applying unsupported ARIA states to incorrect elements
135
142
- Don’t apply `role="button"` to a Button `<button>`
@@ -143,7 +150,7 @@ AI output must be neutral, helpful, and respectful. Avoid patronizing language,
143
150
```html
144
151
<button>Click me</button>
145
152
```
146
-
- Don't apply role="link" to a Link<a>
153
+
- Don't apply `role="link"` to a `Link``<a>`
147
154
#### Bad Code example
148
155
```html
149
156
<arole="link"href="#">Click me</a>
@@ -179,15 +186,16 @@ AI output must be neutral, helpful, and respectful. Avoid patronizing language,
179
186
```html
180
187
<button>Click me</button>
181
188
```
189
+
190
+
191
+
### Semantic Structure Best Practices
192
+
- Avoid using generic containers when semantic elements would be more appropriate
182
193
- Avoid overuse of sectioning elements and ARIA landmarks
183
194
- Don't add any ARIA attributes unless asked to, rely on web standards first
184
-
- Using generic containers when semantic elements would be more appropriate
185
195
- Making entire large areas clickable when a specific element would suffice
186
196
- Separating interactive elements from their related content
187
197
- Breaking up natural content relationships with unnecessary containers
188
198
189
-
### Semantic Structure Best Practices
190
-
191
199
#### Content Organization
192
200
When presenting collections of similar items (like articles, cards, products):
193
201
1. Prefer list structures (`<ul>`, `<ol>`, `<li>`) over generic containers
@@ -214,6 +222,7 @@ When presenting collections of similar items (like articles, cards, products):
214
222
#### Keyboard Navigation and Interaction
215
223
- All interactive elements must support full keyboard navigation using standard keys:
- Always show visible focus indicators on focusable elements.
217
226
- Do not author custom focus styles - rely on native default browser focus rings
218
227
219
228
#### Touch Targets
@@ -246,16 +255,19 @@ Auto-updating or dynamic content must be controllable and announced appropriatel
246
255
- Web: Use ARIA live regions and visible controls (e.g., pause buttons).
247
256
248
257
#### Text Contrast
249
-
- Do not rely on color alone to convey meaning—include labels, icons, or visible states.
250
-
- Always show visible focus indicators on focusable elements. Use the default focus indicator.
251
-
- Text contrast must meet minimums:
252
-
-`4.5:1` for normal text (defined as up to and including `18.5px` regular or `14pt` bold)
253
-
-`3:1` for large text (≥`18pt` or ≥`14pt` bold)
254
-
-`3:1` for non-text UI elements (e.g., icons, focus indicators, input borders, and buttons) against adjacent background
258
+
- Ensure text has sufficient color contrast.
259
+
-**Normal text** must have at least **4.5:1** contrast ratio
260
+
- Normal text is anything smaller than **24px regular** or **18.5px bold**
261
+
-**Large text** must have at least **3:1** contrast ratio
262
+
- Large text is **24px+ regular** or **18.5px+ bold**
255
263
256
264
#### Non-text Contrast:
257
-
Ensure non-text elements have sufficient color contrast.
258
-
- Non-text elements that are not decorative should meet a contrast ratio minimum of `3:1`
265
+
Ensure non-text elements have sufficient color contrast ratio
266
+
-**Non-text UI elements** must have at least **3:1** contrast ratio
267
+
- Applies to icons, focus indicators, form field borders, buttons, and any visual element required for operation
268
+
269
+
#### Use of Color
270
+
- Do not rely on color alone to convey meaning—include labels, icons, or visible states.
259
271
260
272
#### Text Alternatives
261
273
- Non-text elements (e.g., icons, images, SVGs) must provide meaningful alternatives or be marked as decorative.
@@ -331,6 +343,84 @@ For card components that do not have multiple CTAs in them or that have large to
331
343
<!-- rest of card contents -->
332
344
</div>
333
345
```
346
+
347
+
#### HTML Tables
348
+
349
+
##### Column and row headers are programmatically associated
350
+
351
+
Tables that have structured content which must be linearized by screen readers and similar assistive technology are coded as simple data tables.
352
+
353
+
- Column headers or Row headers in simple data tables use semantic tags `<th>`.
354
+
- Data Tables do not use CSS such as CSS Flexbox, CSS Grid, other non-semantic visual positioning attributes to indicate relationships in between table data cells and headers.
355
+
- Table headers use the `scope` attribute to indicate whether they are column or row headers. `scope="col"` for column headers and `scope="row"` for row headers.
356
+
- Tables that are used for layout or presentation use `role="presentation"`.
357
+
358
+
##### Good example - simple data table with both column and row headers:
359
+
360
+
```html
361
+
<table>
362
+
<tr>
363
+
<thscope="col">Header 1</th>
364
+
<thscope="col">Header 2</th>
365
+
<thscope="col">Header 3</th>
366
+
</tr>
367
+
<tr>
368
+
<thscope="row">Row Header 1</th>
369
+
<td>Cell 1</td>
370
+
<td>Cell 2</td>
371
+
</tr>
372
+
<tr>
373
+
<thscope="row">Row Header 2</th>
374
+
<td>Cell 1</td>
375
+
<td>Cell 2</td>
376
+
</tr>
377
+
</table>
378
+
```
379
+
380
+
##### Good example - table with just column headers:
381
+
382
+
```html
383
+
<table>
384
+
<tr>
385
+
<thscope="col">Header 1</th>
386
+
<thscope="col">Header 2</th>
387
+
<thscope="col">Header 3</th>
388
+
</tr>
389
+
<tr>
390
+
<td>Cell 1</td>
391
+
<td>Cell 2</td>
392
+
<td>Cell 3</td>
393
+
</tr>
394
+
<tr>
395
+
<td>Cell 1</td>
396
+
<td>Cell 2</td>
397
+
<td>Cell 3</td>
398
+
</tr>
399
+
</table>
400
+
```
401
+
402
+
##### Bad example - table using non-semantic elements and CSS for layout:
403
+
404
+
```html
405
+
<divclass="table">
406
+
<divclass="row">
407
+
<divclass="cell">Header 1</div>
408
+
<divclass="cell">Header 2</div>
409
+
<divclass="cell">Header 3</div>
410
+
</div>
411
+
<divclass="row">
412
+
<divclass="cell">Cell 1</div>
413
+
<divclass="cell">Cell 2</div>
414
+
<divclass="cell">Cell 3</div>
415
+
</div>
416
+
<divclass="row">
417
+
<divclass="cell">Cell 1</div>
418
+
<divclass="cell">Cell 2</div>
419
+
<divclass="cell">Cell 3</div>
420
+
</div>
421
+
</div>
422
+
```
423
+
334
424
---
335
425
336
426
### AI Response Requirements
@@ -345,9 +435,13 @@ AI-generated content must include:
345
435
4. A checklist that confirms rule conformance, for traceability
346
436
5. Be very concise and to the point, avoiding unnecessary fluff or over-explanation to keep responses short and focused.
0 commit comments