Skip to content

Commit ada5992

Browse files
committed
doc: design changes cleanups
1 parent 598b5af commit ada5992

File tree

2 files changed

+39
-112
lines changed

2 files changed

+39
-112
lines changed

src/librustdoc/html/layout.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,12 @@ pub fn render<T: fmt::Show, S: fmt::Show>(
3333
<html lang=\"en\">
3434
<head>
3535
<meta charset=\"utf-8\" />
36+
<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />
37+
<meta name=\"description\" content=\"The {krate} library documentation.\">
38+
3639
<title>{title}</title>
3740
38-
<link href='http://fonts.googleapis.com/css?family=Oswald:700|Inconsolata:400,700'
41+
<link href='http://fonts.googleapis.com/css?family=Inconsolata:400,700'
3942
rel='stylesheet' type='text/css'>
4043
<link rel=\"stylesheet\" type=\"text/css\" href=\"{root_path}{krate}/main.css\">
4144
@@ -59,7 +62,6 @@ pub fn render<T: fmt::Show, S: fmt::Show>(
5962
6063
<nav class=\"sub\">
6164
<form class=\"search-form js-only\">
62-
<button class=\"do-search\">Search</button>
6365
<div class=\"search-container\">
6466
<input class=\"search-input\" name=\"search\"
6567
autocomplete=\"off\"

src/librustdoc/html/static/main.css

Lines changed: 35 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -20,54 +20,42 @@
2020
/* General structure and fonts */
2121

2222
body {
23+
color: #333;
2324
min-height: 100%;
2425
min-width: 500px;
2526
height: 100%;
26-
font: 13px "Helvetica Neue", Helvetica, Arial, sans-serif;
27-
line-height: 165%;
27+
font: 15px "Helvetica Neue", Helvetica, Arial, sans-serif;
28+
line-height: 150%;
2829
position: relative;
2930
height: auto;
3031
padding-bottom: 20px;
3132
}
3233

33-
h2 code, h3 code, h4 code {
34-
text-transform: none;
35-
font-size: 1.2em;
34+
h1, h2, h3, h4 {
35+
color: black;
36+
font-weight: 500;
37+
margin: 30px 0 20px 0;
38+
padding-bottom: 15px;
3639
}
37-
38-
h1 {
39-
font: 600 26px "Helvetica Neue", Arial, sans-serif !important;
40-
margin: 20px 0;
40+
h1.fqn {
41+
border-bottom: 1px dashed #D5D5D5;
42+
margin-top: 0;
4143
}
42-
4344
h2, h3, h4 {
44-
font: 500 20px "Helvetica Neue", Arial, sans-serif;
45-
margin: 40px 0 20px 0;
46-
padding-bottom: 15px;
4745
border-bottom: 1px solid #DDDDDD;
4846
}
47+
h2 code, h3 code, h4 code {
4948

50-
code, pre, h1.fqn {
51-
font-family: "Inconsolata", Menlo, Monaco, Consolas, "DejaVu Sans Mono", monospace;
52-
font-weight: normal;
49+
font-size: 1.2em;
5350
}
51+
5452
code, pre {
55-
color: #333;
53+
font-family: "Inconsolata", Menlo, Monaco, Consolas, "DejaVu Sans Mono", monospace;
5654
}
5755
pre {
5856
font-size: 15px;
5957
}
60-
h1.fqn {
61-
font-size: 26px;
62-
font-weight: normal;
63-
padding-bottom: 15px;
64-
border-bottom: 1px dashed #D5D5D5;
65-
}
6658

67-
nav {
68-
font: 700 26px "Oswald", "Helvetica Neue", Helvetica, Arial, sans-serif;
69-
text-transform: uppercase;
70-
}
7159
nav.sub {
7260
padding-top: 10px;
7361
font-size: 16px;
@@ -104,10 +92,6 @@ nav.sub {
10492
color: #333;
10593
}
10694

107-
.sidebar .location a {
108-
color: #333;
109-
}
110-
11195
.sidebar .block, pre { background: #fff; }
11296

11397
.block {
@@ -124,26 +108,14 @@ nav.sub {
124108
text-overflow: ellipsis;
125109
overflow: hidden;
126110
line-height: 15px;
127-
margin: 0 0 0 45px;
128-
padding-bottom: 4px;
129-
border-bottom: 2px solid #fff;
111+
padding-left: 5px;
112+
padding-bottom: 6px;
130113
font-size: 14px;
131-
132114
transition: border 500ms ease-out;
133115
}
134116

135-
body p {
136-
font-size: 15px;
137-
line-height: 1.6;
138-
}
139-
140117
.content {
141-
padding: 20px 20px 20px 40px;
142-
}
143-
144-
.content h1 {
145-
margin-top: 0;
146-
font-weight: 400 !important;
118+
padding: 20px 40px;
147119
}
148120

149121
.content pre { padding: 20px; }
@@ -186,27 +158,17 @@ body p {
186158
margin-left: 0;
187159
margin: 40px 0 10px 0;
188160
padding-bottom: 10px;
189-
border-bottom: 1px solid #eee;
161+
border-bottom: 1px solid #DDD;
190162
}
191163

192-
.docblock h1 { font-size: 1.1em; }
193-
.docblock h2 { font-size: 1.05em; }
164+
.docblock h1 { font-size: 1.3em; }
165+
.docblock h2 { font-size: 1.15em; }
194166
.docblock h3, .docblock h4, .docblock h5 { font-size: 1em; }
195167

196-
.docblock h3 {
197-
font-size: 1.3em;
198-
}
199-
200-
.docblock h2 {
201-
font-size: 1.5em;
202-
}
203-
204168
.content .source {
205169
float: right;
206-
font-size: 14px;
207-
font-weight: 400;
170+
font-weight: 500;
208171
padding: 9px 15px;
209-
color: #333;
210172
}
211173

212174
.content table {
@@ -263,7 +225,6 @@ nav.sub form { display: inline; }
263225

264226
nav, .content {
265227
margin-left: 220px;
266-
margin-right: 20px;
267228
}
268229

269230
a {
@@ -272,40 +233,29 @@ a {
272233
background: transparent;
273234
}
274235

275-
.content a, .block a.current { font-weight: 400; }
276-
277236
.content a.trait, .block a.current.trait { color: #ed9603; }
278237
.content a.mod, .block a.current.mod { color: #4d76ae; }
279238
.content a.enum, .block a.current.enum { color: #5e9766; }
280239
.content a.struct, .block a.current.struct { color: #e53700; }
281240
.content a.fn, .block a.current.fn { color: #8c6067; }
282241
.content .fnname { color: #8c6067; }
283242

284-
.search-container {
285-
width: 60%;
286-
margin-left: 50px;
287-
}
288-
289243
.search-input {
290-
border: 2px solid #e9e9e9;
291-
border-radius: 2px;
292-
width: 95%;
293-
box-sizing: content-box;
244+
width: 100%;
245+
/* Override Normalize.css: we have margins and do
246+
not want to overflow - the `moz` attribute is necessary
247+
until Firefox 29, too early to drop at this point */
248+
-moz-box-sizing: border-box !important;
249+
box-sizing: border-box !important;
294250
outline: none;
295251
border: none;
296-
background-color: white;
297-
font-family: "Helvetica Neue";
298-
color: #000;
299-
margin-top: 5px;
300-
padding: 10px 20px;
301-
font-weight: 300;
302252
border-radius: 1px;
303-
box-shadow: 0 0 0 1px #e0e0e0, 0 0 0 2px transparent;
304-
color: #555555;
253+
color: #555;
254+
margin-top: 5px;
305255
padding: 10px 16px;
306-
line-height: 1.4;
307256
font-size: 17px;
308-
257+
font-weight: 300;
258+
box-shadow: 0 0 0 1px #e0e0e0, 0 0 0 2px transparent;
309259
transition: background-color 50ms linear;
310260
transition: border 500ms ease-out;
311261
transition: box-shadow 500ms ease-out;
@@ -318,21 +268,6 @@ a {
318268
box-shadow: 0 0 0 1px #078dd8, 0 0 0 2px #078dd8;
319269
}
320270

321-
.do-search {
322-
display: none;
323-
outline: none;
324-
border: none;
325-
font-family: Helvetica Neue;
326-
font-weight: 200;
327-
color: #fff;
328-
padding: 14px 25px;
329-
margin-top: 3px;
330-
font-size: 16px;
331-
text-align: center;
332-
background: #5B6672;
333-
margin-left: 10px;
334-
}
335-
336271
.search-results .desc {
337272
white-space: nowrap;
338273
text-overflow: ellipsis;
@@ -377,11 +312,9 @@ a {
377312
.stability {
378313
border-left: 6px solid #000;
379314
border-radius: 3px;
380-
padding: 8px 3px;
381-
background: #fff;
315+
padding: 8px 3px 8px 10px;
382316
text-transform: lowercase;
383317
display: block;
384-
padding-left: 10px;
385318
margin-bottom: 20px;
386319
}
387320

@@ -418,14 +351,6 @@ h6.section-link:hover a:after {
418351

419352
/** Media Queries **/
420353

421-
@media (max-width: 620px) {
422-
.search-container {
423-
display: block;
424-
width: 100%;
425-
margin-left: 0px;
426-
}
427-
}
428-
429354
@media (max-width: 700px) {
430355
.sidebar {
431356
display: none;
@@ -436,7 +361,7 @@ h6.section-link:hover a:after {
436361
}
437362

438363
nav.sub {
439-
width: 80%;
364+
width: 85.5%;
440365
margin: 0 auto;
441366
}
442-
}
367+
}

0 commit comments

Comments
 (0)