Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
camelid opened this issue Oct 27, 2021 · 2 comments
Open

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

camelid opened this issue Oct 27, 2021 · 2 comments
Labels
A-rustdoc-ui Area: Rustdoc UI (generated HTML) T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@camelid
Copy link
Member

camelid commented Oct 27, 2021

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

@camelid camelid added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. A-rustdoc-ui Area: Rustdoc UI (generated HTML) labels Oct 27, 2021
@jsha
Copy link
Contributor

jsha commented Oct 27, 2021

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
Copy link
Member Author

camelid commented Oct 27, 2021

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
Labels
A-rustdoc-ui Area: Rustdoc UI (generated HTML) T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants