color-contrast
ما الذي تفعله
تتحقق هذه المهارة من تباين الألوان للنصوص والحدود والأيقونات ومؤشرات التركيز وفق الحدود الدنيا في WCAG. وهي موجهة إلى المصممين والمطورين الذين يريدون محتوى مقروءًا لعدد أكبر من الناس.
متى تستخدمها
- ✓عندما تختار ألوان النص والخلفية للصفحة أو للعلامة التجارية.
- ✓عندما يكون النص رماديًا فاتحًا على أبيض أو فوق صورة.
- ✓عندما تتحقق من وضوح الأزرار وحدود الحقول وخطوط التركيز.
رابط المهارة
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/color-contrast/SKILL.mdانسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.
طريقة الاستخدام
أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.
رسالة جاهزة للصق
لـ Claude Code أو Codex أو Cursor: شغّله داخل مجلد مشروعك وستُثبَّت المهارة.
نزّل ملف SKILL.md وضعه في مجلد مهارات وكيلك.
مثال على ما تطلبه من الذكاء الاصطناعي
“تحقق مما إذا كانت ألوان علامتي التجارية تستوفي إرشادات التباين لنص المحتوى والأزرار.”
5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
يقيس الوكيل نسبة التباين بين كل لون نص أو عنصر واجهة وخلفيته، ويقارنها بالحد الأدنى لحجمه، ويقترح ألوانًا أغمق أو أفتح عند الحاجة.
المحتوى التقني (ملف SKILL.md الأصلي)
النص الأصلي من المؤلف، مباشرة من 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
الأسئلة الشائعة
كم التباين الذي يحتاجه النص العادي؟
تقول المهارة 4.5 إلى 1 على الأقل للنص العادي، و3 إلى 1 للنص الكبير.
هل تحتاج العناصر الزخرفية إلى تباين؟
لا. تقول المهارة إن النصوص الزخرفية والشعارات مستثناة.
هل يشمل هذا حالات المرور بالفأرة والتركيز؟
نعم. تقول المهارة إن على المرء فحص كل الحالات التفاعلية، بما فيها hover وfocus وactive.
التفاصيل
الوصف الأصلي من المؤلف
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.
الشعبية
- نجوم GitHub
- 75k
- الترتيب
- #2775
- الترخيص
- MIT
- آخر تحديث
- 31/10/2026
التعليقات
- …
المزيد من المهارات من هذا المستودع
frontendchecklist
75kيفحص شيفرة الواجهة الأمامية والصفحات الحية مقابل أكثر من 380 قاعدة للوصول وسرعة الأداء وتحسين محركات البحث والأمان، بأداة سطر أوامر.
frontend-checklist-global
75kيدقق مشروع الواجهة الأمامية وفق كل قواعد Front-End Checklist البالغ عددها 386، ويقدم إصلاحًا محددًا لكل مشكلة وجدت.
404-page
75kيتأكد من أن صفحة الصفحات غير الموجودة تقدم روابط مفيدة وتُرجع رمز حالة 404 حقيقيًا، لمساعدة الزوار التائهين على إيجاد طريقهم.
about-page
75kيراجع ما إذا كان لموقعك صفحة «من نحن» واضحة تشرح من يديره، لبناء الثقة لدى الزوار ومحركات البحث.
مهارات مشابهة
canvas
394kيتيح لوكيلك عرض أداة مرئية مستضافة على لوحة Mac متصلة، ثم إخفاء اللوحة أو نقلها إلى صفحة أخرى.
control-ui
394kيساعد وكيلك على تنظيم واجهة OpenClaw Control UI واستكشاف أخطائها، بما في ذلك الجلسات ولوحات المعلومات وبوابات Gateway المتصلة.
diagram-maker
394kيساعد وكيلك على إنشاء مخططات واضحة بصيغة SVG أو HTML أو Excalidraw قابلة للتعديل، للعمليات وبنية الأنظمة والرسومات على السبورة.