Skip to content

rustdoc: Header color has regressed #91304

New issue

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

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

Already on GitHub? # to your account

Closed
camelid opened this issue Nov 28, 2021 · 4 comments · Fixed by #91534
Closed

rustdoc: Header color has regressed #91304

camelid opened this issue Nov 28, 2021 · 4 comments · Fixed by #91534
Assignees
Labels
A-rustdoc-ui Area: Rustdoc UI (generated HTML) C-bug Category: This is a bug. P-medium Medium priority regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Milestone

Comments

@camelid
Copy link
Member

camelid commented Nov 28, 2021

They used to be blue and are now black. I don't think this change was intentional, although we have been thinking about migrating more headers to be black recently. I think this regressed very recently, since I probably would have noticed it otherwise.

image

@camelid camelid added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. C-bug Category: This is a bug. A-rustdoc-ui Area: Rustdoc UI (generated HTML) labels Nov 28, 2021
@rustbot rustbot added the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Nov 28, 2021
@camelid
Copy link
Member Author

camelid commented Nov 28, 2021

I wonder if this was caused by #91062 or #91223? Those were both merged recently, though the second one doesn't seem like it could have changed colors.

cc @jsha @GuillaumeGomez

@jsha
Copy link
Contributor

jsha commented Nov 28, 2021

This regressed in #91179, which added .section-header a as one of the rules for an anchor to be styled black.

The goal with that change was to make the section headings on module pages black (e.g. https://doc.rust-lang.org/nightly/std/index.html#macros). Those have class="section-header". However, headings generated from Markdown in a docblock also have class="section-header".

I think the right short-term fix is:

  • Section headings on module pages get class="small-section-header", like their peers on other pages.
  • Remove the CSS rule for .section-header a to be black.

It's not really clear to me why Markdown gets section-header, and Rustdoc-generated headings get small-section-header, particularly given that the Rustdoc headings are almost always bigger. Probably we should rename these to docblock-prose-heading and rustdoc-prose-heading.

@camelid
Copy link
Member Author

camelid commented Nov 30, 2021

@jsha Since you figured out a way to fix this regression, do you want to assign yourself and open a PR with the fix?

@jsha jsha self-assigned this Dec 2, 2021
@jsha
Copy link
Contributor

jsha commented Dec 2, 2021

Will do.

@camelid camelid added this to the 1.58.0 milestone Dec 3, 2021
@camelid camelid added regression-from-stable-to-beta Performance or correctness regression from stable to beta. and removed regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. labels Dec 3, 2021
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)
@bors bors closed this as completed in d748c1d Dec 9, 2021
@camelid camelid added P-medium Medium priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Dec 9, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-rustdoc-ui Area: Rustdoc UI (generated HTML) C-bug Category: This is a bug. P-medium Medium priority regression-from-stable-to-beta Performance or correctness regression from stable to beta. 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.

3 participants