Skip to content

fix: span banner across main frame above right sidebar - #4418

Open
xsagul wants to merge 1 commit into
withastro:mainfrom
xsagul:fix/banner-desktop-alignment
Open

xsagul wants to merge 1 commit into
withastro:mainfrom
xsagul:fix/banner-desktop-alignment

Conversation

@xsagul

@xsagul xsagul commented Nov 16, 2026

Copy link
Copy Markdown

Description

  • Closes Banner is off-center on larger screen sizes #1748
  • Moves <Banner /> out of <main> in Page.astro so it sits above <TwoColumnContent /> inside .main-frame. On wide viewports (>= 72rem) with a table of contents, the banner now spans the full width of the content area (both .main-pane and .right-sidebar-container) and appears centered instead of being constrained to .main-pane.
  • Updates .right-sidebar sticky positioning in TwoColumnContent.astro (top: var(--sl-nav-height), height: calc(100vh - var(--sl-nav-height)), border moved onto .right-sidebar) so the right sidebar starts below the banner at scroll top and pins beneath the navbar when scrolling.
  • Adds role="region" and a localized aria-label (banner.accessibleLabel, seeded in built-in translation files since builtinI18nSchema() requires all keys) to Banner.astro so the banner remains a unique accessible landmark outside <main>.
  • Updates starlight-toc.ts to continue observing .sl-banner now that it is no longer a descendant of <main>.
  • Adds Playwright E2E assertions covering banner alignment, landmark attributes, and sticky right-sidebar scroll behavior in packages/starlight/__e2e__/basics.test.ts, plus an @astrojs/starlight patch changeset.

Local verification after final edits:

  • Build and publint check (pnpm --filter '@astrojs/*' build)
  • Example build and size-limit check (pnpm --filter @example/starlight-basics build and pnpm size)
  • prettier --check on all modified files
  • Playwright E2E suite __e2e__/basics.test.ts: 52 passed
  • Targeted source and built dist Vitest suites (i18n, translations, translations-fs, translations-ec, config-errors, starlight-page-route-data): 84 passed in both source and dist modes
  • axe-playwright audit (wcag2a, wcag21a, wcag2aa, wcag21aa, wcag22aa, best-practice) on built /headings-banner/, /custom-page/, and /headings/ pages: 0 violations

@changeset-bot

changeset-bot Bot commented Nov 16, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d15be5d

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 16, 2026
@netlify

netlify Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

❌ Deploy Preview for astro-starlight failed. Why did it fail? →

Built without sensitive environment variables

Name Link
🔨 Latest commit d15be5d
🔍 Latest deploy log https://app.netlify.com/projects/astro-starlight/deploys/6afb7583a30e844824ffef0c

@astrobot-houston

Copy link
Copy Markdown
Contributor

Hello! Thank you for opening your first PR to Starlight! ✨

Here’s what will happen next:

  1. Our GitHub bots will run to check your changes.
    If they spot any issues you will see some error messages on this PR.
    Don’t hesitate to ask any questions if you’re not sure what these mean!

  2. In a few minutes, you’ll be able to see a preview of your changes on Netlify 🤩

  3. One or more of our maintainers will take a look and may ask you to make changes.
    We try to be responsive, but don’t worry if this takes a few days.

This branch has not been deployed

No deployments
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.

Banner is off-center on larger screen sizes

2 participants