fix: center paper theme content relative to viewport#91
Conversation
Content now centers to full viewport width using negative margin to offset the sidebar. Reader mode toggle no longer causes content shift. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe paper theme's layout system is updated to handle sidebar visibility and reader mode. Content now applies a negative left margin offset that is conditionally removed when the sidebar is hidden. The main container max-width is simplified to a fixed value and reader-mode-specific styling is removed from the main element. ChangesPaper Theme Layout and Sizing Adjustments
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Issues
-
Negative margin causes content to overlap the sidebar —
margin-left: calc(-1 * var(--paper-sidebar-width))shifts the content area left by the sidebar width, which centers it relative to the viewport. But this means the content's left edge now sits under the sidebar. The sidebar hasposition: stickybut noz-index, so the content may visually bleed through or overlap on certain scroll positions. Addz-index: 1(or similar) to.sidebarto ensure it always paints above the content area. -
Responsive breakpoints — The sidebar is likely hidden on small screens (the CSS has no
@mediaqueries shown in the diff, but theshowSidebarlogic handles it). When the sidebar is hidden,contentFullclass removes the negative margin — good. But if there's a breakpoint where the sidebar is conditionally hidden via CSS (not just React state), the negative margin would still apply even when the sidebar isn't visible, pushing content off-screen to the left. Verify there are no CSS-only responsive sidebar hides. -
max-width: 1024pxwithout padding — The old code hadmax-width: calc(1024px + var(--rs-space-17))withpadding-right: var(--rs-space-17), giving an effective content width of 1024px with right padding for breathing room. The new code setsmax-width: 1024pxwith no horizontal padding at all. On viewports close to 1024px + sidebar width, the content will touch the edges. Consider adding symmetric horizontal padding (padding: 0 var(--rs-space-7)) to the.maincontainer, or the content may feel cramped.
Looks good overall — the approach is right, just verify the z-index stacking and edge-case viewport widths.
Summary
Test plan
🤖 Generated with Claude Code