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 44 stars 2 forks Updated 2 days ago AGPL-3.0

Install

View on GitHub

Quality Score: 81/100

Stars 20%
55
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
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
5 months ago
Last Updated
2 days ago
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.

7 Updated 5 days ago
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.

44 Updated 2 days ago
mgifford
Data & Documents Listed

color-skills

Apply a deliberate, non-default color scheme when creating or restyling ANY document, presentation, or spreadsheet — PowerPoint (.pptx), Word (.docx), Excel (.xlsx), or a slide/document-styled HTML artifact. ALWAYS consult this skill for these, even a plain request like "make me a slide" or "write a report" with no mention of color — that silence is the trigger, since the default fallback (Tailwind swatches: blue-900 1E3A8A, green-900 14532D, orange-900 7C2D12, amber-900 78350F, purple-700 7E22CE, slate-900 0F172A, one hue per section) is the biggest tell that output is AI-generated. EXCEPTION — do not trigger for CVs/resumes/cover letters (their own ATS-safe conventions), nor for PDF or markdown output (PDF inherits from its docx source; markdown has no color mechanism). Also trigger on "use our brand colors," "change the color scheme," "use the neutral palette," "pick a different palette," "black and white," or a saved one-word palette name (e.g. "generate alpha").

0 Updated 2 weeks ago
aishdwivedi27