Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
x/pkgsite: allow hiding of left menu #42487
It looks like there are CSS rules to automatically close the menu (rather, open the menu since mobile is default), I think this is the relevant breakpoint: https://github.com/golang/pkgsite/blob/master/content/static/css/sidenav.css#L97
My guess is that your half-screen size is probably not small enough to trigger the breakpoint. Might be worth mentioning your screen size + resolution.
So far, the paths I see is that the breakpoint could be adjusted or a toggle be implemented. I'd be happy to help with this issue once a resolution has been made.
Outer window size:
Inner window size:
I usually use chromium on my laptop with 110% and 125% zoom levels and it is very irritating to scroll code snippets..
110% zoom level:
125% zoom level:
Toggle is a great idea !
I think supporting a user option to hide the left-hand menu is a good idea. That menu is designed to support faster navigation when screen size permits, but if our heuristic isn't 100% accurate, a user-controlled fallback makes sense.
One additional option to consider is whether we'd be able to detect overflow in the code blocks and automatically hide/minimize the nav menu when that happens (assuming we can also add line breaks to abnormally long lines, otherwise some packages might always have this menu hidden).