Langsung ke konten
Skillpedia
Website & UI (frontend)75k · #2811

decorative-elements

Fungsinya

Skill ini memeriksa gambar dan ikon dekoratif di halaman dan memastikan pembaca layar melewatinya. Cocok untuk pengembang yang menginginkan situs web yang dapat diakses.

Kapan dipakai

  • ✓Saat pembaca layar mengumumkan nama gambar yang tidak bermakna di halaman Anda.
  • ✓Saat Anda menambahkan pembatas, ikon, atau gambar latar dekoratif.
  • ✓Saat Anda meninjau halaman untuk aksesibilitas sebelum diluncurkan.

Link skill

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/decorative-elements/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/decorative-elements/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit →

Contoh permintaan ke AI

“Bisakah Anda memastikan ikon dekoratif di halaman saya tersembunyi dari pembaca layar?”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Agent memeriksa bahwa gambar dekoratif memiliki teks alt kosong dan bahwa ikon dekoratif disembunyikan dengan atribut sederhana. Agent juga tidak menandai item dekoratif yang tidak berbahaya sebagai masalah.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

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

Pertanyaan umum

Apa itu teks alt kosong?

Itu adalah atribut alt tanpa kata-kata, yang memberi tahu pembaca layar untuk melewati gambar. Cocok untuk gambar yang murni dekoratif.

Apakah setiap ikon harus disembunyikan?

Hanya ikon dekoratif yang disembunyikan. Skill ditujukan untuk item dekoratif, sedangkan gambar yang bermakna memerlukan deskripsi teks.

Apakah gambar dekoratif kecil akan dilaporkan sebagai lambat?

Skill menyatakan tidak, kecuali kode menunjukkan masalah tata letak yang nyata.

Detail

Deskripsi asli dari pembuat

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.

repo: thedaviddias/Front-End-Checklist

Popularitas

Bintang GitHub
75k
Peringkat
#2811
Lisensi
MIT
Diperbarui
31/10/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa