Skip to content

rustdoc: make [-] invisible in most cases #85372

Open
@jsha

Description

The toggles ([-] / [+]) on rustdoc pages are needed for a couple of reasons:

  • Some sections are closed by default and need a [+] to open them.
  • Some sections are open by default, but can be default-closed by a setting. Those need a [+] to open them.
  • The user might close all sections with the "collapse all docs" button. Those need a [+] to open them.

Note that these all involve the [+], not the [-]. But we show lots of [-] all over the page, which is visually distracting. In theory these allow users to collapse a single section at a time, but I don't think that's very useful.

I propose that we make [-] invisible. With one exception: If someone has opened a section with [+], it would be confusing and frustrating to not be able to close that section again. So, when someone clicks a [+], we would added a "perma-visible" class to that <summary> tag, which would cause the [-] to be visible.

cc @GuillaumeGomez

Metadata

Assignees

No one assigned

    Labels

    A-rustdoc-jsArea: Rustdoc's JS front-endA-rustdoc-uiArea: Rustdoc UI (generated HTML)C-enhancementCategory: An issue proposing an enhancement or a PR with one.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