subgrid
What it does
This skill shows how to use CSS subgrid so nested items line up with the rows or columns of a parent grid. It is for web builders whose card layouts look uneven.
When to use it
- ✓When a card grid has titles, text or buttons that do not line up across cards.
- ✓When someone asks to align nested grid items without using JavaScript.
- ✓When reviewing CSS grid layouts where child items should follow the parent grid tracks.
Skill link
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/subgrid/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“My product cards look uneven because the titles and buttons don't line up. Can you fix the layout with CSS only?”
5 new skills a week. 1 minute to read.
How it works
The agent makes child elements use the parent grid's rows or columns. The browser then lines up the matching parts of each card on its own.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Use CSS subgrid to align nested grid items to parent tracks
Card grids are one of the most common UI patterns, but aligning content across cards — matching title heights, content areas, and footers — has historically required JavaScript height measurement or CSS hacks. Subgrid solves this at the layout engine level: nested items participate directly in the parent grid's tracks, so alignment is automatic, performant, and CSS-only.
Quick Reference
- subgrid lets a nested grid inherit its parent grid tracks instead of creating new ones
- Solves misaligned card titles, content, and footers across rows of cards
- No JavaScript height matching needed — the browser handles track alignment
- Universal support: Safari 16+, Chrome/Edge 117+, Firefox 71+
Check
Look for card grid layouts in this CSS where card content areas (titles, body text, footers) might not align across cards of different content lengths. These are candidates for subgrid.
Fix
Convert this card grid to use subgrid. Show how to set grid-template-rows on the parent grid, then apply grid-row: span N and grid-template-rows: subgrid on each card to inherit the parent tracks.
Explain
Explain how CSS subgrid works, how it differs from a nested grid, what problem it solves with card alignment, and when to use subgrid on columns versus rows.
Code Review
Review card grid and nested grid layouts in this stylesheet. Flag any layout that uses JavaScript height matching, fixed heights, or display: contents workarounds to achieve cross-card alignment — and show the subgrid equivalent.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
FAQ
Does subgrid work in all browsers?
The skill notes support in Safari 16 and later, Chrome and Edge 117 and later, and Firefox 71 and later.
Is subgrid better than using JavaScript to match heights?
According to this skill, yes. The browser handles the alignment, so no script is needed to measure and match heights.
Should I use subgrid for columns or for rows?
It depends on which direction needs to match. The skill explains both cases so the agent can pick the right one.
Details
Original description by the author
Use when reviewing card grid layouts with misaligned content areas, or any nested grid where child items need to align with sibling cards' corresponding sections without JavaScript intervention.
Popularity
- GitHub stars
- 75k
- Ranking position
- #3040
- License
- MIT
- Updated
- 10/31/2026
Comments
- …
More skills from this repository
frontendchecklist
75kChecks frontend code and live pages against 380+ rules for accessibility, speed, SEO and security, using a command-line tool.
frontend-checklist-global
75kAudits a frontend project against all 386 Front-End Checklist rules, and gives a specific fix for each issue found.
404-page
75kChecks that your missing-page screen offers helpful links and returns a real 404 status, to help lost visitors find their way.
about-page
75kReviews whether your site has a clear About page that explains who runs it, to build trust with visitors and search engines.
Similar skills
angular-developer
280kHelps your agent create Angular code and give project structure advice. Useful for starting new projects, creating code parts, or improving performance and accessibility.
frontend-a11y
280kHelps your agent make web interfaces accessible to everyone. It ensures websites and apps work well with screen readers and keyboard navigation.
frontend-patterns
280kHas your agent apply modern patterns in frontend development. It optimizes performance, manages state, and follows best practices in React and Next.js.