touch-targets
Skill này làm gì
Skill này kiểm tra các phần tử bấm được trên màn hình cảm ứng có đủ lớn không. Skill dành cho nhà thiết kế và lập trình viên muốn site dễ dùng bằng cách chạm.
Khi nào nên dùng
- ✓Khi các nút chỉ có icon như đóng hoặc xóa quá nhỏ trên điện thoại.
- ✓Khi bố cục di động có các liên kết hoặc điều khiển biểu mẫu xếp sát nhau.
- ✓Khi một đợt rà soát trợ năng đánh dấu các vùng chạm nhỏ hơn kích thước khuyến nghị.
Liên kết skill
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/touch-targets/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Các nút đóng trong menu di động của tôi rất nhỏ và khó chạm. Bạn có thể kiểm tra kích thước không?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent đo các phần tử tương tác, kể cả phần đệm của chúng. Agent đánh dấu những phần tử nhỏ và gợi ý vùng chạm lớn hơn mà không thay đổi kích thước hiển thị.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Provide sufficient touch target size
Motor disabilities such as essential tremor, Parkinson's disease, hemiplegia, and spasticity make it difficult to tap small targets with precision. A 24×24px icon button with no padding requires a fine-motor action that many users simply cannot perform. Insufficient tap target size is one of the most common barriers for users with mobility impairments on mobile and tablet devices. Even users without disabilities benefit from larger targets, reducing accidental activations.
Quick Reference
- WCAG 2.2 SC 2.5.5 (AAA): touch targets must be at least 44×44 CSS pixels
- WCAG 2.2 SC 2.5.8 (AA, new in WCAG 2.2): targets must be at least 24×24 CSS pixels OR have 24px of spacing from other targets
- Apple HIG recommends 44×44 pt minimum; Google Material Design recommends 48×48 dp minimum
- Use
paddingto enlarge the interactive area without changing the visual size - Inline text links are exempt from SC 2.5.8
Check
Find all interactive elements: <button>, <a>, <input>, <select>, <textarea>, and elements with click/touch event handlers or role='button'. For each, compute the rendered bounding box size (including padding). Flag elements whose width or height is less than 24px (WCAG 2.2 AA threshold) or less than 44px (AAA / platform guidelines). Also check spacing: elements smaller than 44px should have at least 24px of clear space from adjacent interactive elements.
Fix
To increase touch target size without changing visual appearance: (1) Add padding to the element — e.g., padding: 12px on a button adds 12px to each side of the visual content. (2) Use min-width and min-height to enforce a floor: min-width: 44px; min-height: 44px. (3) For icon-only buttons, use a transparent pseudo-element to extend the hit area: .icon-btn::before { content: ''; position: absolute; inset: -12px; } with position: relative on the button. (4) Ensure adequate spacing between small targets so users do not accidentally activate the wrong element.
Explain
WCAG 2.2 introduced SC 2.5.8 (Target Size, Minimum) at Level AA, requiring touch targets to be at least 24×24 CSS pixels or have 24px of offset spacing from neighboring targets. The older SC 2.5.5 (Target Size) at Level AAA recommends 44×44px. These thresholds are based on average human fingertip size (approximately 10mm) and the precision required for touchscreen interaction. Users with tremors or limited dexterity need larger targets because their touch point can deviate by 20–30px from where they intend. The 44px recommendation aligns with Apple's Human Interface Guidelines and Google's Material Design system.
Code Review
Review the rendered markup and interactive states that affect Provide sufficient touch target size. Flag exact elements, roles, labels, focus behavior, or keyboard interactions that violate the rule, and note how to verify the fix with browser accessibility tooling or assistive tech.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/rules/accessibility/touch-targets
Câu hỏi thường gặp
Vùng chạm nên có kích thước bao nhiêu?
Skill nêu 44 x 44 pixel là khuyến nghị thông thường, và 24 x 24 pixel là mức tối thiểu theo WCAG 2.2.
Tôi có thể làm vùng chạm lớn hơn mà không đổi giao diện không?
Có. Skill gợi ý dùng padding để mở rộng vùng bấm được, trong khi kích thước hiển thị vẫn giữ nguyên.
Liên kết văn bản có phải đáp ứng cùng quy tắc kích thước không?
Không. Skill nói rằng liên kết văn bản nội dòng được miễn quy tắc kích thước tối thiểu.
Chi tiết
Mô tả gốc của tác giả
Use when applies to all interactive elements on touchscreen interfaces: buttons, links, checkboxes, radio buttons, form inputs, icon buttons, and menu items. Check CSS for min-width, min-height, width, height, and padding on interactive elements. Particularly important for icon-only buttons (close, delete, share) which are often made too small.
Độ phổ biến
- Sao GitHub
- 75k
- Vị trí xếp hạng
- #3060
- Giấy phép
- MIT
- Cập nhật
- 31/10/2026
Bình luận
- …
Thêm skill từ kho mã này
frontendchecklist
75kKiểm tra mã frontend và trang trực tiếp theo hơn 380 quy tắc về khả năng tiếp cận, tốc độ, SEO và bảo mật, bằng một công cụ dòng lệnh.
frontend-checklist-global
75kKiểm toán một dự án frontend theo đủ 386 quy tắc của Front-End Checklist, và đưa cách sửa cụ thể cho từng vấn đề tìm thấy.
404-page
75kKiểm tra xem trang báo thiếu của bạn có đưa ra các liên kết hữu ích và trả về mã trạng thái 404 thật hay không, để giúp khách bị lạc tìm đường.
about-page
75kKiểm tra xem trang web có trang Giới thiệu rõ ràng giải thích ai điều hành nó hay không, để xây dựng niềm tin với khách và công cụ tìm kiếm.
Skill tương tự
angular-developer
280kGiúp agent của bạn viết code Angular và tư vấn cấu trúc dự án, hữu ích khi bắt đầu dự án mới hoặc cải thiện hiệu suất.
frontend-a11y
280kGiúp agent của bạn làm cho giao diện web dễ tiếp cận với mọi người. Đảm bảo website và ứng dụng hoạt động tốt với trình đọc màn hình và điều hướng bằng bàn phím.
frontend-patterns
280kGiúp agent của bạn áp dụng các mẫu hiện đại trong phát triển frontend. Tối ưu hiệu năng, quản lý trạng thái và tuân theo thực hành tốt nhất với React và Next.js.