1
Fork 0

Explicitly set height on rust logo <img> element in docs

The layout of the left side menu in docs reflows when navigating between pages because of missing height on the <img> element of rust logo.

Setting height='100' tells the browser to reserve that vertical space, leading to a less janky experience.
This commit is contained in:
Jakob Ståhl 2019-04-25 19:06:04 +02:00 committed by Guillaume Gomez
parent 1b6caa7cd6
commit 5a3625d426

View file

@ -183,13 +183,13 @@ pub fn render<T: fmt::Display, S: fmt::Display>(
if layout.logo.is_empty() { if layout.logo.is_empty() {
format!("<a href='{path}index.html'>\ format!("<a href='{path}index.html'>\
<img src='{static_root_path}rust-logo{suffix}.png' \ <img src='{static_root_path}rust-logo{suffix}.png' \
alt='logo' width='100'></a>", alt='logo' width='100' height='100'></a>",
path=p, path=p,
static_root_path=static_root_path, static_root_path=static_root_path,
suffix=page.resource_suffix) suffix=page.resource_suffix)
} else { } else {
format!("<a href='{}index.html'>\ format!("<a href='{}index.html'>\
<img src='{}' alt='logo' width='100'></a>", <img src='{}' alt='logo' width='100' height='100'></a>",
p, p,
layout.logo) layout.logo)
} }