fix: stack sidebar footer as a row in production builds - #180
Merged
Conversation
The default theme's sidebar footer sets its row layout in a CSS module, but Apsara's `Sidebar.Footer` renders a `Flex` with `direction='column'`. Both are single-class selectors with equal specificity, so the winner is decided by stylesheet order. Vite injects each CSS module as its own style tag in dev, where the theme's module lands after Apsara's and wins. The production bundle concatenates everything in chunk-graph order, which puts Apsara's flex utilities after the theme module — so the tie flips and the footer renders as a column. The version switcher and links menu ended up on separate lines, only in built sites. Set the layout through `Sidebar.Footer`'s Flex props instead. Apsara spreads `...props` after its own `direction`, so the correct utility classes are emitted and there is no cascade to lose. The overridden declarations are dropped from the CSS module, leaving it the styling Apsara does not set. Also give the mobile menu's static version label the same metrics as a sidebar item. With no `versions` configured, `VersionSwitcher` renders `latest.label` as a bare span, which read as loose text beneath the full-width link rows. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reachedNext included review available in 37 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
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 |
rohanchkrabrty
approved these changes
Sep 1, 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.
The bug
In the default theme, the sidebar footer's version switcher and links menu render on separate lines instead of opposite ends of one row. Visible on built sites only — example.
Why it passed review
It doesn't reproduce in
dev. Same code, same machine:flex-directionalign-itemsjustify-contentdev:examples:versionedrowcenterspace-betweenbuild:examples:basic+startcolumnstretchflex-start.sidebarFooterdeclares the row layout, but Apsara'sSidebar.Footerrenders aFlexwithdirection='column'. Both are single-class selectors — equal specificity (0,1,0) — so stylesheet order decides.Vite injects each CSS module as its own
<style>tag in dev, where the theme's module lands after Apsara's and wins. The production bundle concatenates in chunk-graph order, putting Apsara'sflex-moduleutilities after the theme module, flipping the tie:Same rule indices in the local prod build and on the deployed site.
The fix
Set the layout through
Sidebar.Footer's Flex props. Apsara spreads...propsafter its owndirection, so the right utility classes are emitted and there's no cascade to lose — immune to bundling order:The four overridden declarations are dropped from the CSS module, which keeps only what Apsara doesn't set (gap, height, padding, border, background).
.trigger { margin-left: auto }stays — it's what right-aligns the?when there's no version switcher sibling.Also: the mobile menu's static version label (rendered when a site has
latest.labelbut noversions:) was a bare span reading as loose text under the full-width link rows. It now matchesSidebar.Itemmetrics. Scoped from the parent by element selector, so the desktop footer keeps its inline treatment andVersionSwitcher.tsxis untouched.Testing
Verified against a production build, not dev:
centerY, version at left (12–29),?at right (230–250)direction-row/align-center/justify-betweenSidebar.Itemdisplay: block,padding: 0Lint (2 warnings) and typecheck (102 errors) both byte-identical to baseline — all pre-existing, none in the touched files.
Note
Every CSS-module-vs-Apsara-utility-class conflict in this repo is invisible in dev and only appears in prod. Preferring component props over CSS overrides avoids the class entirely.
Separately,
build:examples:versionedis broken onmain—[MISSING_EXPORT] "images" is not exported by examples/versioned/versions/v1/dev/index.mdx:27. Unrelated and not fixed here, but that example can't be prod-tested until it is.🤖 Generated with Claude Code