Skip to content
Permalink
Browse files

Fix image position and display

  • Loading branch information...
GuillaumeGomez committed Apr 29, 2019
1 parent 184e3a3 commit 9db0fd7fd6a09969c3f3a0018599cef9e12b4ba9
Showing with 22 additions and 10 deletions.
  1. +2 −4 src/librustdoc/html/layout.rs
  2. +20 −6 src/librustdoc/html/static/rustdoc.css
@@ -183,15 +183,13 @@ pub fn render<T: fmt::Display, S: fmt::Display>(
if layout.logo.is_empty() {
format!("<a href='{path}index.html'>\
<div class='logo-container'>\
<img src='{static_root_path}rust-logo{suffix}.png' \
alt='logo' width='100'></div></a>",
<img src='{static_root_path}rust-logo{suffix}.png' alt='logo'></div></a>",
path=p,
static_root_path=static_root_path,
suffix=page.resource_suffix)
} else {
format!("<a href='{}index.html'>\
<div class='logo-container'>\
<img src='{}' alt='logo' width='100'></div></a>",
<div class='logo-container'><img src='{}' alt='logo'></div></a>",
p,
layout.logo)
}
@@ -183,16 +183,24 @@ nav.sub {
}

.logo-container {
height: 0;
padding-bottom: 50%;
}

.sidebar img {
height: 100px;
width: 100px;
position: relative;
margin: 20px auto;
display: block;
margin-top: 10px;
}

.logo-container > img {
max-width: 100px;
max-height: 100px;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
display: block;
}

.sidebar .location {
border: 1px solid;
font-size: 17px;
@@ -1035,14 +1043,20 @@ span.since {
padding: 0;
}

.sidebar img {
.sidebar .logo-container {
width: 35px;
height: 35px;
margin-top: 5px;
margin-bottom: 5px;
float: left;
margin-left: 50px;
}

.sidebar .logo-container > img {
max-width: 35px;
max-height: 35px;
}

.sidebar-menu {
position: fixed;
z-index: 10;

0 comments on commit 9db0fd7

Please sign in to comment.
You can’t perform that action at this time.