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

Harmonize colors for prose headings #90245

Open
jsha opened this issue Oct 24, 2021 · 9 comments
Open

Harmonize colors for prose headings #90245

jsha opened this issue Oct 24, 2021 · 9 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

@jsha
Copy link
Contributor

jsha commented Oct 24, 2021

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.

@jsha jsha 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 24, 2021
@camelid
Copy link
Member

camelid commented Oct 24, 2021

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 #59851 (comment).

@GuillaumeGomez
Copy link
Member

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
Copy link
Contributor

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

@Manishearth
Copy link
Member

Manishearth commented Oct 25, 2021

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

jsha commented Oct 31, 2021

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

jyn514 commented Oct 31, 2021

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

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

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

camelid commented Oct 31, 2021

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.

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Dec 8, 2021
Make rustdoc headings black, and markdown blue

Demo:

https://rustdoc.crud.net/jsha/heading-color/std/string/index.html#structs
https://rustdoc.crud.net/jsha/heading-color/std/string/struct.String.html#examples

Fixes rust-lang#91304

r? `@camelid` /cc `@GuillaumeGomez`

(Note: we may want to make rustdoc headings and markdown headings the same color -- rust-lang#90245 -- but we would want to do that intentionally; this is fixing up a change that did so accidentally)
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Dec 8, 2021
Make rustdoc headings black, and markdown blue

Demo:

https://rustdoc.crud.net/jsha/heading-color/std/string/index.html#structs
https://rustdoc.crud.net/jsha/heading-color/std/string/struct.String.html#examples

Fixes rust-lang#91304

r? ``@camelid`` /cc ``@GuillaumeGomez``

(Note: we may want to make rustdoc headings and markdown headings the same color -- rust-lang#90245 -- but we would want to do that intentionally; this is fixing up a change that did so accidentally)
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Dec 8, 2021
Make rustdoc headings black, and markdown blue

Demo:

https://rustdoc.crud.net/jsha/heading-color/std/string/index.html#structs
https://rustdoc.crud.net/jsha/heading-color/std/string/struct.String.html#examples

Fixes rust-lang#91304

r? ```@camelid``` /cc ```@GuillaumeGomez```

(Note: we may want to make rustdoc headings and markdown headings the same color -- rust-lang#90245 -- but we would want to do that intentionally; this is fixing up a change that did so accidentally)
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

Successfully merging a pull request may close this issue.

6 participants