rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
96.63k stars 12.49k forks source link

Harmonize colors for prose headings #90245

Open jsha opened 2 years ago

jsha commented 2 years ago

Right now we have two kinds of prose headings in Rustdoc. Those generated from author-written Markdown:

image

And those generated by Rustdoc itself:

image

The former are hyperlinks (to themselves), and so get a blue color. The latter are not hyperlinks, and so are black.

We should make the Rustdoc-generated prose headings also be hyperlinks to themselves, since the heading provides a larger click target than the §. We should also decide whether we want headings to be blue or black (I have a slight preference for black). Thoughts @rust-lang/rustdoc?

One other possibility would be that we want to preserve the color distinction between author-generated headings and Rustdoc-generated headings. However, as pointed out in #59829, the more things we use colors to distinguish, the harder it is to get people's attention on distinctions that really matter.

camelid commented 2 years ago

I also have been thinking about making the prose headings black. I think it'd make the docs nicer to read. FYI, there's an intriguing mockup from a couple of years ago in https://github.com/rust-lang/rust/issues/59851#issuecomment-488976397.

GuillaumeGomez commented 2 years ago

I like that the prose headings have a different color because it makes the reading simpler by making it obvious it's a new section in the doc comment.

I completely agree to make them into hyperlink to themselves though.

CraftSpider commented 2 years ago

My personal preference is consistently black headers, I think it looks nicer.

Manishearth commented 2 years ago

I feel like in the case of header hyperlinks they don't even need to be blue, the hover-§ should be enough to indicate linkiness (and people know to expect that headers are linkable)

I don't feel a particularly strong need for people to be able to tell the difference between user headers and rustdoc headers.

jsha commented 2 years ago

Looks like we have 4 team members in favor of making author headings black, like rustdoc headings, and unanimous agreement on making the rustdoc headings hyperlinked. @GuillaumeGomez do you want to make a stronger case for author headings remaining blue? Are you okay going along with turning them black? /cc @rust-lang/rustdoc just to make sure we get input from everyone.

jyn514 commented 2 years ago

I don't have a strong opinion here, black seems fine. Not sure why it's important to get feedback from everyone tbh, but if you do think it's important we should do an FCP on the PR which makes it easier to keep track and gives us a reference implementation so we know how it looks. Doing it on the issue seems confusing.

GuillaumeGomez commented 2 years ago

As long as there is a way to easily spot a heading (keeping the § for example?), I'm fine with it. Simply that colours made it simpler to spot, but if I'm only one thinking this way, then I guess I'm in the wrong. :)

Manishearth commented 2 years ago

I honestly think the section symbol should only be on hover as well: I don't see a strong reason to maintain a visual distinction there at all

camelid commented 2 years ago

if you do think it's important we should do an FCP on the PR which makes it easier to keep track and gives us a reference implementation so we know how it looks. Doing it on the issue seems confusing.

Yeah, I agree. It's helpful to get some informal feedback now, but it could be useful to do an FCP on the PR as well.