Skip to content

fix(docs): align sidebar content vertically#1092

Open
PARTH-TUSSLE wants to merge 1 commit into
layer5io:masterfrom
PARTH-TUSSLE:docs/sidebar-alignment-1080
Open

fix(docs): align sidebar content vertically#1092
PARTH-TUSSLE wants to merge 1 commit into
layer5io:masterfrom
PARTH-TUSSLE:docs/sidebar-alignment-1080

Conversation

@PARTH-TUSSLE
Copy link
Copy Markdown
Contributor

@PARTH-TUSSLE PARTH-TUSSLE commented Jun 7, 2026

Notes for Reviewers

Adjusted the sidebar spacing to align the content in the left and right sidebars more consistently.
This resolves the visual asymmetry where the left sidebar content started lower than the right sidebar content.

Preview of the fix :-
image

This PR fixes #1080

Signed commits

  • [✅] Yes, I signed my commits.

Signed-off-by: PARTH-TUSSLE <parthgartan26feb@gmail.com>
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the top padding of a sticky container in assets/scss/_styles_project.scss from 1rem to 2.15rem. The reviewer raised valid concerns regarding the use of a hardcoded magic number, which is fragile and could cause misalignment. Additionally, the reviewer pointed out potential layout issues on mobile devices where other sidebars reset their padding, and suggested using a shared SCSS variable or CSS custom property along with appropriate mobile overrides.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

position: sticky;
top: 5.5rem;
padding-top: 1rem;
padding-top: 2.15rem;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using a hardcoded magic number like 2.15rem for vertical alignment is fragile and hard to maintain. It couples the right sidebar's top padding to the current visual height of the left sidebar's elements (like the search bar). If those elements change in height, the sidebars will become misaligned again.

Additionally, on mobile screens (max-width: 767px), the body padding-top is reset to 0 (line 830) and the left sidebar .td-sidebar resets its padding-top to 0 (line 260). However, .td-sidebar-toc does not have a mobile override, meaning it will retain padding-top: 2.15rem and top: 5.5rem on mobile devices supporting position: sticky.

Recommendation:

  1. Use a shared SCSS variable or CSS custom property (e.g., --sidebar-top-alignment) to keep these values synchronized.
  2. Ensure that .td-sidebar-toc padding and sticky positioning are appropriately reset or adjusted for mobile screens (max-width: 767px/768px) to match the left sidebar behavior.
Suggested change
padding-top: 2.15rem;
padding-top: 2.15rem; // Aligns vertically with the left sidebar content

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 7, 2026

🚀 Preview deployment: https://layer5io.github.io/docs/pr-preview/pr-1092/

Note: Preview may take a moment (GitHub Pages deployment in progress). Please wait and refresh. Track deployment here

@Bhumikagarggg
Copy link
Copy Markdown
Contributor

@PARTH-TUSSLE Thank you for your contribution! Let's discuss this during the website call tomorrow at 5:30 PM IST | 7 AM CST Add it as an agenda item to the meeting minutes, if you would 🙂

Copy link
Copy Markdown
Contributor

@Bharath314 Bharath314 Jun 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that you have increased the padding of the right sidebar. Wouldn't that create more ugly whitespace though? What do you think about reducing the spacing on the left side instead?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, on it 🫡

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[UI] Content in Left Sidebar is lower than content in right sidebar

3 participants