wcag-color-contrast
Use for any question about color contrast or whether colors pass WCAG, including quick checks of a few hex values and hard-to-read text: WCAG 2.2 text…
от testland★ 18 звёзд на GitHub
Установить wcag-color-contrast в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
wcag-color-contrast
Overview
WCAG 2.2 specifies four color-contrast Success Criteria (wcag22):
| SC | Level | What it covers |
|---|---|---|
| 1.4.3 | AA | Text contrast minimums - 4.5:1 normal, 3:1 large. |
| 1.4.6 | AAA | Enhanced text contrast - 7:1 normal, 4.5:1 large. |
| 1.4.11 | AA | Non-text contrast - UI components and graphics - 3:1. |
| 1.4.13 | AA | Content on Hover/Focus - keyboard-dismissable, hoverable, persistent. |
Large text per WCAG 2.2 (wcag22): 18pt+ regular OR 14pt+ bold (24px / 18.66px in browsers default; 19px+ if bold).
When to use
- Designing a new color palette / design tokens.
- Reviewing a component's CSS for contrast violations.
- Setting up bulk-checking of design tokens via tooling.
- Authoring per-component a11y checklists (paired with
screen-reader-test-authorreferences/wcag-checklist.md). - Configuring per-rule severity in
axe-a11y.
Contrast ratios
Text (SC 1.4.3 - Level AA)
| Text size | Required ratio |
|---|---|
| Normal text (<18pt regular, <14pt bold) | 4.5:1 |
| Large text (≥18pt regular OR ≥14pt bold) | 3:1 |
Exceptions per wcag22:
- Pure decoration (text in a logo, "lorem ipsum" filler).
- Inactive UI elements (disabled buttons - though the disabled state should still have visible-but-low-contrast text).
- Logotypes - brand text within a logo.
- Incidental text (text within an image of running text where the image isn't an essential conveyance of information).
Text (SC 1.4.6 - Level AAA)
The enhanced version doubles down: 7:1 normal, 4.5:1 large. Use this for accessibility-first products (educational platforms, public-sector services).
UI components and graphics (SC 1.4.11 - Level AA, NEW in 2.1)
Visual presentation of UI components and graphical objects must have 3:1 contrast against adjacent colors. This applies to:
- Form input borders.
- Focus indicators (per
wcag-keyboard-navigationSC 2.4.7). - Icon buttons that don't have text labels.
- Visual state indicators (toggle switches, checkboxes).
- Required-field indicators that rely on color alone.
Content on Hover or Focus (SC 1.4.13 - Level AA)
Tooltips, dropdowns, and other content that appears on hover/focus must satisfy three conditions:
| Condition | Meaning |
|---|---|
| Dismissable | User can dismiss the additional content without moving pointer or focus (typically: Esc key). |
| Hoverable | If the content appears on hover, the user can move the pointer onto the additional content without dismissing it. |
| Persistent | The additional content remains visible until the user dismisses it, hover/focus moves elsewhere, OR the information is no longer valid. |
Most "tooltip" libraries fail one of these - typically Hoverable (pointer leaves trigger → tooltip dismisses → can't read it).
Measuring contrast
The WCAG contrast formula uses relative luminance (per wcag22 formula):
ratio = (L1 + 0.05) / (L2 + 0.05)
where L1 is the relative luminance of the lighter color and L2
of the darker. Ratios run from 1:1 (identical colors) to 21:1
(black on white).
You don't compute it manually - use a tool:
| Tool | Notes |
|---|---|
| WebAIM Contrast Checker | https://webaim.org/resources/contrastchecker/ |
| Chrome DevTools | Element panel → Styles → color swatch → Contrast. |
| Figma plugins (Stark, Able) | Inline check during design. |
polished (npm) getContrast() |
Programmatic check in tests / lint rules. |
axe-core |
Reports all on-screen contrast violations during a scan (axe-a11y). |
Common ratios for canonical color pairings
| Foreground / background | Ratio | Notes |
|---|---|---|
#000000 on #FFFFFF |
21:1 | Maximum. |
#FFFFFF on #000000 |
21:1 | Reversed; same. |
#767676 on #FFFFFF |
4.54:1 | Just passes 4.5:1. |
#999999 on #FFFFFF |
2.85:1 | Fails AA normal text. |
#0000EE (default link) on #FFFFFF |
8.59:1 | Passes AAA. |
The "just-passes" boundary #767676 is a design pitfall
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- .tessl-plugin/plugin.json
FAQ
Что делает скилл wcag-color-contrast?
Use for any question about color contrast or whether colors pass WCAG, including quick checks of a few hex values and hard-to-read text: WCAG 2.2 text, large-text and non-text contrast ratios (4.5:1, 3:1) at AA and AAA, the measurement formula, palette and component reviews, and bulk checks over CSS and design tokens.
Как установить скилл wcag-color-contrast?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл wcag-color-contrast запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
frontend-design
AnthropicGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making…
webapp-testing
AnthropicToolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing…
brand-guidelines
AnthropicApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand…
web-artifacts-builder
AnthropicSuite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use…