Saltar al contenido
Skillpedia
Interfaces (UI/UX)75 mil · #2775

color-contrast

Qué hace

Esta skill comprueba el contraste de color del texto, los bordes, los iconos y los indicadores de foco frente a los mínimos de WCAG. Es para diseñadores y desarrolladores que quieren que el contenido sea legible para más personas.

Cuándo usarla

  • ✓Cuando eliges colores de texto y de fondo para una página o una marca.
  • ✓Cuando el texto es gris claro sobre blanco o está sobre una fotografía.
  • ✓Cuando compruebas que los botones, los bordes de los campos y los contornos de foco son lo bastante visibles.

Link de la skill

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/color-contrast/SKILL.md

Cópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.

Cómo usar

La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.

Mensaje listo para pegar

Usa esta skill para ayudarme: https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/color-contrast/SKILL.md Lee el archivo SKILL.md de ese link y sigue sus instrucciones en mi tarea.
¿Quieres que tu IA encuentre skills como esta por sí sola?Instala el MCP gratis de Skillpedia: una línea, y busca entre 15.000+ skills antes de cada tarea.Instalar en 1 minuto →

Ejemplo de qué pedirle a la IA

“Comprueba si los colores de mi marca cumplen las pautas de contraste para el texto principal y los botones.”

5 skills nuevas por semana. 1 minuto de lectura.

Cómo funciona

Tu agente mide la relación de contraste entre cada color de texto o de interfaz y su fondo, la compara con el mínimo para su tamaño y sugiere colores más oscuros o más claros cuando hace falta.

Contenido técnico (SKILL.md original)

Texto original del autor, en inglés, directo de GitHub.

Meet minimum color contrast ratios

Approximately 1 in 12 men and 1 in 200 women have some form of color vision deficiency. Low contrast text is also difficult for users with low vision, aging eyesight, or those reading in bright sunlight. Insufficient contrast is one of the most common WCAG failures and directly prevents users from reading content they need.

Quick Reference

  • Normal text (< 18pt or < 14pt bold): minimum contrast ratio of 4.5:1 — WCAG 2.1 SC 1.4.3 Level AA
  • Large text (≥ 18pt / 24px, or ≥ 14pt bold / ~18.67px bold): minimum 3:1 contrast ratio
  • Non-text UI components (icons, focus indicators, input borders): minimum 3:1 against adjacent color — WCAG 2.1 SC 1.4.11 Level AA
  • WCAG 2.1 SC 1.4.6 (Level AAA) requires 7:1 for normal text and 4.5:1 for large text
  • Decorative text and logotypes are exempt from contrast requirements

Check

Evaluate the contrast ratio between text color and its background for all text on the page. Use the WCAG relative luminance formula: for normal text (< 18pt or < 14pt bold), the ratio must be ≥ 4.5:1; for large text (≥ 18pt or ≥ 14pt bold), the ratio must be ≥ 3:1. Also check non-text UI components (input borders, button outlines, icons) for ≥ 3:1 ratio against adjacent colors per WCAG 2.1 SC 1.4.11. Check all interactive states: default, hover, focus, active, and visited.

Fix

Darken the foreground color or lighten/darken the background color until the ratio meets the minimum. For normal text failing 4.5:1: increase text darkness or background lightness. For large text failing 3:1: apply same approach with a lower threshold. Use a contrast checker tool (WebAIM, browser DevTools accessibility panel) to verify the exact ratio. Do not use opacity to lighten text — compute the effective blended color and check that ratio instead.

Explain

WCAG 2.1 SC 1.4.3 (Contrast Minimum, Level AA) requires a contrast ratio of at least 4.5:1 for normal text and 3:1 for large text (≥ 18pt regular or ≥ 14pt bold). Contrast ratio is calculated from the relative luminance of the foreground and background colors using the formula (L1 + 0.05) / (L2 + 0.05), where L1 is the lighter and L2 is the darker color. A ratio of 1:1 means no contrast (same color); 21:1 is maximum (black on white). Users with low vision, cataracts, or color blindness rely on high contrast to distinguish text from its background.

Code Review

Review the rendered markup and interactive states that affect Meet minimum color contrast ratios. Flag exact elements, roles, labels, focus behavior, or keyboard interactions that violate the rule, and note how to verify the fix with browser accessibility tooling or assistive tech.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/accessibility/color-contrast

Preguntas frecuentes

¿Cuánto contraste necesita el texto normal?

La skill indica al menos 4,5 a 1 para el texto normal, y 3 a 1 para el texto grande.

¿Los elementos decorativos necesitan contraste?

No. La skill indica que el texto decorativo y los logotipos están exentos.

¿Esto cubre los estados de hover y foco?

Sí. La skill indica comprobar todos los estados interactivos, incluidos hover, foco y activo.

Detalles

Descripción original del autor

Use when applies to all visible text and text images, UI component borders (input fields, buttons), focus indicators, icons that convey meaning, and graphical objects required to understand content. Does not apply to inactive/disabled UI components or purely decorative elements.

repo: thedaviddias/Front-End-Checklist

Popularidad

Estrellas en GitHub
75 mil
Posición en el ranking
#2775
Licencia
MIT
Actualizada
31/10/2026

¿Te sirve esta skill?

0

Entra para votar.

Comentarios

  • …

Más skills de este repositorio

Skills parecidas