Skip to content

Commit 73e2dc4

Browse files
committed
rustdoc: nitpicks & cleanup
1 parent 07d32aa commit 73e2dc4

File tree

3 files changed

+23
-431
lines changed

3 files changed

+23
-431
lines changed

src/librustdoc/html/layout.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ pub struct Page<'self> {
2727
pub fn render<T: fmt::Default, S: fmt::Default>(
2828
dst: &mut io::Writer, layout: &Layout, page: &Page, sidebar: &S, t: &T)
2929
{
30-
write!(dst, "
31-
<!DOCTYPE html>
30+
write!(dst,
31+
"<!DOCTYPE html>
3232
<html lang=\"en\">
3333
<head>
3434
<meta charset=\"utf-8\" />
@@ -38,15 +38,13 @@ pub fn render<T: fmt::Default, S: fmt::Default>(
3838
rel='stylesheet' type='text/css'>
3939
<link rel=\"stylesheet\" type=\"text/css\" href=\"{root_path}{crate}/main.css\">
4040
41-
{favicon, select, none{} other{
42-
<link rel=\"icon\" href=\"#\" sizes=\"16x16\"
43-
type=\"image/vnd.microsoft.icon\" />}}
41+
{favicon, select, none{} other{<link rel=\"shortcut icon\" href=\"#\" />}}
4442
</head>
4543
<body>
4644
<!--[if lte IE 8]>
4745
<div class=\"warning\">
4846
This old browser is unsupported and will most likely display funky
49-
things
47+
things.
5048
</div>
5149
<![endif]-->
5250

src/librustdoc/html/static/main.css

Lines changed: 18 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
* option. This file may not be copied, modified, or distributed
1010
* except according to those terms.
1111
*/
12-
1312
@import "normalize.css";
1413

1514
* {
@@ -18,58 +17,47 @@
1817
box-sizing: border-box;
1918
}
2019

21-
/* Fonts */
20+
/* General structure and fonts */
2221

2322
body {
24-
font: 13px Arial, sans-serif;
23+
min-height: 100%;
24+
min-width: 500px;
25+
height: 100%;
26+
font: 13px "Helvetica Neue", Helvetica, Arial, sans-serif;
2527
line-height: 165%;
28+
position: relative;
29+
height: auto;
30+
padding-bottom: 20px;
2631
}
2732

2833
h1, .sidebar .location {
2934
font: 700 22px "Oswald", Arial, sans-serif;
3035
}
31-
3236
h2, h3, h4 {
3337
font: 700 16px "Oswald", Arial, sans-serif;
3438
text-transform: uppercase;
3539
}
36-
3740
h2 code, h3 code, h4 code {
3841
text-transform: none;
3942
font-size: 1.2em;
4043
}
4144

4245
code, pre, h1.fqn {
43-
font: 15px "Inconsolata", "Consolas", "Courier New", monospace;
46+
font: 15px Monaco, Menlo, "Inconsolata", Consolas, "Courier New", monospace;
4447
}
4548
h1.fqn {
4649
font-size: 26px;
4750
font-weight: normal;
4851
}
4952

5053
nav {
51-
font: 700 26px "Oswald", Arial, sans-serif;
54+
font: 700 26px "Oswald", "Helvetica Neue", Helvetica, Arial, sans-serif;
5255
text-transform: uppercase;
5356
}
54-
5557
nav.sub {
56-
padding-top: 20px;
57-
font: 700 16px "Oswald", Arial, sans-serif;
58+
padding-top: 10px;
59+
font-size: 16px;
5860
text-transform: uppercase;
59-
text-align: right;
60-
}
61-
62-
/* General structure */
63-
64-
html, body {
65-
min-height: 100%;
66-
height: 100%;
67-
}
68-
69-
body {
70-
position: relative;
71-
height: auto;
72-
padding-bottom: 20px;
7361
}
7462

7563
.sidebar {
@@ -90,7 +78,6 @@ body {
9078
background: #e9e9e9;
9179
padding: 10px;
9280
}
93-
9481
.sidebar img {
9582
margin: 20px auto;
9683
display: block;
@@ -156,7 +143,6 @@ body {
156143
.docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5 {
157144
margin-left: 0;
158145
}
159-
160146
.docblock h1 { font-size: 1.1em; }
161147
.docblock h2 { font-size: 1.05em; }
162148
.docblock h3, .docblock h4, .docblock h5 { font-size: 1em; }
@@ -234,9 +220,13 @@ a {
234220
.content .fnname { color: #8c6067; }
235221

236222
.search-input {
237-
border: 2px solid #f2f2f2;
223+
border: 2px solid #e9e9e9;
238224
border-radius: 2px;
239-
width: 350px;
225+
width: calc(100% - 66px);
226+
}
227+
.do-search {
228+
float: right;
229+
width: 62px;
240230
}
241231
.search-results .desc {
242232
white-space: nowrap;
@@ -249,7 +239,6 @@ a {
249239
background: #e9e9e9;
250240
border-radius: 4px;
251241
box-shadow: 0 0 6px rgba(0,0,0,.2);
252-
253242
position: absolute;
254243
top: 300px;
255244
left: 50%;

0 commit comments

Comments
 (0)