fix: consistent card heights and widths in homepage card grid#710
fix: consistent card heights and widths in homepage card grid#710Copilot wants to merge 4 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- Change DocHomeCardContainer gridTemplateColumns from
repeat(auto-fit, minmax(224px, 30%)) to
repeat(auto-fill, minmax(224px, 1fr)):
* 1fr distributes space equally so all columns are the same width
* auto-fill keeps empty end-tracks so last-row cards stay the same
width as cards in full rows (no stretching)
- Add display: block to DocHomeCard (Box component="a") so the anchor
element reliably fills the full grid-cell height via the default
align-items: stretch
|
@copilot It seems that the card spacing issue hasn't been resolved. |
There was a problem hiding this comment.
Pull request overview
This PR adjusts the homepage documentation “card grid” styling to eliminate inconsistent gaps and ensure cards in the same row render with consistent widths/heights across browsers.
Changes:
- Updated
DocHomeCardContainergrid columns torepeat(auto-fill, minmax(224px, 1fr))and removedjustifyContent: "start"to better distribute column widths. - Set
DocHomeCard(anchor) todisplay: "block"to ensure reliable grid-item stretching behavior.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Updated in commit |
|
@copilot For a better visual experience, please keep the three-column layout. |
Updated in commit |
Homepage card grids had two visual defects: phantom empty columns creating dead whitespace between cards, and cards in the same row rendering at different heights.
Root causes
DocHomeCardContainerusedrepeat(auto-fit, minmax(224px, 30%)). The30%hard cap means 3 columns consume only 90% of the container, leaving a visible gap.auto-fillchange still reserved empty end-tracks, which could keep visible dead space.DocHomeCard(Box component="a") had no explicitdisplay. Anchor elements are inline by default; withoutdisplay: block, grid blockification is unreliable across browsers, so cards in the same row rendered at their intrinsic heights rather than stretching to match the tallest sibling.Changes (
src/components/MDXComponents/DocHome.tsx)DocHomeCardContainernow uses breakpoint-specific grid behavior:smusesauto-fit+1frto avoid dead whitespace from empty tracks.mdand above enforce a fixed three-column layout for better desktop visual consistency.DocHomeCardaddsdisplay: "block"so the anchor is always a block-level grid item and stretches to fill the full row height via the defaultalign-items: stretch.