Repository navigation
fix(api-reference): align sidebar and content gutter with docs pages - #1301
Merged
Merged
Conversation
The API Reference forced `.docs-layout` padding-left to 0 and `.docs-inner` to full width on every page, so its sidebar sat flush against the viewport edge instead of under the header logo, and the content column was centered with auto margins, leaving a large gap after the sidebar on content-only pages (e.g. /docs/api Overview). - Drop the padding-left override so the sidebar uses the docs gutter. - Left-align `.docs-content` (no auto margins); with auto margins it also sized to its content and overlapped the right rail at ~1600-2000px. - Keep `.docs-inner` full width only on endpoint pages with the right rail (`has-rail`); content-only pages use the docs cap and centering, so the sidebar-to-content gap matches the docs pages. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem
On https://open.longbridge.com/docs/api the left menu sits flush against the viewport edge, unlike the docs pages where it lines up under the header logo. After fixing that, content-only API pages (e.g. Overview) also showed a large gap between the sidebar and the content, and a different gap than the docs pages on wide screens.
Cause, in
packages/api-reference/src/api-reference.css(added in #1257):.docs-layout { padding-left: 0 }overrode the docs gutter that aligns the sidebar with the logo..docs-content { margin-inline: auto }centered the column in the remaining width. With only auto margins the column also sized to its content and could overlap the right rail..docs-inner { max-width: none; margin: 0 }applied to every page, so content-only pages lost the docs 80rem cap + centering that sets the sidebar-to-content gap on wide screens.Change
padding-left: 0override; the sidebar uses the docs.docs-layoutgutter..docs-content: keepmax-width: 52rem, drop the auto margins (left-aligned after the sidebar, like docs)..docs-innergoes full width only when the right rail is shown (has-rail, set from a singlehasRailvalue inApiReference.tsx); content-only pages keep the docs cap and centering.Verification (local dev server, measured in the browser)
/docs(docs)/docs/api/docs(docs)/docs/api/docs/api/list_news(rail)Also checked 1601 / 1700 / 1920 (rail inline, 32px gap, no overlap), 1280 (rail as drawer) and 375 (sidebar drawer, no horizontal scroll). Light/dark not checked (no color changes).
Trade-off: between ~1601px and ~2088px, endpoint pages with the inline rail have a narrower content column than before (e.g. 588px at 1601px), because the sidebar now has its docs gutter. Raising the inline-rail breakpoint above 1600px would avoid that but changes the rail interaction, so it is left as is.
🤖 Generated with Claude Code