style: improve sidebar item layout, focus style, and spacing#29078
style: improve sidebar item layout, focus style, and spacing#29078MohamedH1998 merged 14 commits intoproductionfrom
Conversation
|
This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:
|
|
Preview URL: https://3a4d0dd6.preview.developers.cloudflare.com |
|
/bonk please review |
There was a problem hiding this comment.
Reviewed the sidebar styling improvements.
Addressed from ahaywood's review:
- Empty class attribute on line 90 of SidebarSublist.astro - posted inline suggestion
- Dark mode active state visibility - noted the contrast concern from pedrosousa's feedback
Regarding the animation question: The JavaScript animation control (is-user-toggled class) is necessary to prevent CSS transitions from firing on page load when the sidebar state is restored from sessionStorage. CSS alone cannot distinguish between initial state restoration and user-initiated toggles.
Type safety: The flattenSidebar function properly types its parameter as SidebarEntry[], which is correct. The function is used internally and the types flow correctly through the component.
|
Review complete. Posted:
|
Co-authored-by: ask-bonk[bot] <249159057+ask-bonk[bot]@users.noreply.github.com>
* style: header design tweaks * fix: align vertically * style: toc design improvements (#29124) * style: toc design improvements * fix: keyboard nav in feedback form * fix: decrease textarea rows * fix: vertical alignment of the toc * Update src/components/overrides/TableOfContents.astro Co-authored-by: ask-bonk[bot] <249159057+ask-bonk[bot]@users.noreply.github.com> --------- Co-authored-by: ask-bonk[bot] <249159057+ask-bonk[bot]@users.noreply.github.com> --------- Co-authored-by: ask-bonk[bot] <249159057+ask-bonk[bot]@users.noreply.github.com>

Summary
Use the preview branch in style: toc design improvements to view the all the changes in conjunction with another
What changed
focus-visible:outline-blue-500 / dark:focus-visible:outline-blue-400) to sidebar links and group toggles, matching the existing pattern used on the sidebar search input;outline-offset-0keeps the ring flush to the element so it does not overlap adjacent itemspadding-top: 1pxto.sidebar-contentto match thegapvalue, preventing the focus outline on the first sidebar item from being clippedBefore

After

Screen recording
https://github.com/user-attachments/assets/bb3424be-e62c-42fd-8ff5-eb996e33f96d
Screen.Recording.2026-03-19.at.22.37.08.mov