Chuyển đến nội dung
Skillpedia
Website và giao diện (frontend)75k · #2727

aria-hidden-body

Skill này làm gì

Skill này kiểm tra xem phần body của trang web không bao giờ được đặt aria-hidden thành true. Nó dành cho lập trình viên quản lý modal và lớp phủ trên trang.

Khi nào nên dùng

  • ✓Khi bạn viết code ẩn nền khi một modal đang mở.
  • ✓Khi người dùng trình đọc màn hình báo rằng không đọc được gì trên trang.
  • ✓Khi bạn xem lại script thay đổi thuộc tính trên phần tử body.

Liên kết skill

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/aria-hidden-body/SKILL.md

Sao 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

Hãy dùng skill này để giúp tôi: https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/aria-hidden-body/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Kiểm tra code modal của tôi để đảm bảo nó không bao giờ đặt aria-hidden trên phần tử body.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent tìm aria-hidden trên body trong code, rồi chuyển việc ẩn sang các vùng nền cụ 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.

Do not use aria-hidden on the document body

Setting aria-hidden="true" on the body effectively silences the entire application for screen reader users, rendering the site completely unusable.

Quick Reference

  • The <body> element should never have aria-hidden="true"
  • Hiding the body makes the entire page invisible to assistive technologies
  • Often happens accidentally when managing modal states

Check

Check if the <body> element has aria-hidden="true" applied at any point in the lifecycle.

Fix

Remove aria-hidden="true" from the <body> and use it only on specific background containers when modals are open.

Explain

Explain the catastrophic impact of hiding the body element from assistive technologies.

Code Review

Review the rendered markup and interactive states that affect Do not use aria-hidden on the document body. 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/aria-hidden-body

Câu hỏi thường gặp

Điều gì xảy ra nếu body bị ẩn?

Skill nói toàn bộ trang sẽ vô hình với trình đọc màn hình, khiến nó không dùng được với họ.

Nên ẩn nền khi modal mở như thế nào?

Chỉ áp dụng aria-hidden cho các vùng nền cụ thể trong lúc modal mở.

Đây có phải lỗi thường gặp không?

Skill nói nó thường xảy ra vô tình khi quản lý trạng thái modal.

Chi tiết

Mô tả gốc của tác giả

Use when reviewing rendered HTML, interactive components, or design-system patterns related to Do not use aria-hidden on the document body. Check native semantics first, then inspect keyboard behavior, focus flow, accessible names, and screen-reader output where relevant.

repo: thedaviddias/Front-End-Checklist

Độ phổ biến

Sao GitHub
75k
Vị trí xếp hạng
#2727
Giấy phép
MIT
Cập nhật
31/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự