Skip to content
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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Add grid-template-columns to<CardGrid> #2606

wants to merge 2 commits into from

Conversation

delucis
Copy link
Member

@delucis delucis commented Nov 14, 2024

Description

  • This PR adds a base grid-template-columns rule to the <CardGrid> component to apply on smaller screens as one 100% 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:

    narrow viewport screenshot of Astro Docs without this change. A card featuring a code example overflows the viewport
  • Adding an explicit column width avoids that and ensures children are constrained as expected:

    A similar screenshot of Astro Docs but now the cards all fit inside the viewport instead of overflowing

Copy link

changeset-bot bot commented Nov 14, 2024

🦋 Changeset detected

Latest commit: 1cccb5b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@astrojs/starlight Patch

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

@github-actions github-actions bot added the 🌟 core Changes to Starlight’s main package label Nov 14, 2024
Copy link

netlify bot commented Nov 14, 2024

Deploy Preview for astro-starlight ready!

Name Link
🔨 Latest commit 1cccb5b
🔍 Latest deploy log https://app.netlify.com/sites/astro-starlight/deploys/6736816d08a5540008b33a04
😎 Deploy Preview https://deploy-preview-2606--astro-starlight.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 100 (no change from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@astrobot-houston
Copy link
Collaborator

size-limit report 📦

Path Size
/index.html 6.15 KB (+0.1% 🔺)
/_astro/*.js 22.41 KB (0%)
/_astro/*.css 13.73 KB (0%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌟 core Changes to Starlight’s main package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants