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: clean up sidebar width CSS #104516

Merged
merged 1 commit into from
Nov 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
rustdoc: clean up sidebar width CSS
This commit takes advantage of the ability to set [flex-basis] to a specific
length instead of setting it to `auto` and changing min-/max-width, and
setting flex-grow/-shrink both to 0.

[flex-basis]: https://developer.mozilla.org/en-US/docs/Web/CSS/flex-basis
  • Loading branch information
notriddle committed Nov 17, 2022
commit ebee589bc085f0ac5750369cd4ee4c6a6b49f9dd
13 changes: 4 additions & 9 deletions src/librustdoc/html/static/css/rustdoc.css
Original file line number Diff line number Diff line change
@@ -387,8 +387,7 @@ img {

.sidebar {
font-size: 0.875rem;
width: 200px;
min-width: 200px;
flex: 0 0 200px;
overflow-y: scroll;
position: sticky;
height: 100vh;
@@ -397,12 +396,7 @@ img {
}

.rustdoc.source .sidebar {
width: 50px;
min-width: 0px;
max-width: 300px;
flex-grow: 0;
flex-shrink: 0;
flex-basis: auto;
flex-basis: 50px;
border-right: 1px solid;
overflow-x: hidden;
/* The sidebar is by default hidden */
@@ -423,7 +417,7 @@ img {

.source-sidebar-expanded .source .sidebar {
overflow-y: auto;
width: 300px;
flex-basis: 300px;
}

.source-sidebar-expanded .source .sidebar > *:not(#sidebar-toggle) {
@@ -1702,6 +1696,7 @@ in storage.js
z-index: 11;
/* Reduce height slightly to account for mobile topbar. */
height: calc(100vh - 45px);
width: 200px;
}

/* The source view uses a different design for the sidebar toggle, and doesn't have a topbar,