Skip to content

Commit bf79ffa

Browse files
committed
Auto merge of #30212 - GuillaumeGomez:css_split, r=brson
r? @brson
2 parents aad4e56 + 91cd93d commit bf79ffa

File tree

5 files changed

+144
-65
lines changed

5 files changed

+144
-65
lines changed

src/librustdoc/html/layout.rs

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ r##"<!DOCTYPE html>
4747
4848
<title>{title}</title>
4949
50+
<link rel="stylesheet" type="text/css" href="{root_path}rustdoc.css">
5051
<link rel="stylesheet" type="text/css" href="{root_path}main.css">
5152
5253
{favicon}

src/librustdoc/html/render.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -602,8 +602,10 @@ fn write_shared(cx: &Context,
602602
include_bytes!("static/main.js")));
603603
try!(write(cx.dst.join("playpen.js"),
604604
include_bytes!("static/playpen.js")));
605+
try!(write(cx.dst.join("rustdoc.css"),
606+
include_bytes!("static/rustdoc.css")));
605607
try!(write(cx.dst.join("main.css"),
606-
include_bytes!("static/main.css")));
608+
include_bytes!("static/styles/main.css")));
607609
try!(write(cx.dst.join("normalize.css"),
608610
include_bytes!("static/normalize.css")));
609611
try!(write(cx.dst.join("FiraSans-Regular.woff"),

src/librustdoc/html/static/COPYRIGHT.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ included, and carry their own copyright notices and license terms:
3232
Copyright 2005, 2015 jQuery Foundation, Inc.
3333
Licensed under the MIT license (see LICENSE-MIT.txt).
3434

35-
* main.css, main.js, and playpen.js:
35+
* rustdoc.css, main.js, and playpen.js:
3636

3737
Copyright 2015 The Rust Developers.
3838
Licensed under the Apache License, Version 2.0 (see LICENSE-APACHE.txt) or

src/librustdoc/html/static/main.css renamed to src/librustdoc/html/static/rustdoc.css

+14-63
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@
7070
/* General structure and fonts */
7171

7272
body {
73-
color: #333;
7473
font: 16px/1.4 "Source Serif Pro", Georgia, Times, "Times New Roman", serif;
7574
margin: 0;
7675
position: relative;
@@ -91,17 +90,16 @@ h3 {
9190
font-size: 1.3em;
9291
}
9392
h1, h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod) {
94-
color: black;
9593
font-weight: 500;
9694
margin: 20px 0 15px 0;
9795
padding-bottom: 6px;
9896
}
9997
h1.fqn {
100-
border-bottom: 1px dashed #D5D5D5;
98+
border-bottom: 1px dashed;
10199
margin-top: 0;
102100
}
103101
h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod) {
104-
border-bottom: 1px solid #DDDDDD;
102+
border-bottom: 1px solid;
105103
}
106104
h3.impl, h3.method, h4.method, h3.type, h4.type {
107105
font-weight: 600;
@@ -131,15 +129,13 @@ code, pre {
131129
white-space: pre-wrap;
132130
}
133131
.docblock code {
134-
background-color: #F5F5F5;
135132
border-radius: 3px;
136133
padding: 0 0.2em;
137134
}
138135
.docblock pre code {
139136
padding: 0;
140137
}
141138
pre {
142-
background-color: #F5F5F5;
143139
padding: 14px;
144140
}
145141

@@ -185,9 +181,7 @@ nav.sub {
185181
.sidebar .location {
186182
font-size: 17px;
187183
margin: 30px 0 20px 0;
188-
background: #e1e1e1;
189184
text-align: center;
190-
color: #333;
191185
}
192186

193187
.location a:first-child { font-weight: 500; }
@@ -218,10 +212,6 @@ nav.sub {
218212
transition: border 500ms ease-out;
219213
}
220214

221-
.block a:hover {
222-
background: #F5F5F5;
223-
}
224-
225215
.content {
226216
padding: 15px 0;
227217
}
@@ -241,24 +231,7 @@ nav.sub {
241231
-ms-user-select: none;
242232
user-select: none;
243233
}
244-
.line-numbers span { color: #c67e2d; cursor: pointer; }
245-
.line-numbers .line-highlighted {
246-
background-color: #f6fdb0 !important;
247-
}
248-
249-
.content .highlighted {
250-
color: #000 !important;
251-
background-color: #ccc;
252-
}
253-
.content .highlighted a, .content .highlighted span { color: #000 !important; }
254-
.content .highlighted.trait { background-color: #fece7e; }
255-
.content .highlighted.mod { background-color: #afc6e4; }
256-
.content .highlighted.enum { background-color: #b4d1b9; }
257-
.content .highlighted.struct { background-color: #e7b1a0; }
258-
.content .highlighted.fn { background-color: #c6afb3; }
259-
.content .highlighted.method { background-color: #c6afb3; }
260-
.content .highlighted.tymethod { background-color: #c6afb3; }
261-
.content .highlighted.type { background-color: #c6afb3; }
234+
.line-numbers span { cursor: pointer; }
262235

263236
.docblock.short p {
264237
display: inline;
@@ -279,7 +252,7 @@ nav.sub {
279252
.docblock.short code { white-space: nowrap; }
280253

281254
.docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5 {
282-
border-bottom: 1px solid #DDD;
255+
border-bottom: 1px solid;
283256
}
284257

285258
.docblock h1 { font-size: 1.3em; }
@@ -312,24 +285,23 @@ nav.sub {
312285
.content td h1, .content td h2 { margin-left: 0; font-size: 1.1em; }
313286

314287
.docblock table {
315-
border: 1px solid #ddd;
288+
border: 1px solid;
316289
margin: .5em 0;
317290
border-collapse: collapse;
318291
width: 100%;
319292
}
320293

321294
.docblock table td {
322295
padding: .5em;
323-
border-top: 1px dashed #ddd;
324-
border-bottom: 1px dashed #ddd;
325-
296+
border-top: 1px dashed;
297+
border-bottom: 1px dashed;
326298
}
327299

328300
.docblock table th {
329301
padding: .5em;
330302
text-align: left;
331-
border-top: 1px solid #ddd;
332-
border-bottom: 1px solid #ddd;
303+
border-top: 1px solid;
304+
border-bottom: 1px solid;
333305
}
334306

335307
.content .item-list {
@@ -368,11 +340,11 @@ nav.sub {
368340
}
369341

370342
.content .stability code {
371-
font-size: 90%;
343+
font-size: 90%;
372344
}
373345

374346
nav {
375-
border-bottom: 1px solid #e0e0e0;
347+
border-bottom: 1px solid;
376348
padding-bottom: 10px;
377349
margin-bottom: 10px;
378350
}
@@ -381,11 +353,11 @@ nav.main {
381353
text-align: center;
382354
}
383355
nav.main .current {
384-
border-top: 1px solid #000;
385-
border-bottom: 1px solid #000;
356+
border-top: 1px solid;
357+
border-bottom: 1px solid;
386358
}
387359
nav.main .separator {
388-
border: 1px solid #000;
360+
border: 1px solid;
389361
display: inline-block;
390362
height: 23px;
391363
margin: 0 20px;
@@ -399,29 +371,17 @@ nav.sub, .content {
399371

400372
a {
401373
text-decoration: none;
402-
color: #000;
403374
background: transparent;
404375
}
405376

406-
.docblock a, .stability a {
407-
color: #4e8bca;
408-
}
409-
410377
.docblock a:hover, .stability a {
411378
text-decoration: underline;
412379
}
413380

414-
.content span.trait, .content a.trait, .block a.current.trait { color: #8866ff; }
415-
.content span.mod, .content a.mod, block a.current.mod { color: #4d76ae; }
416381
.content span.enum, .content a.enum, .block a.current.enum { color: #5e9766; }
417382
.content span.struct, .content a.struct, .block a.current.struct { color: #e53700; }
418-
.content a.primitive { color: #39a7bf; }
419383
.content a.type { color: #e57300; }
420384
.content a.macro { color: #068000; }
421-
.content span.fn, .content a.fn, .block a.current.fn,
422-
.content span.method, .content a.method, .block a.current.method,
423-
.content span.tymethod, .content a.tymethod, .block a.current.tymethod,
424-
.content .fnname { color: #8c6067; }
425385
.block a.current.crate { font-weight: 500; }
426386

427387
.search-input {
@@ -434,11 +394,9 @@ a {
434394
outline: none;
435395
border: none;
436396
border-radius: 1px;
437-
color: #555;
438397
margin-top: 5px;
439398
padding: 10px 16px;
440399
font-size: 17px;
441-
box-shadow: 0 0 0 1px #e0e0e0, 0 0 0 2px transparent;
442400
transition: border-color 300ms ease;
443401
transition: border-radius 300ms ease-in-out;
444402
transition: box-shadow 300ms ease-in-out;
@@ -512,8 +470,6 @@ body.blur > :not(#help) {
512470
padding: 20px;
513471
}
514472

515-
em.stab.unstable { background: #FFF5D6; border-color: #FFC600; }
516-
em.stab.deprecated { background: #F3DFFF; border-color: #7F0087; }
517473
em.stab {
518474
display: inline-block;
519475
border-width: 1px;
@@ -546,7 +502,6 @@ td.summary-column {
546502
padding-right: 0px;
547503
}
548504

549-
:target { background: #FDFFD3; }
550505
.line-numbers :target { background-color: transparent; }
551506

552507
/* Code highlighting */
@@ -555,8 +510,6 @@ pre.rust .kw-2, pre.rust .prelude-ty { color: #4271AE; }
555510
pre.rust .number, pre.rust .string { color: #718C00; }
556511
pre.rust .self, pre.rust .boolval, pre.rust .prelude-val,
557512
pre.rust .attribute, pre.rust .attribute .ident { color: #C82829; }
558-
pre.rust .comment { color: #8E908C; }
559-
pre.rust .doccomment { color: #4D4D4C; }
560513
pre.rust .macro, pre.rust .macro-nonterminal { color: #3E999F; }
561514
pre.rust .lifetime { color: #B76514; }
562515

@@ -565,9 +518,7 @@ pre.rust { position: relative; }
565518
a.test-arrow {
566519
display: inline-block;
567520
position: absolute;
568-
569521
background-color: #4e8bca;
570-
color: #f5f5f5;
571522
padding: 5px 10px 5px 10px;
572523
border-radius: 5px;
573524
font-size: 130%;
+125
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
/**
2+
* Copyright 2015 The Rust Project Developers. See the COPYRIGHT
3+
* file at the top-level directory of this distribution and at
4+
* http://rust-lang.org/COPYRIGHT.
5+
*
6+
* Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
7+
* http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
8+
* <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
9+
* option. This file may not be copied, modified, or distributed
10+
* except according to those terms.
11+
*/
12+
13+
/* General structure and fonts */
14+
15+
body {
16+
background-color: white;
17+
color: black;
18+
}
19+
20+
h1, h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod) {
21+
color: black;
22+
}
23+
h1.fqn {
24+
border-bottom-color: #D5D5D5;
25+
}
26+
h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod) {
27+
border-bottom-color: #DDDDDD;
28+
}
29+
30+
.docblock code {
31+
background-color: #F5F5F5;
32+
}
33+
pre {
34+
background-color: #F5F5F5;
35+
}
36+
37+
.sidebar .location {
38+
background: #e1e1e1;
39+
color: #333;
40+
}
41+
42+
.block a:hover {
43+
background: #F5F5F5;
44+
}
45+
46+
.line-numbers span { color: #c67e2d; }
47+
.line-numbers .line-highlighted {
48+
background-color: #f6fdb0 !important;
49+
}
50+
51+
:target { background: #FDFFD3; }
52+
.content .highlighted {
53+
color: #000 !important;
54+
background-color: #ccc;
55+
}
56+
.content .highlighted a, .content .highlighted span { color: #000 !important; }
57+
.content .highlighted.trait { background-color: #fece7e; }
58+
.content .highlighted.mod { background-color: #afc6e4; }
59+
.content .highlighted.enum { background-color: #b4d1b9; }
60+
.content .highlighted.struct { background-color: #e7b1a0; }
61+
.content .highlighted.fn { background-color: #c6afb3; }
62+
.content .highlighted.method { background-color: #c6afb3; }
63+
.content .highlighted.tymethod { background-color: #c6afb3; }
64+
.content .highlighted.type { background-color: #c6afb3; }
65+
66+
.docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5 {
67+
border-bottom-color: #DDD;
68+
}
69+
70+
.docblock table {
71+
border-color: #ddd;
72+
}
73+
74+
.docblock table td {
75+
border-top-color: #ddd;
76+
border-bottom-color: #ddd;
77+
}
78+
79+
.docblock table th {
80+
border-top-color: #ddd;
81+
border-bottom-color: #ddd;
82+
}
83+
84+
.content a.primitive { color: #39a7bf; }
85+
.content span.mod, .content a.mod, block a.current.mod { color: #4d76ae; }
86+
.content span.fn, .content a.fn, .block a.current.fn,
87+
.content span.method, .content a.method, .block a.current.method,
88+
.content span.tymethod, .content a.tymethod, .block a.current.tymethod,
89+
.content .fnname { color: #8c6067; }
90+
91+
pre.rust .comment { color: #8E908C; }
92+
pre.rust .doccomment { color: #4D4D4C; }
93+
94+
nav {
95+
border-bottom-color: #e0e0e0;
96+
}
97+
nav.main .current {
98+
border-top-color: #000;
99+
border-bottom-color: #000;
100+
}
101+
nav.main .separator {
102+
border-color: 1px solid #000;
103+
}
104+
a {
105+
color: #000;
106+
}
107+
108+
.docblock a, .stability a {
109+
color: #4e8bca;
110+
}
111+
112+
a.test-arrow {
113+
color: #f5f5f5;
114+
}
115+
116+
.content span.trait, .content a.trait, .block a.current.trait { color: #8866ff; }
117+
118+
.search-input {
119+
color: #555;
120+
box-shadow: 0 0 0 1px #e0e0e0, 0 0 0 2px transparent;
121+
background-color: white;
122+
}
123+
124+
em.stab.unstable { background: #FFF5D6; border-color: #FFC600; }
125+
em.stab.deprecated { background: #F3DFFF; border-color: #7F0087; }

0 commit comments

Comments
 (0)