decorative-elements
Skill này làm gì
Skill này kiểm tra các ảnh và biểu tượng trang trí trên trang, và đảm bảo trình đọc màn hình bỏ qua chúng. Skill dành cho lập trình viên xây website dễ tiếp cận.
Khi nào nên dùng
- ✓Khi trình đọc màn hình đọc tên ảnh vô nghĩa trên trang của bạn.
- ✓Khi bạn thêm đường kẻ, biểu tượng hoặc ảnh nền trang trí.
- ✓Khi bạn rà soát trang về khả năng truy cập trước khi ra mắt.
Liên kết skill
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/decorative-elements/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
“Bạn có thể đảm bảo các biểu tượng trang trí trên trang của tôi được ẩn khỏi trình đọc màn hình không?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent kiểm tra ảnh trang trí có alt rỗng và biểu tượng trang trí được ẩn bằng một thuộc tính đơn giản. Nó cũng không gắn cờ các thành phần trang trí vô hại như là vấn đề.
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.
Hide decorative elements from assistive technology
Screen readers announce every image and icon—decorative elements clutter the experience with meaningless 'image, decorative border, image, bullet' announcements.
Quick Reference
- Use alt='' (empty) for decorative images—not alt='image' or missing alt
- Add aria-hidden='true' to decorative SVGs and icons
- Use CSS background-image for purely decorative visuals
- Role='presentation' removes semantic meaning from elements
- Do not automatically raise performance findings on decorative micro-assets unless the snippet shows real layout instability
- Example safe pattern:
<img src="/divider.svg" alt="" aria-hidden="true">is usually a decorative no-op, not a finding by itself
Check
Verify decorative images have empty alt attributes (alt=''), decorative icons use aria-hidden='true', and background images used for decoration are not announced by screen readers. Do not report decorative images as accessibility or performance failures unless the code shows a concrete problem rather than a hypothetical optimization.
Fix
Add alt='' to decorative img elements. Add aria-hidden='true' to decorative SVGs and icon fonts. Use CSS background-image for purely decorative visuals instead of img elements.
Explain
Explain how screen readers announce every image and element unless explicitly hidden, and why decorative content clutters the experience for users navigating with assistive technology.
Code Review
Review the rendered markup and interactive states that affect Hide decorative elements from assistive technology. 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/decorative-elements
Câu hỏi thường gặp
Alt rỗng là gì?
Đó là thuộc tính alt không có chữ nào, báo cho trình đọc màn hình bỏ qua ảnh. Nó phù hợp với ảnh chỉ mang tính trang trí.
Có nên ẩn mọi biểu tượng không?
Chỉ ẩn các biểu tượng trang trí. Skill dành cho các phần tử trang trí, còn ảnh có ý nghĩa cần có mô tả bằng văn bản.
Ảnh trang trí nhỏ có bị báo là chậm không?
Skill nói không, trừ khi code cho thấy một vấn đề bố cục thật sự.
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 Hide decorative elements from assistive technology. Check native semantics first, then inspect keyboard behavior, focus flow, accessible names, and screen-reader output where relevant. If an image is clearly decorative, default to no finding unless the snippet shows an actual issue such as broken semantics, focusability, or visible layout instability.
Độ phổ biến
- Sao GitHub
- 75k
- Vị trí xếp hạng
- #2811
- 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.