Skip to content

Conversation

@LeoMcA
Copy link
Member

@LeoMcA LeoMcA commented Dec 10, 2025

Initially a fix for #690 (comment), increasing the gap between content and the sidebar content by 1rem, but I ended up noticing more bugs and wanting to fix them wholesale with a unified approach to how we do our 2 sidebar layout across docs, curriculum and generic content.

Commits are atomic, and some have lengthy explanations in their commit message: I'd recommend reviewing one by one.

Fixes these issues:

  • partial fix for The visual density of the newly released design is now so high that it's too hard read #690 (comment): increasing gap between sidebar and content by 1rem
  • fix for Left sidebar scrollbar overlaps headings anchor icon #593: left sidebar no longer sets negative margin into content
  • fix for an issue where just above our mobile breakpoint the top placement would still be shown, breaking the toggleable sidebar overlay
  • partial reversion of dff52a5, fixing this issue instead by:
    • allowing the left sidebar to show items in the minimum page margin on the left
    • showing the outline on each sidebar inset
  • fixes the right sidebar scrollbar appearing offset from the page scrollbar
  • fixes docs, curriculum and generic content using the 2 sidebar layout in subtly different ways requiring updates in multiple places to increase the padding between sidebar and content everywhere

If we like this approach, we should probably migrate all the other layouts using the variables to a class-based system, but it felt like I'd got to a coherent and consistent place with this so stopped here.

add --layout-sidebar-padding variable for padding between sidebar
content and document content, so the scrollbar isn't pushed up against
the content

this removes my ugly hack from before where I set a negative right
margin on the left sidebar, which caused it to overlay the heading
anchor links

sets --layout-sidebar-padding to 1rem to make the gap between sidebar
content and document content 3rem

increases --layout-sidebar-min by 1rem so sidebars content doesn't get
any narrower

absorbs the --layout-side-padding-min padding into the left of the left
sidebar to avoid 2px padding for focus outlines and give us greater
flexibility with the sidebar layout in the future

does the same on the right of the right sidebar to align the right
sidebar scrollbar with the right of the screen on smaller displays
move them up to .reference-layout__sidebar
…from 2-sidebars

committed with --no-verify to make diffs almost inverse of each other
.layout__2-sidebars for when the right sidebar is to be hidden on mobile

.layout__2-sidebars-inline for when the right sidebar is to be put
between content header and body on mobile
otherwise we can't consistently position the overlayed sidebar: scroll
to top of page, resize page width to 790px and toggle sidebar to repro

keeping both media queries because --screen-layout-no-sidebar may change
to be smaller than --screen-small-and-narrower in the future again (we
don't want to have to go update other files as we change our min content
and sidebar sizes and paddings)
urls for testing each renderer:
CurriculumAbout: http://localhost:3000/en-US/curriculum/about-curriculum/
CurriculumDefault: http://localhost:3000/en-US/curriculum/faq/
CurriculumModule: http://localhost:3000/en-US/curriculum/getting-started/soft-skills/
CurriculumOverview: http://localhost:3000/en-US/curriculum/getting-started/
@LeoMcA LeoMcA requested a review from a team as a code owner December 10, 2025 18:45
@LeoMcA LeoMcA requested review from argl and caugner and removed request for argl December 10, 2025 18:45
@github-actions
Copy link
Contributor

8d357e9 was deployed to: https://fred-pr1154.review.mdn.allizom.net/

@LeoMcA
Copy link
Member Author

LeoMcA commented Dec 10, 2025

@Rumyra this PR increases the gap between sidebar and content by 1rem:

before:

Screen Shot 2025-12-10 at 18 57 22

vs after:

Screen Shot 2025-12-10 at 18 57 26

I'd recommend viewing the images fullscreen, or following the links to the pages themselves. It's easy to increase the gap by even more if you want: modify --layout-sidebar-gap in devtools and see what looks good.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant