color-contrast
Fungsinya
Skill ini memeriksa kontras warna untuk teks, batas, ikon, dan indikator fokus terhadap batas minimum WCAG. Cocok untuk desainer dan pengembang yang ingin konten bisa dibaca oleh lebih banyak orang.
Kapan dipakai
- βSaat Anda memilih warna teks dan latar belakang untuk halaman atau merek.
- βSaat teks abu-abu muda berada di atas putih atau di atas foto.
- βSaat Anda memeriksa bahwa tombol, batas input, dan garis fokus cukup terlihat.
Link skill
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/color-contrast/SKILL.mdSalin 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
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βPeriksa apakah warna merek saya memenuhi panduan kontras untuk teks isi dan tombol.β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Agent mengukur rasio kontras antara setiap warna teks atau antarmuka dan latar belakangnya, membandingkannya dengan minimum untuk ukurannya, lalu menyarankan warna yang lebih gelap atau lebih terang jika diperlukan.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
Meet minimum color contrast ratios
Approximately 1 in 12 men and 1 in 200 women have some form of color vision deficiency. Low contrast text is also difficult for users with low vision, aging eyesight, or those reading in bright sunlight. Insufficient contrast is one of the most common WCAG failures and directly prevents users from reading content they need.
Quick Reference
- Normal text (< 18pt or < 14pt bold): minimum contrast ratio of 4.5:1 β WCAG 2.1 SC 1.4.3 Level AA
- Large text (β₯ 18pt / 24px, or β₯ 14pt bold / ~18.67px bold): minimum 3:1 contrast ratio
- Non-text UI components (icons, focus indicators, input borders): minimum 3:1 against adjacent color β WCAG 2.1 SC 1.4.11 Level AA
- WCAG 2.1 SC 1.4.6 (Level AAA) requires 7:1 for normal text and 4.5:1 for large text
- Decorative text and logotypes are exempt from contrast requirements
Check
Evaluate the contrast ratio between text color and its background for all text on the page. Use the WCAG relative luminance formula: for normal text (< 18pt or < 14pt bold), the ratio must be β₯ 4.5:1; for large text (β₯ 18pt or β₯ 14pt bold), the ratio must be β₯ 3:1. Also check non-text UI components (input borders, button outlines, icons) for β₯ 3:1 ratio against adjacent colors per WCAG 2.1 SC 1.4.11. Check all interactive states: default, hover, focus, active, and visited.
Fix
Darken the foreground color or lighten/darken the background color until the ratio meets the minimum. For normal text failing 4.5:1: increase text darkness or background lightness. For large text failing 3:1: apply same approach with a lower threshold. Use a contrast checker tool (WebAIM, browser DevTools accessibility panel) to verify the exact ratio. Do not use opacity to lighten text β compute the effective blended color and check that ratio instead.
Explain
WCAG 2.1 SC 1.4.3 (Contrast Minimum, Level AA) requires a contrast ratio of at least 4.5:1 for normal text and 3:1 for large text (β₯ 18pt regular or β₯ 14pt bold). Contrast ratio is calculated from the relative luminance of the foreground and background colors using the formula (L1 + 0.05) / (L2 + 0.05), where L1 is the lighter and L2 is the darker color. A ratio of 1:1 means no contrast (same color); 21:1 is maximum (black on white). Users with low vision, cataracts, or color blindness rely on high contrast to distinguish text from its background.
Code Review
Review the rendered markup and interactive states that affect Meet minimum color contrast ratios. 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/color-contrast
Pertanyaan umum
Berapa kontras yang dibutuhkan teks biasa?
Skill menyatakan minimal 4,5 banding 1 untuk teks biasa, dan 3 banding 1 untuk teks besar.
Apakah elemen dekoratif memerlukan kontras?
Tidak. Skill menyatakan teks dekoratif dan logo dikecualikan.
Apakah ini mencakup status hover dan fokus?
Ya. Skill menyatakan agar semua status interaktif diperiksa, termasuk hover, fokus, dan aktif.
Detail
Deskripsi asli dari pembuat
Use when applies to all visible text and text images, UI component borders (input fields, buttons), focus indicators, icons that convey meaning, and graphical objects required to understand content. Does not apply to inactive/disabled UI components or purely decorative elements.
Popularitas
- Bintang GitHub
- 75k
- Peringkat
- #2775
- Lisensi
- MIT
- Diperbarui
- 31/10/2026
Komentar
- β¦
Skill lain dari repositori ini
frontendchecklist
75kMemeriksa kode frontend dan halaman langsung terhadap lebih dari 380 aturan untuk aksesibilitas, kecepatan, SEO, dan keamanan, dengan alat baris perintah.
frontend-checklist-global
75kMengaudit proyek frontend terhadap seluruh 386 aturan Front-End Checklist, dan memberikan perbaikan spesifik untuk setiap masalah yang ditemukan.
404-page
75kMemeriksa bahwa halaman tidak ditemukan Anda menawarkan tautan yang membantu dan mengembalikan status 404 yang sebenarnya, untuk membantu pengunjung yang tersesat.
about-page
75kMeninjau apakah situs Anda memiliki halaman Tentang yang jelas yang menjelaskan siapa yang mengelolanya, untuk membangun kepercayaan pengunjung dan mesin pencari.
Skill serupa
canvas
394kMemungkinkan agent Anda menampilkan widget visual yang di-hosting di panel Mac yang terhubung, lalu menyembunyikan panel atau memindahkannya ke halaman lain.
control-ui
394kMembantu agent Anda mengatur dan memecahkan masalah OpenClaw Control UI, termasuk sesi, dasbor, dan Gateway yang terhubung.
diagram-maker
394kMembantu agent Anda membuat diagram yang jelas sebagai SVG, HTML, atau Excalidraw yang dapat diedit untuk proses, arsitektur sistem, dan sketsa papan tulis.