{"data":{"slug":"github-thedaviddias-front-end-checklist-skills-color-contrast-f2877744fd86","title":"Ensure Minimum Color Contrast for Accessibility","summary":"Verify that text and UI components meet the minimum color contrast ratios required for accessibility, as defined by WCAG 2.1 standards. This includes checking normal text, large text, and non-text UI components for compliance with 4.5:1, 3:1, and 3:1 ratios respectively.","url":"https:\/\/skillshunter.net\/skills\/github-thedaviddias-front-end-checklist-skills-color-contrast-f2877744fd86","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/github-thedaviddias-front-end-checklist-skills-color-contrast-f2877744fd86","markdown_url":"https:\/\/skillshunter.net\/skills\/github-thedaviddias-front-end-checklist-skills-color-contrast-f2877744fd86.md","download_url":"https:\/\/skillshunter.net\/skills\/github-thedaviddias-front-end-checklist-skills-color-contrast-f2877744fd86\/download","category":{"slug":"content-editorial","name":"Content & Editorial"},"editor_note":"Use a contrast checker tool (e.g., WebAIM or browser DevTools accessibility panel) to verify the exact ratio. Avoid using opacity to lighten text \u2014 compute the effective blended color and check that ratio instead.","instructions":"---\nname: color-contrast\ndescription: \"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.\"\nmetadata:\n  category: accessibility\n  priority: high\n  difficulty: intermediate\n  estimatedTime: \"15\"\n  source: frontendchecklist.io\n  url: https:\/\/frontendchecklist.io\/rules\/accessibility\/color-contrast\n---\n\n# Meet minimum color contrast ratios\n\nApproximately 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.\n\n## Quick Reference\n\n- Normal text (< 18pt or < 14pt bold): minimum contrast ratio of 4.5:1 \u2014 WCAG 2.1 SC 1.4.3 Level AA\n- Large text (\u2265 18pt \/ 24px, or \u2265 14pt bold \/ ~18.67px bold): minimum 3:1 contrast ratio\n- Non-text UI components (icons, focus indicators, input borders): minimum 3:1 against adjacent color \u2014 WCAG 2.1 SC 1.4.11 Level AA\n- WCAG 2.1 SC 1.4.6 (Level AAA) requires 7:1 for normal text and 4.5:1 for large text\n- Decorative text and logotypes are exempt from contrast requirements\n\n## Check\n\nEvaluate 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 \u2265 4.5:1; for large text (\u2265 18pt or \u2265 14pt bold), the ratio must be \u2265 3:1. Also check non-text UI components (input borders, button outlines, icons) for \u2265 3:1 ratio against adjacent colors per WCAG 2.1 SC 1.4.11. Check all interactive states: default, hover, focus, active, and visited.\n\n## Fix\n\nDarken 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 \u2014 compute the effective blended color and check that ratio instead.\n\n## Explain\n\nWCAG 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 (\u2265 18pt regular or \u2265 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.\n\n## Code Review\n\nReview 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.\n\n---\n\nFor full implementation details, code examples, and framework-specific guidance,\nsee `references\/rule.md`.\n\nRule page: https:\/\/frontendchecklist.io\/rules\/accessibility\/color-contrast\n","use_cases":["Verify contrast ratios for normal text (< 18pt or < 14pt bold) to meet 4.5:1 ratio.","Check large text (\u2265 18pt or \u2265 14pt bold) for a minimum 3:1 contrast ratio.","Ensure non-text UI components (icons, focus indicators) have a 3:1 contrast ratio against adjacent colors."],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/thedaviddias\/Front-End-Checklist\/blob\/e8d14d049010e2ce25afcd5e8609dfcbbe63e47e\/skills\/color-contrast\/SKILL.md","source_commit":"e8d14d049010e2ce25afcd5e8609dfcbbe63e47e","license":null,"version":null,"listing_approved_at":"2026-11-23","created_at":"2026-11-22T15:32:47.000000Z","updated_at":"2026-11-23T04:54:56.000000Z","seo_title":"Ensure Minimum Color Contrast for Accessibility","seo_description":"Ensure text and UI components meet WCAG 2.1 color contrast requirements. Check and fix contrast ratios for accessibility.","seo_keywords":["color contrast ratio","WCAG 2.1 contrast","accessibility contrast check","text contrast ratio","UI component contrast"]}}