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 &&
|
let class = if cur.name.get_ref() == item &&
|
||||||
short == curty { "current" } else { "" };
|
short == curty { "current" } else { "" };
|
||||||
try!(write!(w, "<a class='{ty} {class}' href='{href}{path}'>\
|
try!(write!(w, "<a class='{ty} {class}' href='{href}{path}'>\
|
||||||
{name}</a><br/>",
|
{name}</a>",
|
||||||
ty = short,
|
ty = short,
|
||||||
class = class,
|
class = class,
|
||||||
href = if curty == "mod" {"../"} else {""},
|
href = if curty == "mod" {"../"} else {""},
|
||||||
|
|
|
@ -154,25 +154,29 @@ nav.sub {
|
||||||
|
|
||||||
.block {
|
.block {
|
||||||
padding: 0 10px;
|
padding: 0 10px;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 14px;
|
||||||
}
|
}
|
||||||
.block h2 {
|
.block h2 {
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
|
margin-bottom: 8px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.block a {
|
.block a {
|
||||||
display: inline-block;
|
display: block;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
line-height: 15px;
|
line-height: 15px;
|
||||||
padding-left: 5px;
|
padding: 7px 5px;
|
||||||
padding-bottom: 6px;
|
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
font-weight: 300;
|
font-weight: 300;
|
||||||
transition: border 500ms ease-out;
|
transition: border 500ms ease-out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.block a:hover {
|
||||||
|
background: #F5F5F5;
|
||||||
|
}
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
padding: 15px 0;
|
padding: 15px 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -647,7 +647,6 @@
|
||||||
}
|
}
|
||||||
div.append($('<a>', {'href': '../' + crates[i] + '/index.html',
|
div.append($('<a>', {'href': '../' + crates[i] + '/index.html',
|
||||||
'class': klass}).text(crates[i]));
|
'class': klass}).text(crates[i]));
|
||||||
div.append($('<br>'));
|
|
||||||
}
|
}
|
||||||
sidebar.append(div);
|
sidebar.append(div);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue