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

Fix footer positionning #1383

Merged
merged 1 commit into from
Apr 29, 2021
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
30 changes: 22 additions & 8 deletions templates/style/rustdoc.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
@import "vars", "navbar", "themes", "fa", "footer";

// This rule is needed to be sure that the footer will always be at the bottom of the page.
body.rustdoc-page {
min-height: 100vh;
#rustdoc_body_wrapper {
min-height: calc(100vh - #{$top-navbar-height + $footer-height + 2});
}

// Force the navbar to be left-aligned on rustdoc pages
Expand All @@ -15,30 +15,34 @@ div.container-rustdoc {
text-align: left;

> .docs-rs-footer {
bottom: -20px;
bottom: -32px;
right: -15px;
width: unset;
}
}

div.container-rustdoc {
width: unset;
}

div.container-rustdoc:not(.source) {
> .docs-rs-footer {
right: -15px;
width: calc(100vw - 212px);
left: 185px; // This is the left sidebar
}

// This is when the rustdoc sidebar "disappears" (for mobile mode).
@media (max-width: 700px) {
> .docs-rs-footer:not(.source) {
width: 100vw;
left: -15px;
}
}
}

div.container-rustdoc.source {
> .docs-rs-footer {
width: 100vw;
left: -15px;
// This is needed because even though the sidebar only contains the header, it still takes
// all the height.
// all the height, going over the footer.
z-index: 1;
}
}
Expand Down Expand Up @@ -110,4 +114,14 @@ div.rustdoc {
&:focus {
outline: unset;
}

// Overriding some outdated rustdoc CSS rules
#results {
position: initial !important;
overflow: initial !important;

> table {
margin-bottom: 0 !important;
}
}
}