Skip to content

Make the Rustdoc Sidebar hideable, even on larger viewports #97306

Closed
@VincentWo

Description

@VincentWo

I often open the RustDoc Documentation of a crate on the left and my own code on the right. Since I don't have the biggest screen this means that a lot of the code is hard to read and requires scrolling:
A screenshot of a RustDoc Page, showing that the size of the sidebar on the left forces the code on the right to have horizontal scroll
I propose to show a button, similar as on the smaller viewports, that allows hiding the sidebar, which would turn this into:
A screenshot showing the rustdoc page without the sidebar, not forcing the code to horizontal scroll
This makes the code and the docs in general much more readable and reduces visual clutter on smaller screens.

I think that it would be an improvement to also allow the hiding of the sidebar on bigger screens, though I also could understand the argument to hide the control on even bigger screens.

I am aware of #59829 and hope that the additional control that is proposed here does not add even more visual clutter, I am not an expert in this topic, I can just say that as a Person with ADHD (not dyslexia) the hidden sidebar makes the documentation much easier to digest, but I can't speak for other people. Maybe @lambda could be so kind to comment on this.

I can also create a Mockup, I just wanted to check first whether this is even an idea worth discussing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-rustdoc-uiArea: Rustdoc UI (generated HTML)C-feature-requestCategory: A feature request, i.e: not implemented / a PR.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions