Pular para o conteúdo
Skillpedia
Sites e telas (frontend)75 mil · #3040

subgrid

O que ela faz

Esta skill mostra como usar subgrid do CSS para que itens aninhados se alinhem às linhas ou colunas de uma grade pai. Ela é para criadores web cujos layouts de cartões parecem desalinhados.

Quando usar

  • ✓Quando uma grade de cartões tem títulos, textos ou botões que não se alinham entre os cartões.
  • ✓Quando alguém pede para alinhar itens de grade aninhados sem usar JavaScript.
  • ✓Quando você revisa layouts de grade CSS em que os itens filhos devem seguir as trilhas da grade pai.

Link da skill

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/subgrid/SKILL.md

Copie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.

Como usar

O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.

Mensagem pronta para colar

Use esta skill para me ajudar: https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/subgrid/SKILL.md Leia o arquivo SKILL.md desse link e siga as instruções dele na minha tarefa.
Quer que a sua IA encontre skills como esta sozinha?Instale o MCP grátis do Skillpedia: uma linha, e ela pesquisa entre 15.000+ skills antes de cada tarefa.Instalar em 1 minuto →

Exemplo do que pedir para a IA

“Meus cartões de produto estão desalinhados porque os títulos e os botões não coincidem. Você pode corrigir o layout só com CSS?”

5 skills novas por semana. 1 minuto de leitura.

Como funciona

O agente faz os elementos filhos usarem as linhas ou colunas da grade pai. Assim, o navegador alinha sozinho as partes correspondentes de cada cartão.

Conteúdo técnico (SKILL.md original)

Texto original do autor, em inglês, direto do 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.

Rule page: https://frontendchecklist.io/rules/css/subgrid

Perguntas frequentes

O subgrid funciona em todos os navegadores?

A skill observa suporte no Safari 16 ou mais recente, no Chrome e no Edge 117 ou mais recente, e no Firefox 71 ou mais recente.

O subgrid é melhor que usar JavaScript para igualar alturas?

Segundo esta skill, sim. O navegador faz o alinhamento, então nenhum script é necessário para medir e igualar as alturas.

Devo usar subgrid para colunas ou para linhas?

Depende da direção que precisa coincidir. A skill explica os dois casos para que o agente escolha o certo.

Detalhes

Descrição original do autor

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.

repo: thedaviddias/Front-End-Checklist

Popularidade

Estrelas no GitHub
75 mil
Posição no ranking
#3040
Licença
MIT
Atualizada em
31/10/2026

Essa skill é útil?

0

Entre para votar.

Comentários

  • …

Mais skills deste repositório

Skills parecidas