grid-layout-systems
/grid-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, aligning nested components to a parent grid, or building responsive card/dashboard layouts.
- Author
- uw-ssec ↗
- Repository
- rse-plugins ↗
- Licence
- BSD-3-Clause
- Last repository change
- 14.10.2026
Assessment and security
- Files in this package
- 4
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 14.10.2026, without references to retired models or APIs.
BSD-3-Clause, otwarta.
What it does and when to use it
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, aligning nested components to a parent grid, or building responsive card/dashboard layouts.
Original author description
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, aligning nested components to a parent grid, or building responsive card/dashboard layouts.
How it works
- Choose the Right Tool
- Workflow
- 12-Column Grid (copy-paste)
- Named Grid Areas (Holy Grail)
- Auto-Reflow Card Grid
- Subgrid (align nested to parent)
- Flexbox Patterns
- Container Queries
- Spacing Tokens (Base-4)
- Validation Checklist
SKILL.md preview
---
name: grid-layout-systems
description: 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, aligning nested components to a parent grid, or building responsive card/dashboard layouts.
metadata:
references:
- references/grid-patterns.md
- references/responsive-strategies.md
- references/spacing-systems.md
---
# Grid Layout Systems
## Choose the Right Tool
| Need | Use |
|------|-----|
| 2D page layout (rows + columns) | CSS Grid |
| 1D component layout (row OR column) | Flexbox |
| Nested element aligned to parent grid | `grid-template-columns: subgrid` |
| Auto-reflowing card grid (no breakpoints) | Grid + `auto-fit minmax()` |
| Component responsive to container, not viewport | Container queries |
## Workflow
1. Decide page-level vs component-level. Page → Grid. Component → Flexbox.
2. Pick a column count: 12 (flexible), 8 (simpler), 4 (mobile).
3. Set tokens for `--gap`, `--max-width`, spacing scale (see Spacing).
4. Build layout with named areas OR `repeat(N, 1fr)`.
5. Add responsive behavior: prefer `auto-fit minmax()` over breakpoints; fall back to `@media (min-width: ...)` for structural changes.
6. Validate against the checklist at the bottom.
## 12-Column Grid (copy-paste)
```css
.container {
display: grid;
grid-template-columns: repeat(12, 1fr);
gap: 24px;
max-width: 1200px;
margin: 0 auto;
padding: 0 24px;
}
.content { grid-column: span 8; }
.sidebar { grid-column: span 4; }
.hero { grid-column: 1 / -1; }
.narrow { grid-column: 3 / 11; }
```
## Named Grid Areas (Holy Grail)
```css
.page {
display: grid;
grid-template-columns: 240px 1fr 300px;
grid-template-rows: auto 1fr auto;
grid-template-areas:
"header header header"
"nav main aside"
"footer footer footer";
min-height: 100vh;
}
.header { grid-area: header; }
.nav { grid-area: nav; }
.main { grid-area: main; }
.aside { grid-area: aside; }
.footer { grid-area: footer; }
```
## Auto-Reflow Card Grid
```css
/* auto-fit: empty tracks collapse; auto-fill: empty tracks preserved */
.card-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
gap: 24px;
}
```
## Subgrid (align nested to parent)
```css
.page { display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; }
.card-group {
grid-column: 1 / -1;
display: grid;
grid-template-columns: subgrid;
}
.card { grid-column: span 4; }
```
## Flexbox Patterns
```css
/* Navbar */
.navbar { display: flex; align-items: center; justify-content: space-between; }
/* Card with footer pinned to bottom */
.card { display: flex; flex-direction: column; height: 100%; }
.card-body { flex: 1; }
.card-footer { margin-top: auto; }
/* Centering */
.center { display: grid; place-items: center; }
```
## Container Queries
```css
.card-container { container-type: inline-size; container-name: card; }
@container card (min-width: 400px) {
.card { display: grid; grid-template-columns: 120px 1fr; gap: 16px; }
}
@container card (max-width: 399px) {
.card { display: flex; flex-direction: column; }
}
```
## Spacing Tokens (Base-4)
```css
:root {
--space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
--space-6: 24px; --space-8: 32px; --space-12: 48px; --space-16: 64px;
}
```
- Intra-component: 4–12px. Inter-component: 16–24px. Section: 32–96px.
## Validation Checklist
- [ ] DevTools grid overlay shows all major elements aligned to the same column tracks.
- [ ] No element uses absolute positioning to escape the grid.
- [ ] Resize from 320px → 1920px: no horizontal scroll, no overlaps, no orphaned items.
- [ ] Cards in an `auto-fit` grid reflow without breakpoints.
- [ ] Sub-components in nested grids align to the parent (use subgrid or matching tracks).
- [ ] Gap values come from spacing tokens, not magic numbers.
## Deep Dive References
- [Grid Patterns](references/grid-patterns.md) — Holy Grail, dashboard, magazine, masonry, sidebar, sticky footer
- [Responsive Strategies](references/responsive-strategies.md) — Mobile-first, content-driven breakpoints, fluid grids
- [Spacing Systems](references/spacing-systems.md) — Base units, hierarchy, density modes, token naming
## Next Steps
- **[Typography Systems](../typography-systems/SKILL.md)**: Align type to baseline grid
- **[Responsive Design](../responsive-design/SKILL.md)**: Broader responsive strategy
- **[CSS Architecture](../css-architecture/SKILL.md)**: Organize grid utilities
- **[Design Tokens](../design-tokens/SKILL.md)**: Encode spacing and breakpoints as tokens
Files in this package (4)
- SKILL.md 5 KB
- references/grid-patterns.md 12 KB
- references/responsive-strategies.md 11 KB
- references/spacing-systems.md 13 KB
Versions
The database has no other skills named grid-layout-systems.
Database snapshot: 13.11.2026 · package version a592f5ba1894 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 2 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100modern-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. - 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. - 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… - 90grid
When the user wants to design, optimize, or audit grid layouts for content display. Also use when the user mentions "grid layout," "grid design," "multi-column grid," "CSS grid," "responsive grid," "card grid," "product grid," or "feature grid." For cards layout, use card. - 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… - 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.