Skip to content

Conversation

@shubham-padia
Copy link
Contributor

@shubham-padia shubham-padia commented Nov 3, 2025

Description

We were setting margin-bottom as -2px when at the same time we had a bottom border of 2px. Using this indirect margin was causing the tab container to be greater in height than it's wrapper when we zoomed out from the default zoom level. This introduced an unnecessary scroll bar.

Zoom Level Before After
90% Screenshot 2025-11-03 at 4 01 35 PM Screenshot 2025-11-03 at 4 01 43 PM
100% Screenshot 2025-11-03 at 3 53 30 PM Screenshot 2025-11-03 at 3 53 57 PM

I'm not sure if this PR warrants a minor version bump or not, let me know if it does.

@changeset-bot
Copy link

changeset-bot bot commented Nov 3, 2025

🦋 Changeset detected

Latest commit: cf44ae4

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 Minor

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 3, 2025
@netlify
Copy link

netlify bot commented Nov 3, 2025

Deploy Preview for astro-starlight ready!

Name Link
🔨 Latest commit cf44ae4
🔍 Latest deploy log https://app.netlify.com/projects/astro-starlight/deploys/6908c9dc6fe77700076f6007
😎 Deploy Preview https://deploy-preview-3521--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.

Copy link
Member

@delucis delucis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good catch and fix @shubham-padia! Nice one.

I agree this probably should be in a minor release, just in case someone customized border width in their theme and the switch to box-shadow could cause issues. Normally for changes like this we also try to include a snippet in the changeset explaining how to “revert” the new style if wanted for whatever reason, so maybe something like:

starlight-tabs .tab {
  margin-bottom: -2px;
}

starlight-tabs .tab > [role='tab'] {
  border-bottom: 2px solid var(--sl-color-gray-5);
}

starlight-tabs .tab [role='tab'][aria-selected='true'] {
  border-color: var(--sl-color-text-accent);
  box-shadow: none;
}

There’s a recent example of something like that in the changelog entry for v0.36 in case it’s helpful to see.

@delucis delucis added the 🌟 minor Change that triggers a minor release label Nov 3, 2025
@delucis delucis added this to the v0.37 milestone Nov 3, 2025
@shubham-padia shubham-padia force-pushed the fix-tab-overflow-on-zoom-out branch from f56749a to 63c49b6 Compare November 3, 2025 13:16
We were setting margin-bottom as -2px when at the same time we had a
bottom border of 2px. Using this indirect margin was causing the tab
container to be greater in height than it's wrapper when we zoomed out
from the default zoom level. This introduced an unnecessary scroll bar.

We use a border-bottom of 2px on `.tab` mainly to mark the active tab
with `--sl-color-text-accent`, the additional margin-bottom: -2px hides
the grey border from the tablist so it doesn't feel like we have a blue
bottom border for the active tab sitting on top of a grey border.

Using box shadow instead to paint over the bottom border of the tablist
is a cleaner idea than doing these margin-bottom shenanigans.
@shubham-padia shubham-padia force-pushed the fix-tab-overflow-on-zoom-out branch from 63c49b6 to 7033a9c Compare November 3, 2025 13:18
@shubham-padia
Copy link
Contributor Author

Updated the PR @delucis ! Let me know if we want this to be part of a patch release instead of minor.

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 🌟 minor Change that triggers a minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants