modern-css-layout-grid-flexbox
/modern-css-layout-grid-flexbox
Use this skill when engineering responsive layouts and alignment using modern CSS Flexbox and 2D CSS Grid without external layout libraries.
- Author
- nextboxis ↗
- Repository
- library-skill-agents ↗
- Licence
- MIT
- Last repository change
- 28.10.2026
Assessment and security
- Files in this package
- 1
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 28.10.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
What it does and when to use it
Use this skill when engineering responsive layouts and alignment using modern CSS Flexbox and 2D CSS Grid without external layout libraries.
Original author description
Use this skill when engineering responsive layouts and alignment using modern CSS Flexbox and 2D CSS Grid without external layout libraries.
How it works
- When to use
- Prerequisites
- Step-by-step workflow
- Commands / code examples
- Common mistakes & pitfalls
- Verification checklist
- Related skills
SKILL.md preview
---
name: modern-css-layout-grid-flexbox
description: Use this skill when engineering responsive layouts and alignment using modern CSS Flexbox and 2D CSS Grid without external layout libraries.
---
# Modern CSS Layout: Grid & Flexbox
## When to use
Use this skill when designing fluid user interfaces, multi-column dashboards, responsive card grids, or centering content without brittle margin hacks.
## Prerequisites
- Standard modern browser runtime supporting CSS Grid Level 1/2 and Flexbox.
- Understanding of the CSS box model (content, padding, border, margin).
## Step-by-step workflow
1. **Choose the layout model**: Use Flexbox for one-dimensional layouts (rows or columns); use CSS Grid for two-dimensional layouts (rows and columns).
2. **Construct fluid grids**: Apply `repeat(auto-fit, minmax(min, 1fr))` to create auto-responsive grids without media query boilerplate.
3. **Manage spacing**: Use the `gap` property (both row and column) directly on container elements instead of child margins.
4. **Control alignment**: Use `justify-content` / `align-items` on containers and `justify-self` / `align-self` on specific child items.
5. **Handle layout overflows**: Ensure flex children do not overflow by applying `min-width: 0` or `overflow: hidden` where flex basis causes clipping.
## Commands / code examples
```css
/* Responsive auto-fitting card grid */
.dashboard-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
gap: 1.5rem;
padding: 1.5rem;
}
/* Centered sticky toolbar with Flexbox */
.action-toolbar {
display: flex;
justify-content: space-between;
align-items: center;
gap: 1rem;
position: sticky;
top: 0;
background: #ffffff;
padding: 0.75rem 1rem;
border-bottom: 1px solid #e5e7eb;
}
.toolbar-group {
display: flex;
align-items: center;
gap: 0.5rem;
}
```
## Common mistakes & pitfalls
- Using Flexbox with complex percentage widths when CSS Grid would provide cleaner 2D placement.
- Forgetting that flex items have an initial `min-width: auto`, preventing text truncation with `text-overflow: ellipsis`.
- Writing dozens of media queries instead of leveraging `auto-fit` and `minmax()` primitives.
## Verification checklist
- [ ] Layout scales smoothly from 320px mobile screens to 4K displays.
- [ ] Spacing is handled through container `gap` properties.
- [ ] Content truncation works cleanly inside flex items using `min-width: 0`.
- [ ] Grid templates adapt dynamically without horizontal scrollbars.
## Related skills
- css-subgrid-container-queries
- tailwindcss-architecture
- html5-semantic-web
- accessible-color-contrast-visual-design
Versions
The database has no other skills named modern-css-layout-grid-flexbox.
Database snapshot: 13.11.2026 · package version 301d3e70d587 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 4 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100grid-layout-systems
Provides CSS layout code and recommendations using Grid and Flexbox, creates responsive column systems, and selects the right layout approach for pages and components. Use when laying out a page or component, choosing between CSS Grid and Flexbox, setting up a column grid,… - 100responsive-layout-builder
Build responsive layouts with CSS Grid, Flexbox, and container queries. Use when creating responsive designs, fixing layout issues, or building mobile-first layouts. - 100html-css
Expert modern HTML5 and CSS3 assistance covering semantic markup, Flexbox, CSS Grid, container queries, CSS custom properties, and responsive design systems. Use when crafting accessible web interfaces, building resilient UI layouts, or optimizing render performance. - 100tailwind-css-patterns
Provides comprehensive Tailwind CSS utility-first styling patterns including responsive design, layout utilities, flexbox, grid, spacing, typography, colors, and modern CSS best practices. Use when styling React/Vue/Svelte components, building responsive layouts, implementing… - 100css-ninja
Master CSS with Tailwind, CSS-in-JS, responsive layouts, animations, and modern styling patterns. Use when: (1) responsive design implementation, (2) Tailwind CSS setup and customization, (3) CSS-in-JS (styled-components, emotion), (4) complex layouts (Grid, Flexbox), (5) CSS… - 100layout-composition
Grid systems, visual hierarchy, whitespace, and modern CSS layout patterns (grid, flexbox, bento, container queries) for web pages and UI. Use when arranging content on a page or screen. For spacing/radius tokens themselves use design-system; for slide layouts use…