-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Improve rustdoc layout #91356
Improve rustdoc layout #91356
Conversation
Some changes occurred in HTML/CSS/JS. |
I also renamed the |
This comment has been minimized.
This comment has been minimized.
633af0a
to
5fa8d88
Compare
5fa8d88
to
980f90e
Compare
I fixed the issue and updated the online docs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking great! A few small nits and some naming discussion:
I find the hierarchy main > .main-inner > #main-content
confusing; I would have expected main-inner
to be the innermost. The primary function of .main-inner
seems to be a place to hang max-width: 960px
(for doc pages) or max-width: unset
(for source pages). Maybe we can call it more precisely .width-limiter
or something?
@@ -248,6 +247,32 @@ textarea { | |||
|
|||
/* end tweaks for normalize.css 8 */ | |||
|
|||
.rustdoc { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our <body>
tag always has the .rustdoc
class, and the .rustdoc
class is (AFAICT) only on the <body>
tag. I think it would be clearer to attach these styles to the existing body
rules.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually we can't because of docs.rs. :-/
overflow-y: auto; | ||
width: 300px !important; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm pretty sure !important
is not needed here and should be removed (https://csswizardry.com/2012/11/code-smells-in-css/).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just checked and you're right, so removed.
padding-top: 0px; | ||
} | ||
|
||
.rustdoc { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As above this rule should go on body
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same answer as above. :-/
@@ -1678,7 +1768,7 @@ details.rustdoc-toggle[open] > summary.hideme::after { | |||
padding: 0; | |||
} | |||
|
|||
.sidebar .logo-container { | |||
.rustdoc:not(.source) .sidebar .logo-container { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seeing a bunch of not()
selectors usually hints that we're missing some positive class that would be useful. For instance it looks like it would be useful to add a doc
class to the body tag whenever we're not in source view. But I don't feel that's required as part of this PR.
980f90e
to
d7528e2
Compare
Agreed, I added a commit for the renaming. I also updated the files on the server so you can check too. :) |
@bors r+ rollup |
📌 Commit d7528e2 has been approved by |
☀️ Test successful - checks-actions |
Finished benchmarking commit (e2116ac): comparison url. Summary: This change led to large relevant regressions 😿 in compiler performance.
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression |
There is basically no change in the rust source code so this is spurious. @rustbot label: -perf-regression |
This is an overtake of #89385 originally written by @cynecx.
I kept the original commit and simply added the missing fixes into a new one. You can test it online here.
r? @jsha