Skip to content

Include draft content notice on pages with hero component#3801

Merged
delucis merged 2 commits intomainfrom
chris/hero-draft
Apr 7, 2026
Merged

Include draft content notice on pages with hero component#3801
delucis merged 2 commits intomainfrom
chris/hero-draft

Conversation

@delucis
Copy link
Copy Markdown
Member

@delucis delucis commented Apr 3, 2026

Description

  • Fixes Draft notice not on page with hero content #3785
  • When adding our draft feature, we added a notice to alert people during dev that page had draft status, but missed adding this same alert if the page used the hero component.
  • This PR fixes that by also including the notice in the hero component

Here’s an example of what this looks like if you set draft: true on the homepage of the Starlight docs:

Small viewport Large viewport
Starlight homepage with a yellow caution shown below the headline The same page in a wider viewport

This also required a couple of minor CSS changes:

  • We previously did not set grid-template-columns on the hero component for small viewports, but this is risky when components can overflow the viewport width (like the draft notice) as the grid simply adapts to accommodate them. The hero is now explicitly a single, 100%-wide column for small viewports so it contains the notice.
  • The hero component uses centre-aligned text on small viewports, but the notice looks quite odd with centred text due to the icon lock-up. So this PR explicitly adds start-alignment to the notice.

I think both of these changes are minor and should be safe enough to release in a patch.

@netlify
Copy link
Copy Markdown

netlify bot commented Apr 3, 2026

Deploy Preview for astro-starlight ready!

Name Link
🔨 Latest commit fffbaaf
🔍 Latest deploy log https://app.netlify.com/projects/astro-starlight/deploys/69cfa4c173398b0008d7f7ae
😎 Deploy Preview https://deploy-preview-3801--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 project configuration.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 3, 2026

🦋 Changeset detected

Latest commit: fffbaaf

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

@delucis delucis added the 🌟 patch Change that triggers a patch release label Apr 3, 2026
@github-actions github-actions bot added the 🌟 core Changes to Starlight’s main package label Apr 3, 2026
@astrobot-houston
Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
/index.html 5.61 KB (+0.02% 🔺)
/_astro/*.js 26.03 KB (0%)
/_astro/*.css 16.04 KB (+0.02% 🔺)

@delucis delucis merged commit fedd48b into main Apr 7, 2026
18 checks passed
@delucis delucis deleted the chris/hero-draft branch April 7, 2026 12:05
@astrobot-houston astrobot-houston mentioned this pull request Apr 7, 2026
gxxxr-111 pushed a commit to gxxxr-111/starlight that referenced this pull request Apr 9, 2026
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 🌟 patch Change that triggers a patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants