Skip to content

rustdoc: Increased impl header size makes section icon cramped #90331

Open
@camelid

Description

@camelid
Member

Also, the increased font size looks a little too big for the trait impls section, since there are a lot of impls and their items are not expanded by default. The new font size looks good for inherent impls though, since the items cause the headers to be spaced apart.

Before

image

After

image

cc #90155
cc @jsha @GuillaumeGomez

Activity

added
T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.
A-rustdoc-uiArea: Rustdoc UI (generated HTML)
on Oct 27, 2021
jsha

jsha commented on Oct 27, 2021

@jsha
Contributor

I agree the section icon looks cramped now. It's not because of the font size, though: It's because previously the impl had a 15px indent, which I removed in #90155 for two reasons: the size of the indent was inconsistent (should have been 24px like other indents), and having an indent at all under an underlined prose header is inconsistent with what we do in other places, e.g.:

Also contributing to crampedness is the presence of the [+].

One possible quick fix would be to re-indent the impls but do it by 24px this time. Another fix would be to move the [+] further left into the gutter. That would probably make it look more awkward though. At a fundamental level, the [+] and § are competing for space: both want to be immediately to the left of a heading.

Another possibility would be to remove the § for impls. It's already the case that methods don't have §. See for instance https://doc.rust-lang.org/nightly/std/string/struct.String.html#method.new - the method name (like new) serves as the click target. If we could pick something within impl (or the whole impl heading) to be the click target, we could omit the §.

camelid

camelid commented on Oct 27, 2021

@camelid
MemberAuthor

One possible quick fix would be to re-indent the impls but do it by 24px this time.

Yeah, I also thought of that, but it's possible it'll look funny. We could definitely try it though.

At a fundamental level, the [+] and § are competing for space: both want to be immediately to the left of a heading.

Agreed, that "competition" unfortunately adds more UI clutter.

If we could pick something within impl (or the whole impl heading) to be the click target, we could omit the §.

The problem with making the whole heading be the click target is that there are already links within the header. I think it'd be confusing and might not even be valid HTML.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-rustdoc-uiArea: Rustdoc UI (generated HTML)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

        Participants

        @jsha@camelid

        Issue actions

          rustdoc: Increased impl header size makes section icon cramped · Issue #90331 · rust-lang/rust