Agent skill

Color Contrast Skill for AI Coding Agents

The color-contrast skill checks text, icons and UI controls against WCAG 2.2 contrast thresholds across light, dark and forced-colors modes before shipping.

Install
npx skills add mgifford/accessibility-skills --skill color-contrast
View on GitHub

Stars, license and last push from GitHub. Install count as reported by the open skills directory.

What is the color-contrast skill?

color-contrast is a skill in mgifford/accessibility-skills that requires 4.5:1 contrast for normal text, 3:1 for large text and non-text UI elements, and a visible focus indicator at 3:1, checked across every theme. It runs automated axe-core scans for computable failures and calls for manual checks of color-only meaning, variable backgrounds and forced-colors mode.

color-contrast is one skill in mgifford/accessibility-skills. It applies to nearly any project with text, icons, form controls or data visualization, checking rendered color pairs against WCAG 2.2 contrast thresholds rather than a palette in isolation.

The skill is organized by severity: critical text-contrast failures, serious issues such as missing non-text contrast or a color-only distinction, and moderate gaps like an untested theme or component state.

What changes in the agent's output

  • Normal text gets checked against a 4.5:1 ratio and large text against 3:1, measured on the actual rendered foreground and background pair.
  • Non-text elements such as checkbox borders, icon-only buttons and chart lines get a 3:1 check, since WCAG 1.4.11 covers more than body copy.
  • Links in body text get an underline or a brightness difference of at least 3:1, so color is never the only signal separating a link from plain text.
  • A forced-colors media query gets tested, since Windows High Contrast replaces author colors with system ones and can hide a background-only cue.

Testing it runs

Playwright paired with axe-core scans for computable text contrast failures across themes. The skill is explicit that automation catches text contrast but still needs a manual pass for graphical details, focus geometry and forced-colors behavior.

Who the color-contrast skill is for

Best for

  • Any UI with text, icons, charts or form controls going into light and dark themes.
  • Teams that need every interactive state, not only the default, checked for contrast.
  • Projects already testing with Windows High Contrast or the forced-colors media query.

Not for

Use it with UiChemy

Contrast fixes apply to colors already chosen for a page. Once a palette passes, UiChemy AI to WordPress carries that front-end build into an editable WordPress page.