contrast-check

Installation
SKILL.md

Contrast Check

Overview

WCAG measures contrast as (L1 + 0.05) / (L2 + 0.05), where L1 and L2 are the relative luminance of the lighter and the darker color. The result runs from 1:1 (same color) to 21:1 (black on white). This skill gives the agent a calculator with no dependencies, the threshold that applies to each kind of element, a way to collect the pairs that really meet on screen, and a repair step that returns the nearest passing shade instead of "make it darker".

Instructions

1. Collect the pairs that meet on screen

A contrast check is about two colors that touch: text and the surface directly behind it, an icon and its button, a border and the page. Before computing anything:

  • Ask which level is the target. AA is the usual legal and audit baseline; AAA only when the user names it.
  • Find where the colors live: CSS custom properties, a Tailwind @theme block or config, a tokens JSON file. Search for the token names to see which ones are used together.
  • List every pairing per theme: body text, muted text, links inside body text, placeholder text, error and success messages, button labels on each button color, input borders, icons, focus rings. Placeholder and hover-revealed text count as text.
  • Skip what WCAG exempts: disabled controls, pure decoration, logos and brand names.

When a color is written as oklch(), hsl(), color-mix() or a keyword, let the browser resolve it. Computed hsl() and keyword colors already come back as rgb(), but Chrome returns oklch() as written and color-mix() as color(srgb …), so paint the value on a canvas and read the pixel. Run this in the DevTools console with the element selected:

Installs
2
GitHub Stars
197
First Seen
Jun 11, 2026