Skip to content
Skills Library
Programming · Building & coding

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.

Licence
MIT
Last repository change
28.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 28.10.2026, without references to retired models or APIs.

Licence

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

  1. When to use
  2. Prerequisites
  3. Step-by-step workflow
  4. Commands / code examples
  5. Common mistakes & pitfalls
  6. Verification checklist
  7. Related skills
Original SKILL.md headings · 63 lines, 330 words
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…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.