Skillpedia
المواقع والواجهات (frontend)75k · #2848

flexbox-patterns

ما الذي تفعله

تراجع هذه المهارة كود flexbox في CSS بحثًا عن أخطاء شائعة تكسر التخطيط. وهي موجهة إلى المطورين الذين يبنون تخطيطات الصفحات باستخدام flex.

متى تستخدمها

  • ✓عندما يفيض النص أو يُقطع داخل صف flex.
  • ✓عندما تكون المسافات بين عناصر flex غير متساوية أو يصعب التحكم فيها.
  • ✓عندما تنكمش العناصر أو تتمدد بطرق لم تقصدها.

رابط المهارة

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

انسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.

طريقة الاستخدام

أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.

رسالة جاهزة للصق

استخدم هذه المهارة لمساعدتي: https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/flexbox-patterns/SKILL.md اقرأ ملف SKILL.md في هذا الرابط ونفّذ تعليماته لمهمتي.
تريد أن يجد الذكاء الاصطناعي مهارات مثل هذه بنفسه؟ثبّت خادم Skillpedia MCP المجاني: سطر واحد، ويبحث في 15,000+ مهارة قبل كل مهمة.ثبّته في دقيقة واحدة →

مثال على ما تطلبه من الذكاء الاصطناعي

“هل يمكنك فحص CSS الخاص بـ flexbox بحثًا عن أخطاء تكسر التخطيط؟”

5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.

كيف تعمل

يبحث الوكيل عن إعدادات flex التي تسبب الانكماش أو الفيض، وعن الهوامش التي يكون gap أفضل منها. ويقترح قيمًا مصححة وإصلاح min-width عند الحاجة.

المحتوى التقني (ملف SKILL.md الأصلي)

النص الأصلي من المؤلف، مباشرة من GitHub.

Apply Flexbox best practices

Flexbox is one of the most used CSS features, but its unintuitive default values (flex-shrink:1, min-width:auto) cause layout bugs that are hard to diagnose. Understanding the flex shorthand and the min-width:0 fix prevents the most common Flexbox breakage scenarios.

Quick Reference

  • Flexbox is for one-dimensional layouts (a row OR a column)
  • Use flex: 1 1 0 (shorthand: flex:1) for equal-width items that fill space
  • Add min-width: 0 to flex children when text overflow truncation doesn't work
  • Use gap instead of margin for spacing between flex items

Check

Review this CSS for common Flexbox mistakes: missing min-width:0 on text-containing flex children, using margin instead of gap for spacing, and improper flex shorthand usage.

Fix

Fix the Flexbox layout issues: add min-width:0 where needed, replace inter-item margins with gap, and correct flex shorthand values.

Explain

Explain how flex-grow, flex-shrink, and flex-basis work, what the flex shorthand means, and why min-width:0 fixes text overflow in flex layouts.

Code Review

Review stylesheets, component styles, and responsive states related to Apply Flexbox best practices. Flag exact selectors, declarations, or breakpoints that violate the rule in the rendered UI.


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

Rule page: https://frontendchecklist.io/rules/css/flexbox-patterns

الأسئلة الشائعة

لماذا يفيض النص في تخطيطات flex؟

لعناصر flex عرض أدنى افتراضي قد يمنع النص من الانكماش، وتقترح المهارة ضبط min-width على 0 لإصلاح ذلك.

هل أستخدم gap أم margin؟

توصي المهارة بـ gap للمسافات بين عناصر flex.

ماذا تعني flex: 1؟

تشرحها المهارة كاختصار للعناصر التي تتقاسم المساحة المتاحة بالتساوي.

التفاصيل

الوصف الأصلي من المؤلف

Use when reviewing stylesheets, component styles, and responsive behavior related to Apply Flexbox best practices. Check the rendered layout across breakpoints and interaction states before proposing a fix.

repo: thedaviddias/Front-End-Checklist

الشعبية

نجوم GitHub
75k
الترتيب
#2848
الترخيص
MIT
آخر تحديث
31‏/10‏/2026

هل هذه المهارة مفيدة؟

0

سجّل الدخول للتصويت.

التعليقات

  • …

المزيد من المهارات من هذا المستودع

مهارات مشابهة