Skip to content

Commit

Permalink
Fix image position and display
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Apr 29, 2019
1 parent 184e3a3 commit 9db0fd7
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
6 changes: 2 additions & 4 deletions src/librustdoc/html/layout.rs
Expand Up @@ -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)
}
Expand Down
26 changes: 20 additions & 6 deletions src/librustdoc/html/static/rustdoc.css
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 9db0fd7

Please sign in to comment.