AGENT SKILL
触摸目标尺寸合规验证
wcag-audit-operable-target-size
验证触摸目标尺寸是否满足 44x44px 的最小要求
- License 许可
- MIT
- 最近更新
- 2026-01-19
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- wcag-audit-operable-target-size
- description
- Validate touch target sizes meet 44x44px minimum requirement
02 资源文件 1
- 脚本scripts/check.js6.0 KB
03 SKILL.md 正文
When to Use
Use this tool when designing buttons, links, form controls, or any interactive elements to ensure they meet minimum touch target size requirements for accessibility.
Usage
Command Line
node scripts/check.js --width 48 --height 48
node scripts/check.js --width 32 --height 40 --spacing 8
node scripts/check.js --element "button" --dimensions "44x44"
JSON Input
node scripts/check.js --json '{"width": 48, "height": 48, "spacing": 8}'
Parameters
--width: Element width in pixels--height: Element height in pixels--spacing: Minimum spacing between adjacent targets (optional)--element: Element type description (optional)--dimensions: Dimensions as "WxH" format (alternative to width/height)--json: JSON input with dimensions and spacing properties
Output
Returns JSON with compliance status and recommendations:
{
"dimensions": {
"width": 48,
"height": 48
},
"minimumRequired": {
"width": 44,
"height": 44
},
"compliance": {
"size": true,
"spacing": true
},
"recommendations": []
}
Examples
Check a button size
$ node scripts/check.js --width 48 --height 48 --element "primary button"
✅ Size: PASS (48x48px meets 44x44px minimum)
✅ Spacing: PASS (8px spacing provided)
No issues found - this target meets accessibility requirements
Check a small link
$ node scripts/check.js --width 24 --height 16 --element "footer link"
❌ Size: FAIL (24x16px is below 44x44px minimum)
❌ Spacing: FAIL (insufficient spacing between targets)
Recommendations:
- Increase width to at least 44px (currently 24px)
- Increase height to at least 44px (currently 16px)
- Ensure at least 8px spacing between adjacent interactive elements
WCAG Standards
- Minimum Size: 44px by 44px (approximately 9mm) for touch targets
- Spacing: Adequate spacing between adjacent targets to prevent accidental activation
- Exceptions: Smaller targets allowed if identical function available with larger target within same page
- Enhanced: 44px by 44px strongly recommended, smaller targets only in exceptional cases
Best Practices
- Use 44x44px minimum: Design all touch targets at least this size
- Consider thumb size: Account for finger/thumb size in mobile designs
- Provide spacing: Ensure at least 8px between interactive elements
- Test on device: Verify usability on actual touch devices
- Consider context: Smaller targets may be acceptable in non-critical areas
Learn More
For more information about Agent Skills and how they extend AI capabilities.
04 同仓库更多 Skills
表单输入无障碍审计
wcag-audit-understandable-forms
路由表单输入与数据收集的无障碍需求
★ 1
表单设计无障碍深度审计
wcag-audit-understandable-forms-deep
面向用户输入与数据收集的表单设计无障碍规则
★ 1
文本排版无障碍设计审计
wcag-audit-perceivable-text
路由排版无障碍设计决策与需求
★ 1
字体单位无障碍换算
wcag-audit-perceivable-text-size
结合无障碍上下文,在 px、pt、em、rem 单位之间进行转换
★ 1
文本排版无障碍深度审计
wcag-audit-perceivable-text-deep
面向文本设计与可读性的全面排版无障碍规则
★ 1
音视频多媒体无障碍审计
wcag-audit-perceivable-media
路由音频、视频和多媒体无障碍需求
★ 1