validating-accessibility
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseValidating Accessibility
验证可访问性
Agent Workflow (MANDATORY)
Agent 工作流(必填)
Before ANY accessibility validation, use to spawn 3 agents:
TeamCreate- fuse-ai-pilot:explore-codebase - Find components to audit
- fuse-ai-pilot:research-expert - Verify latest WCAG 2.2 requirements
- Check existing ARIA patterns in codebase
After fixes, run fuse-ai-pilot:sniper for validation.
在进行任何可访问性验证之前,使用生成3个Agent:
TeamCreate- fuse-ai-pilot:explore-codebase - 查找需审计的组件
- fuse-ai-pilot:research-expert - 验证最新的WCAG 2.2要求
- 检查代码库中现有的ARIA模式
修复完成后,运行fuse-ai-pilot:sniper进行验证。
Overview
概述
| Feature | Description |
|---|---|
| WCAG 2.2 AA | Minimum compliance level |
| Color Contrast | 4.5:1 text, 3:1 UI |
| Keyboard | Full navigation support |
| ARIA | Screen reader support |
| 功能 | 说明 |
|---|---|
| WCAG 2.2 AA | 最低合规级别 |
| 颜色对比度 | 4.5:1(文本),3:1(UI) |
| 键盘导航 | 完整导航支持 |
| ARIA | 屏幕阅读器支持 |
Critical Rules
关键规则
- 4.5:1 contrast - Normal text minimum
- 3:1 contrast - Large text and UI components
- Focus visible - All interactive elements
- Reduced motion - Respect user preference
- Labels required - All form inputs
- 4.5:1对比度 - 普通文本的最低要求
- 3:1对比度 - 大文本与UI组件的最低要求
- 可见焦点 - 所有交互元素均需具备
- 减少动画 - 遵循用户的偏好设置
- 必填标签 - 所有表单输入项均需添加标签
Quick Checklist
快速检查清单
[ ] Color contrast: 4.5:1 (text), 3:1 (UI)
[ ] Keyboard: All elements focusable
[ ] Focus: Visible indicators (ring-2)
[ ] ARIA: Correct attributes
[ ] Motion: prefers-reduced-motion
[ ] Semantic: Proper heading hierarchy
[ ] Labels: All inputs labeled
[ ] Alt text: All images[ ] 颜色对比度:4.5:1(文本),3:1(UI)
[ ] 键盘导航:所有元素可获取焦点
[ ] 焦点:可见指示器(如ring-2)
[ ] ARIA:属性设置正确
[ ] 动画:遵循prefers-reduced-motion
[ ] 语义化:正确的标题层级
[ ] 标签:所有输入项均有标签
[ ] 替代文本:所有图片均添加alt文本Reference Guide
参考指南
Concepts
核心概念
| Topic | Reference | When to Consult |
|---|---|---|
| Nielsen Heuristics | ux-nielsen.md | 10 usability heuristics |
| Laws of UX | ux-laws.md | Cognitive psychology |
| WCAG 2.2 | ux-wcag.md | Accessibility standards |
| UX Patterns | ux-patterns.md | Common UX patterns |
| Buttons | buttons-guide.md | Touch targets, focus |
| Forms | forms-guide.md | Labels, validation |
| 主题 | 参考文档 | 适用场景 |
|---|---|---|
| 尼尔森启发式原则 | ux-nielsen.md | 10条可用性启发式原则相关 |
| UX法则 | ux-laws.md | 认知心理学相关 |
| WCAG 2.2 | ux-wcag.md | 可访问性标准相关 |
| UX模式 | ux-patterns.md | 通用UX模式相关 |
| 按钮 | buttons-guide.md | 触摸目标、焦点相关 |
| 表单 | forms-guide.md | 标签、验证相关 |
Quick Reference
快速参考
Color Contrast
颜色对比度
Normal text (<18px): 4.5:1 minimum
Large text (≥18px): 3:1 minimum
UI components: 3:1 minimumNormal text (<18px): 4.5:1 minimum
Large text (≥18px): 3:1 minimum
UI components: 3:1 minimumFocus Indicator
焦点指示器
tsx
className="focus:outline-none focus-visible:ring-2 focus-visible:ring-primary"tsx
className="focus:outline-none focus-visible:ring-2 focus-visible:ring-primary"Reduced Motion
减少动画
tsx
import { useReducedMotion } from "framer-motion";
const shouldReduce = useReducedMotion();
<motion.div animate={shouldReduce ? {} : { y: 0 }} />tsx
import { useReducedMotion } from "framer-motion";
const shouldReduce = useReducedMotion();
<motion.div animate={shouldReduce ? {} : { y: 0 }} />ARIA Patterns
ARIA模式
tsx
// Icon button
<button aria-label="Close">
<X className="h-4 w-4" />
</button>
// Form with description
<input aria-describedby="hint" />
<p id="hint">Must be 8+ characters</p>→ See ux-principles.md for complete patterns
tsx
// Icon button
<button aria-label="Close">
<X className="h-4 w-4" />
</button>
// Form with description
<input aria-describedby="hint" />
<p id="hint">Must be 8+ characters</p>→ 完整模式请查看ux-principles.md
Best Practices
最佳实践
DO
建议
- Test with keyboard only
- Use semantic HTML first
- Add aria-label to icon buttons
- Respect reduced motion
- Test with screen reader
- 仅使用键盘进行测试
- 优先使用语义化HTML
- 为图标按钮添加aria-label
- 遵循减少动画的用户偏好
- 使用屏幕阅读器进行测试
DON'T
禁忌
- Skip focus indicators
- Use color alone for meaning
- Forget alt text on images
- Remove outline without replacement
- Ignore heading hierarchy
- 跳过焦点指示器
- 仅使用颜色传达含义
- 忘记为图片添加替代文本
- 移除轮廓而不提供替代方案
- 忽略标题层级