{"data":{"slug":"github-thedaviddias-front-end-checklist-skills-flexbox-patterns-d0be31890356","title":"Apply Flexbox Best Practices for Layout Stability","summary":"Fix common Flexbox layout issues by ensuring proper use of flex shorthand, min-width:0, and gap for spacing. Deliver stable, responsive layouts with correct text handling.","url":"https:\/\/skillshunter.net\/skills\/github-thedaviddias-front-end-checklist-skills-flexbox-patterns-d0be31890356","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/github-thedaviddias-front-end-checklist-skills-flexbox-patterns-d0be31890356","markdown_url":"https:\/\/skillshunter.net\/skills\/github-thedaviddias-front-end-checklist-skills-flexbox-patterns-d0be31890356.md","download_url":"https:\/\/skillshunter.net\/skills\/github-thedaviddias-front-end-checklist-skills-flexbox-patterns-d0be31890356\/download","category":{"slug":"software-development","name":"Software & Development"},"editor_note":"Ensure the environment supports modern CSS features like flex shorthand and gap. Prepare by reviewing the rendered layout across breakpoints and interaction states before proposing fixes.","instructions":"---\nname: flexbox-patterns\ndescription: \"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.\"\nmetadata:\n  category: css\n  priority: medium\n  difficulty: intermediate\n  estimatedTime: \"20\"\n  source: frontendchecklist.io\n  url: https:\/\/frontendchecklist.io\/rules\/css\/flexbox-patterns\n---\n\n# Apply Flexbox best practices\n\nFlexbox 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.\n\n## Quick Reference\n\n- Flexbox is for one-dimensional layouts (a row OR a column)\n- Use flex: 1 1 0 (shorthand: flex:1) for equal-width items that fill space\n- Add min-width: 0 to flex children when text overflow truncation doesn't work\n- Use gap instead of margin for spacing between flex items\n\n## Check\n\nReview 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.\n\n## Fix\n\nFix the Flexbox layout issues: add min-width:0 where needed, replace inter-item margins with gap, and correct flex shorthand values.\n\n## Explain\n\nExplain 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.\n\n## Code Review\n\nReview 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.\n\n---\n\nFor full implementation details, code examples, and framework-specific guidance,\nsee `references\/rule.md`.\n\nRule page: https:\/\/frontendchecklist.io\/rules\/css\/flexbox-patterns\n","use_cases":["Reviewing Flexbox layouts for text overflow and spacing inconsistencies","Fixing responsive behavior across breakpoints in Flexbox components","Ensuring proper flex shorthand and min-width:0 usage in CSS"],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/thedaviddias\/Front-End-Checklist\/blob\/e8d14d049010e2ce25afcd5e8609dfcbbe63e47e\/skills\/flexbox-patterns\/SKILL.md","source_commit":"e8d14d049010e2ce25afcd5e8609dfcbbe63e47e","license":null,"version":null,"listing_approved_at":"2026-11-23","created_at":"2026-11-22T16:11:07.000000Z","updated_at":"2026-11-23T04:55:09.000000Z","seo_title":"Fix Flexbox Layout Issues with Best Practices","seo_description":"Improve Flexbox layouts by applying best practices to prevent text overflow and spacing issues. Review and fix CSS for stable, responsive designs.","seo_keywords":["fix flexbox layout issues","prevent flexbox text overflow","apply flexbox best practices"]}}