-
-
Notifications
You must be signed in to change notification settings - Fork 591
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add grid-template-columns
to<CardGrid>
#2606
Conversation
🦋 Changeset detectedLatest commit: 1cccb5b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for astro-starlight ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
size-limit report 📦
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a great improvement to upstream 🌟 🚀
* main: [ci] release (withastro#2615) [ci] format feat: add Backstage social icon (withastro#2600) Add SidebarPersister specifier to Starlight package (withastro#2605) Fix i18n type issue with multiple data content collections (withastro#2611) Fix sidebar issue in custom pages with custom sidebar (withastro#2614) Fix `sidebar` frontmatter use in internal links (withastro#2613) Add `grid-template-columns` to`<CardGrid>` (withastro#2606) i18n(zh-cn): Update `site-search.mdx` (withastro#2604)
Description
This PR adds a base
grid-template-columns
rule to the<CardGrid>
component to apply on smaller screens as one100%
wide column.This helps avoid overflow when there is complex content inside the grid children. We already apply this rule as an override in Astro Docs to avoid overflow, but I only just remembered to upstream this.
Why can this be an issue? Without an explicit column width, the grid uses an implicit width based on context. For example, without this rule, cards on the Astro Docs homepage would overflow due to the code block in the “Start a new project” card:
Adding an explicit column width avoids that and ensures children are constrained as expected: