Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit fbdde0e

Browse files
thehydroimpulseadrientetar
authored andcommitted
Tweaked the design to be a lot cleaner.
Signed-off-by: Daniel Fagnan <[email protected]>
1 parent ecc774f commit fbdde0e

File tree

2 files changed

+126
-29
lines changed

2 files changed

+126
-29
lines changed

src/librustdoc/html/layout.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ r##"<!DOCTYPE html>
5151
5252
<section class="sidebar">
5353
{logo, select, none{} other{
54-
<a href='{root_path}{krate}/index.html'><img src='#' alt=''/></a>
54+
<a href='{root_path}{krate}/index.html'><img src='#' alt='' width='100px' /></a>
5555
}}
5656
5757
{sidebar}

src/librustdoc/html/static/main.css

Lines changed: 125 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,26 @@ body {
3030
padding-bottom: 20px;
3131
}
3232

33-
h1, .sidebar .location {
34-
font: 700 22px "Oswald", Arial, sans-serif;
35-
}
36-
h2, h3, h4 {
37-
font: 700 16px "Oswald", Arial, sans-serif;
38-
text-transform: uppercase;
39-
}
4033
h2 code, h3 code, h4 code {
4134
text-transform: none;
4235
font-size: 1.2em;
4336
}
4437

38+
h1 {
39+
font: 600 26px "Helvetica Neue", Arial, sans-serif !important;
40+
margin: 20px 0;
41+
}
42+
43+
h2, h3, h4 {
44+
font: 500 20px "Helvetica Neue", Arial, sans-serif;
45+
margin: 40px 0 20px 0;
46+
padding-bottom: 15px;
47+
border-bottom: 1px solid #DDDDDD;
48+
}
49+
4550
code, pre, h1.fqn {
4651
font-family: "Inconsolata", Menlo, Monaco, Consolas, "DejaVu Sans Mono", monospace;
52+
font-weight: normal;
4753
}
4854
code, pre {
4955
color: #333;
@@ -54,6 +60,8 @@ pre {
5460
h1.fqn {
5561
font-size: 26px;
5662
font-weight: normal;
63+
padding-bottom: 15px;
64+
border-bottom: 1px dashed #D5D5D5;
5765
}
5866

5967
nav {
@@ -81,42 +89,66 @@ nav.sub {
8189
.js-only, .hidden { display: none; }
8290

8391
.sidebar {
84-
background: #e9e9e9;
8592
padding: 10px;
8693
}
8794
.sidebar img {
8895
margin: 20px auto;
8996
display: block;
9097
}
9198

92-
.sidebar .location { margin-bottom: 10px; }
99+
.sidebar .location {
100+
font-size: 17px;
101+
margin: 30px 0 20px 0;
102+
background: #e1e1e1;
103+
text-align: center;
104+
color: #333;
105+
}
106+
107+
.sidebar .location a {
108+
color: #333;
109+
}
110+
93111
.sidebar .block, pre { background: #fff; }
94-
.sidebar .block, pre, .content { border-bottom: 2px solid black; }
95-
.trait { border-color: #fcae2b !important; }
96-
.mod { border-color: #809fc7 !important; }
97-
.enum { border-color: #93bc99 !important; }
98-
.struct { border-color: #e53700 !important; }
99-
.fn { border-color: #a2777f !important; }
100112

101113
.block {
102114
padding: 10px;
103115
margin-bottom: 10px;
104116
}
105-
.block h2 { margin-top: 0; }
117+
.block h2 {
118+
margin-top: 0;
119+
text-align: center;
120+
}
121+
106122
.block a {
107123
display: inline-block;
108-
width: 100%;
109124
text-overflow: ellipsis;
110125
overflow: hidden;
111126
line-height: 15px;
127+
margin: 0 0 0 45px;
128+
padding-bottom: 4px;
129+
border-bottom: 2px solid #fff;
130+
font-size: 14px;
131+
132+
transition: border 500ms ease-out;
133+
-webkit-transition: border 500ms ease-out;
134+
-moz-transition: border 500ms ease-out;
135+
-o-transition: border 500ms ease-out;
136+
}
137+
138+
body p {
139+
font-size: 15px;
140+
line-height: 1.6;
112141
}
113142

114143
.content {
115-
background: #f3f3f3;
116144
padding: 20px 20px 20px 40px;
117145
}
118-
.content h1 { margin-top: 0; }
119-
.content h1, .content h2 { margin-left: -20px; }
146+
147+
.content h1 {
148+
margin-top: 0;
149+
font-weight: 400 !important;
150+
}
151+
120152
.content pre { padding: 20px; }
121153
.content.source pre.rust {
122154
white-space: pre;
@@ -155,12 +187,31 @@ nav.sub {
155187

156188
.docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5 {
157189
margin-left: 0;
190+
margin: 40px 0 10px 0;
191+
padding-bottom: 10px;
192+
border-bottom: 1px solid #eee;
158193
}
194+
159195
.docblock h1 { font-size: 1.1em; }
160196
.docblock h2 { font-size: 1.05em; }
161197
.docblock h3, .docblock h4, .docblock h5 { font-size: 1em; }
162198

163-
.content .source { float: right; }
199+
.docblock h3 {
200+
font-size: 1.3em;
201+
}
202+
203+
.docblock h2 {
204+
font-size: 1.5em;
205+
}
206+
207+
.content .source {
208+
float: right;
209+
font-size: 14px;
210+
font-weight: 400;
211+
padding: 9px 15px;
212+
color: #333;
213+
}
214+
164215
.content table {
165216
border-spacing: 0 5px;
166217
border-collapse: separate;
@@ -224,7 +275,7 @@ a {
224275
background: transparent;
225276
}
226277

227-
.content a, .block a.current { font-weight: bold; }
278+
.content a, .block a.current { font-weight: 400; }
228279

229280
.content a.trait, .block a.current.trait { color: #ed9603; }
230281
.content a.mod, .block a.current.mod { color: #4d76ae; }
@@ -235,16 +286,59 @@ a {
235286

236287
.search-container {
237288
padding-right: 10px;
238-
overflow: hidden;
239289
}
240290
.search-input {
241291
border: 2px solid #e9e9e9;
242292
border-radius: 2px;
243-
width: 100%;
293+
width: 85%;
294+
box-sizing: content-box;
295+
outline: none;
296+
border: none;
297+
background: none;
298+
font-family: "Helvetica Neue";
299+
color: #000;
300+
margin-top: 5px;
301+
padding: 10px 20px;
302+
font-weight: 300;
303+
border-radius: 1px;
304+
box-shadow: 0 0 0 1px #e0e0e0, 0 0 0 2px transparent;
305+
color: #555555;
306+
padding: 10px 16px;
307+
line-height: 1.4;
308+
font-size: 17px;
309+
background-color: white;
310+
-webkit-transition: background-color 50ms linear;
311+
transition: background-color 50ms linear;
312+
transition: border 500ms ease-out;
313+
-webkit-transition: border 500ms ease-out;
314+
-moz-transition: border 500ms ease-out;
315+
-o-transition: border 500ms ease-out;
316+
transition: box-shadow 500ms ease-out;
317+
-webkit-transition: box-shadow 500ms ease-out;
318+
-moz-transition: box-shadow 500ms ease-out;
319+
-o-transition: box-shadow 500ms ease-out;
320+
}
321+
322+
.search-input:focus {
323+
border-color: #66afe9;
324+
border: 0;
325+
outline: 0;
326+
box-shadow: 0 0 0 1px #078dd8, 0 0 0 2px #078dd8;
244327
}
328+
245329
.do-search {
246330
float: right;
247-
width: 62px;
331+
outline: none;
332+
border: none;
333+
font-family: Helvetica Neue;
334+
font-weight: 200;
335+
color: #fff;
336+
padding: 14px 25px;
337+
margin-top: 3px;
338+
font-size: 16px;
339+
margin-right: 15px;
340+
text-align: center;
341+
background: #6F5E59;
248342
}
249343
.search-results .desc {
250344
white-space: nowrap;
@@ -288,13 +382,16 @@ a {
288382
}
289383

290384
.stability {
291-
border-left: 5px solid #000;
385+
border-left: 6px solid #000;
292386
border-radius: 3px;
293-
padding: 0 3px;
294-
float: right;
387+
padding: 8px 3px;
295388
background: #fff;
296389
text-transform: lowercase;
390+
display: block;
391+
padding-left: 10px;
392+
margin-bottom: 20px;
297393
}
394+
298395
.stability.Deprecated { border-color: #D60027; color: #880017; }
299396
.stability.Experimental { border-color: #EC5315; color: #a53c0e; }
300397
.stability.Unstable { border-color: #FFD700; color: #b39800; }

0 commit comments

Comments
 (0)