style(theme/Tabs): add default padding to tab panels and support nested tabs#3217
Merged
style(theme/Tabs): add default padding to tab panels and support nested tabs#3217
Conversation
Contributor
Rsdoctor Bundle Diff AnalysisFound 3 projects in monorepo, 1 project with changes. 📊 Quick Summary
📋 Detailed Reports (Click to expand)📁 webPath:
📦 Download Diff Report: web Bundle Diff Generated by Rsdoctor GitHub Action |
Deploying rspress-v2 with
|
| Latest commit: |
9133539
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://950c0afb.rspress-v2.pages.dev |
| Branch Preview URL: | https://syt-vibe-kanban-ccf2-tab-cod.rspress-v2.pages.dev |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts the theme styling for the Tabs component to improve spacing inside tab panels, especially for content that expects consistent gaps (per issue #3194), while special-casing the “single CodeBlock only” scenario to avoid double padding.
Changes:
- Remove
box-shadowfromCodeBlockwhen rendered insideTabs. - Add horizontal padding to each tab panel and enforce top/bottom spacing for the panel’s first/last child.
- Use
:has(> .rp-codeblock:only-child)to remove the panel padding when the panel contains exactly oneCodeBlock.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
0310a14 to
ce0053d
Compare
Timeless0911
approved these changes
Mar 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
source:
before
after
Related Issue
Tab/Tabscomponent doesn't look great for content expecting gaps #3194Checklist
AI Summary
What changed
0 1rem) and vertical margin (1rem) to.rp-tabs__content__itemso that non-codeblock tab content has proper spacing.:has(> .rp-codeblock:only-child)to detect when a tab panel contains only a single CodeBlock, and removes the panel padding in that case to avoid double padding.box-shadow: noneto.rp-tabs .rp-codeblockto fully reset CodeBlock's standalone visual styles when nested inside Tabs (previouslymargin,border-radius, andborderwere reset butbox-shadowwas missed).Why
When Tab panels had no default padding, non-codeblock content was flush against the edges. But simply adding padding caused double spacing when the tab content was a single CodeBlock (since CodeBlock has its own internal padding). The
:has()CSS pseudo-class cleanly solves this without any React runtime changes.This PR was written using Vibe Kanban