rustdoc: Larger click areas for sidebar items
* Change links to display:block for click larger targets * Remove linebreaks due to extra space * Adjust margins so that element spacing stays the same * Sidebar item hover background colour chosen from <pre> styling
This commit is contained in:
parent
e7f11f20e5
commit
0188bebbb7
3 changed files with 9 additions and 6 deletions
|
@ -2001,7 +2001,7 @@ impl<'a> fmt::Show for Sidebar<'a> {
|
|||
let class = if cur.name.get_ref() == item &&
|
||||
short == curty { "current" } else { "" };
|
||||
try!(write!(w, "<a class='{ty} {class}' href='{href}{path}'>\
|
||||
{name}</a><br/>",
|
||||
{name}</a>",
|
||||
ty = short,
|
||||
class = class,
|
||||
href = if curty == "mod" {"../"} else {""},
|
||||
|
|
|
@ -154,25 +154,29 @@ nav.sub {
|
|||
|
||||
.block {
|
||||
padding: 0 10px;
|
||||
margin-bottom: 10px;
|
||||
margin-bottom: 14px;
|
||||
}
|
||||
.block h2 {
|
||||
margin-top: 0;
|
||||
margin-bottom: 8px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.block a {
|
||||
display: inline-block;
|
||||
display: block;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
line-height: 15px;
|
||||
padding-left: 5px;
|
||||
padding-bottom: 6px;
|
||||
padding: 7px 5px;
|
||||
font-size: 14px;
|
||||
font-weight: 300;
|
||||
transition: border 500ms ease-out;
|
||||
}
|
||||
|
||||
.block a:hover {
|
||||
background: #F5F5F5;
|
||||
}
|
||||
|
||||
.content {
|
||||
padding: 15px 0;
|
||||
}
|
||||
|
|
|
@ -647,7 +647,6 @@
|
|||
}
|
||||
div.append($('<a>', {'href': '../' + crates[i] + '/index.html',
|
||||
'class': klass}).text(crates[i]));
|
||||
div.append($('<br>'));
|
||||
}
|
||||
sidebar.append(div);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue