color-contrast

Solid

Load this skill whenever the project contains text, UI components, icons, form controls, data visualisations, or focus indicators — in short, almost every project. Under no circumstances hard-code colour values without verifying contrast ratios. Absolutely always ensure text meets 4.5:1, large text meets 3:1, and non-text UI elements meet 3:1 against adjacent colours. Test in light mode, dark mode, and forced-colors (high contrast) mode.

AI & Automation 35 stars 2 forks Updated today AGPL-3.0

Install

View on GitHub

Quality Score: 79/100

Stars 20%
52
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# Color Contrast Accessibility Skill > **Canonical source**: `examples/COLOR_CONTRAST_ACCESSIBILITY_BEST_PRACTICES.md` in `mgifford/ACCESSIBILITY.md` > This skill is derived from that file. When in doubt, the example is authoritative. Apply these rules whenever implementing or reviewing colour choices in HTML, CSS, SVG, or any visual interface element. --- ## Core Mandate Sufficient contrast between foreground and background colors is a prerequisite for users to read text, identify UI components, perceive graphical content, and track keyboard focus. **Color alone must never be the sole means of conveying information.** Contrast depends on the colors actually adjacent after opacity, gradients, images, overlays, states, and themes are applied — a passing palette is not proof the finished interface passes. All visual interface elements that convey information or require user interaction must meet WCAG 2.2 Level AA contrast thresholds in **light mode, dark mode, and forced-colors (high contrast) mode**. --- ## Severity Scale (this skill) | Level | Meaning | | --- | --- | | **Critical** | Contrast failure makes content or interaction completely inaccessible | | **Serious** | Contrast failure significantly impairs access for a disability group | | **Moderate** | Contrast issue degrades usability but content remains partially accessible | | **Minor** | Best-practice gap; marginal impact | Prioritize by user impact when time is limited: (1) text/controls required to complet...

Details

Author
mgifford
Repository
mgifford/accessibility-skills
Created
4 months ago
Last Updated
today
Language
JavaScript
License
AGPL-3.0

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Listed

color-contrast

Meet WCAG contrast ratios for text and non-text, never rely on color alone, and verify with tools including in dark mode. Use when choosing colors for UI or auditing readability.

4 Updated today
Amey-Thakur
AI & Automation Solid

light-dark-mode

Load this skill whenever the project supports light/dark mode, colour theme switching, high-contrast mode, or responds to prefers-color-scheme. Under no circumstances hard-code colours that break in alternative themes. Absolutely always test colour contrast in both light and dark themes, and respect user OS-level colour preferences via CSS media queries.

35 Updated today
mgifford
Web & Frontend Solid

color-accessibility-audit

Analyze color combinations for readability and accessibility compliance per WCAG 2.1/2.2 standards (Contrast Minimums 1.4.3 and Enhanced Contrast 1.4.6). Use this skill whenever the user shares a design, color palette, CSS, HTML, Tailwind config, theme file, screenshot of a UI, or mentions anything about text being hard to read, colors clashing, poor contrast, accessibility compliance (WCAG), or asks "can you check if these colors work together?" Also trigger when reviewing any frontend code, design tokens, or style sheets — even if the user doesn't explicitly ask about contrast. If colors are involved, check them. Covers: hex codes, RGB, HSL, named CSS colors, Tailwind classes, design tool exports, and UI screenshots. Includes color blindness simulation for Protanopia, Deuteranopia, and Tritanopia.

26 Updated 1 weeks ago
georgekhananaev