Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .changeset/fresh-horses-burn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
'@astrojs/starlight': minor
---

⚠️ Potentially breaking change: Tabs don't use margin-bottom to
hide border anymore. We also remove the bottom border from `.tab`.

If you want to preserve the previous styling, you can add the following
custom CSS to your site:

```
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;
}
```
Comment on lines +5 to +24
Copy link
Member

@delucis delucis Nov 4, 2025

Choose a reason for hiding this comment

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

This looks great @shubham-padia — just suggesting a few tweaks for the changelog:

Suggested change
⚠️ Potentially breaking change: Tabs don't use margin-bottom to
hide border anymore. We also remove the bottom border from `.tab`.
If you want to preserve the previous styling, you can add the following
custom CSS to your site:
```
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;
}
```
Fixes an issue where a vertical scrollbar could be displayed on the Starlight `<Tabs>` component when zooming the page
⚠️ **Potentially breaking change:** The `<Tabs>` component no longer uses `margin-bottom` and `border-bottom` to highlight the current tab. This is now done with a `box-shadow`. If you have custom styling for your tabs, you may need to update it.
If you want to preserve the previous styling, you can add the following custom CSS to your site:
```
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;
}
```

4 changes: 1 addition & 3 deletions packages/starlight/user-components/Tabs.astro
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ if (isSynced) {

.tab {
display: flex;
margin-bottom: -2px;
}
.tab > [role='tab'] {
display: flex;
Expand All @@ -125,14 +124,13 @@ if (isSynced) {
line-height: var(--sl-line-height-headings);
padding: 0.275rem 1.25rem;
text-decoration: none;
border-bottom: 2px solid var(--sl-color-gray-5);
color: var(--sl-color-gray-3);
outline-offset: var(--sl-outline-offset-inside);
overflow-wrap: initial;
}
.tab [role='tab'][aria-selected='true'] {
color: var(--sl-color-white);
Copy link
Member

@delucis delucis Nov 4, 2025

Choose a reason for hiding this comment

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

Suggested change
color: var(--sl-color-white);
--sl-tab-color-border: var(--sl-color-text-accent);
color: var(--sl-color-white);

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, that is pretty much what I had in mind. Just tested locally and this works as expected (just took the liberty of editing this suggestion as it was suggesting to replace the color: var(--sl-color-white); line instead of appending after it.

border-color: var(--sl-color-text-accent);
box-shadow: 0 2px 0 var(--sl-color-text-accent);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
box-shadow: 0 2px 0 var(--sl-color-text-accent);

font-weight: 600;
}

Expand Down