-
-
Notifications
You must be signed in to change notification settings - Fork 832
Tabs: Remove margin-bottom being used to hide border. #3521
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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; | ||
| } | ||
| ``` | ||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -116,7 +116,6 @@ if (isSynced) { | |||||||
|
|
||||||||
| .tab { | ||||||||
| display: flex; | ||||||||
| margin-bottom: -2px; | ||||||||
| } | ||||||||
| .tab > [role='tab'] { | ||||||||
| display: flex; | ||||||||
|
|
@@ -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); | ||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||||||||
| border-color: var(--sl-color-text-accent); | ||||||||
| box-shadow: 0 2px 0 var(--sl-color-text-accent); | ||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
| font-weight: 600; | ||||||||
| } | ||||||||
|
|
||||||||
|
|
||||||||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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: