Skip to content

Commit a18956e

Browse files
committed
doc: expand tutorial/manual CSS
Cleanup, edit, add some Bootstrap v3.0.0 elements.
1 parent 1243d1f commit a18956e

File tree

3 files changed

+249
-98
lines changed

3 files changed

+249
-98
lines changed

doc/rust.css

Lines changed: 243 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,148 @@
1+
/**
2+
* Copyright 2013 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+
* With elements taken from Bootstrap v3.0.0 (Apache v2.0 licensed).
6+
*
7+
* Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
8+
* http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
9+
* <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
10+
* option. This file may not be copied, modified, or distributed
11+
* except according to those terms.
12+
*/
13+
/* Global page semantics
14+
========================================================================== */
115
body {
2-
padding: 1em 6em;
3-
margin: 0;
4-
margin-bottom: 4em;
5-
font-family: "Helvetica Neue", Helvetica, sans-serif;
6-
font-size: 12pt;
7-
background-color: white;
8-
color: black;
9-
line-height: 1.6em;
10-
min-width: 45em;
11-
max-width: 60em;
16+
background-color: #fff;
17+
margin: 0 auto;
18+
padding: 0 15px;
19+
margin-bottom: 4em;
20+
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
21+
font-size: 14px;
22+
color: #333;
23+
line-height: 1.428571429;
1224
}
13-
14-
h1 {
15-
font-size: 24pt;
16-
margin-top: 1.6em;
17-
padding-left: 0.4em;
18-
line-height: 1.6em;
19-
background-color:#FFF2CE;
20-
border-radius: 0.2em;
25+
@media (min-width: 768px) {
26+
body {
27+
max-width: 750px;
28+
}
2129
}
22-
23-
h2 {
24-
font-size: 16pt;
25-
margin-top: 1.6em;
26-
padding: 0.2em 0.5em;
27-
background-color:#FFF2CE;
28-
border-radius: 0.4em;
30+
@media (min-width: 992px) {
31+
body {
32+
max-width: 970px;
33+
}
2934
}
30-
31-
h2 code {
32-
color: #097334;
33-
font-size: 16pt;
35+
@media (min-width: 1200px) {
36+
body {
37+
max-width: 1170px;
38+
}
3439
}
3540

36-
h3 {
37-
font-size: 14pt;
38-
color: black;
39-
background-color:#D9E7FF;
40-
border-radius: 0.4em;
41-
padding: 0.2em 0.5em;
41+
h1, h2, h3, h4, h5, h6 {
42+
color: black;
43+
font-weight: 500;
44+
line-height: 1.1;
4245
}
43-
44-
h3 code {
45-
color: #541800;
46-
font-size: 14pt;
47-
font-style: italic;
46+
h1, h2, h3 {
47+
margin-top: 20px;
48+
margin-bottom: 10px;
49+
}
50+
h4, h5, h6 {
51+
margin-top: 12px;
52+
margin-bottom: 10px;
4853
}
4954

55+
h1 {
56+
font-size: 36px;
57+
padding: .1em .4em;
58+
margin: 0.67em 0;
59+
background-color: #E9E9E9;
60+
border-radius: .2em;
61+
}
62+
h1.title {
63+
line-height: 1.5em;
64+
}
65+
h2 {
66+
font-size: 30px;
67+
padding: .2em .5em;
68+
background-color: #E9E9E9;
69+
border-radius: .3em;
70+
}
71+
h3 {
72+
font-size: 24px;
73+
padding: .2em .5em;
74+
background-color: #DDE8FC;
75+
border-radius: .4em;
76+
}
5077
h4 {
51-
font-size: 11pt;
52-
margin-top: 0em;
53-
margin-bottom: 0em;
78+
font-size: 18px;
5479
}
55-
56-
code {
57-
font-size: 11pt;
80+
h5 {
81+
font-size: 16px;
5882
}
59-
60-
pre {
61-
margin-left: 1.1em;
62-
padding: .4em .4em .4em .8em;
63-
font-size: 10pt;
64-
background-color: #F5F5F5;
65-
border-radius: 0.5em;
66-
border: 1px solid rgba(0, 0, 0, 0.15);
83+
h6 {
84+
font-size: 14px;
6785
}
6886

69-
pre.rust {
70-
background-color: #F3F6FF;
87+
p {
88+
margin: 0 0 10px;
7189
}
7290

73-
a, a:visited, a:link {
74-
text-decoration: none;
75-
color: rgb(0, 105, 214);
91+
/* Links layout
92+
========================================================================== */
93+
a {
94+
text-decoration: none;
95+
color: #428BCA;
96+
}
97+
a:hover, a:focus {
98+
color: #2A6496;
99+
text-decoration: underline;
100+
}
101+
a:focus {
102+
outline: thin dotted #333;
103+
outline: 5px auto -webkit-focus-ring-color;
104+
outline-offset: -2px;
105+
}
106+
a:hover, a:active {
107+
outline: 0;
76108
}
77109

78110
h1 a:link, h1 a:visited, h2 a:link, h2 a:visited,
79-
h3 a:link, h3 a:visited { color: black; }
111+
h3 a:link, h3 a:visited, h4 a:link, h4 a:visited,
112+
h5 a:link, h5 a:visited {color: black;}
113+
114+
/* Code
115+
========================================================================== */
116+
pre, code {
117+
font-family: Monaco, Menlo, Consolas, "Courier New", monospace;
118+
border-radius: 4px;
119+
}
120+
pre {
121+
background-color: #F5F5F5;
122+
border: 1px solid #CCC;
123+
border-radius: 0.5em;
124+
white-space: pre-wrap;
125+
padding: 9.5px;
126+
margin: 10px 0;
127+
font-size: 13px;
128+
word-break: break-all;
129+
word-wrap: break-word;
130+
}
131+
code {
132+
padding: 2px 4px;
133+
font-size: 90%;
134+
color: #C7254E;
135+
background-color: #F9F2F4;
136+
white-space: nowrap;
137+
}
138+
pre code {
139+
padding: 0;
140+
font-size: inherit;
141+
color: inherit;
142+
white-space: pre-wrap;
143+
background-color: transparent;
144+
border: 0;
145+
}
80146

81147
/* Code highlighting */
82148
.cm-s-default span.cm-keyword {color: #708;}
@@ -99,62 +165,147 @@ h3 a:link, h3 a:visited { color: black; }
99165
.cm-s-default span.cm-tag {color: #170;}
100166
.cm-s-default span.cm-attribute {color: #00c;}
101167

168+
/* The rest
169+
========================================================================== */
102170
#versioninfo {
103-
position: fixed;
104-
bottom: 0px;
105-
right: 0px;
106-
text-align: center;
107-
padding: 0.5em;
171+
text-align: center;
172+
margin: 0.5em;
173+
font-size: 1.1em;
108174
}
109-
#versioninfo a.hash {
110-
color: gray;
111-
font-size: 60%;
175+
@media (min-width: 768px) {
176+
#versioninfo {
177+
position: fixed;
178+
bottom: 0px;
179+
right: 0px;
180+
}
181+
.white-sticker {
182+
background-color: #fff;
183+
margin: 2px;
184+
padding: 0 2px;
185+
border-radius: .3em;
186+
}
112187
}
113-
#versioninfo .white-sticker {
114-
background-color: #fff;
115-
margin: 2px;
116-
padding: 0 2px;
117-
border-radius: .3em;
188+
#versioninfo a.hash {
189+
color: gray;
190+
font-size: 60%;
118191
}
119192

120193
blockquote {
121-
color: black;
122-
border-left: solid 1px silver;
123-
margin: 1em;
124-
padding: 0.5em 1em 0.5em 1em;
194+
color: black;
195+
border-left: 5px solid #eee;
196+
margin: 0 0 20px;
197+
padding: 10px 20px;
198+
}
199+
blockquote p {
200+
font-size: 17px;
201+
font-weight: 300;
202+
line-height: 1.25;
203+
}
204+
blockquote p:last-child {
205+
margin-bottom: 0;
206+
}
207+
blockquote small {
208+
display: block;
209+
line-height: 1.428571429;
210+
color: #999;
125211
}
126212

127213
/* Make the table under the tutorial's 'Types' section look nicer */
128214
table {
129-
border-top: 1px solid silver;
130-
border-bottom: 1px solid silver;
131-
padding: 0.8em;
132-
font-size: smaller;
215+
border-top: 1px solid silver;
216+
border-bottom: 1px solid silver;
217+
padding: 0.8em;
218+
font-size: smaller;
133219
}
134220
/* Also for the benefit of the type table */
135221
td {
136-
padding-right: 1em;
222+
padding-right: 1em;
137223
}
138224

139-
/* Only display one level of hierarchy in the TOC */
140-
#TOC ul ul {
141-
display: none;
225+
ul,
226+
ol {
227+
margin-top: 0;
228+
margin-bottom: 10px;
229+
}
230+
ul ul,
231+
ol ul,
232+
ul ol,
233+
ol ol {
234+
margin-bottom: 0;
235+
}
236+
dl {
237+
margin-bottom: 20px;
238+
}
239+
dd {
240+
margin-left: 0;
142241
}
143242

144243
#TOC ul {
145-
list-style: none;
146-
padding-left: 0px;
244+
list-style-type: none;
245+
padding-left: 0px;
246+
}
247+
/* Only display one level of hierarchy in the TOC */
248+
#TOC ul ul {
249+
display: none;
147250
}
148251

149252
/* Adjust list alignment so rustdoc indexes don't align with blockquotes */
150253
div.index ul {
151-
padding-left: 1em;
254+
padding-left: 1em;
152255
}
153256

154-
ul {
155-
margin-top: 0em
257+
div.section.level3 {
258+
margin-left: 1em;
156259
}
157260

158-
div.section.level3 {
159-
margin-left: 1.0em;
261+
sub,
262+
sup {
263+
font-size: 75%;
264+
line-height: 0;
265+
position: relative;
160266
}
267+
268+
hr {
269+
margin-top: 20px;
270+
margin-bottom: 20px;
271+
border: 0;
272+
border-top: 1px solid #eeeeee;
273+
}
274+
275+
@media print {
276+
* {
277+
text-shadow: none !important;
278+
color: #000 !important;
279+
background: transparent !important;
280+
box-shadow: none !important;
281+
}
282+
a, a:visited {
283+
text-decoration: underline;
284+
}
285+
a[href]:after {
286+
content: " (" attr(href) ")";
287+
}
288+
a[href^="javascript:"]:after, a[href^="#"]:after {
289+
content: "";
290+
}
291+
pre, blockquote {
292+
border: 1px solid #999;
293+
page-break-inside: avoid;
294+
}
295+
@page {
296+
margin: 2cm .5cm;
297+
}
298+
p, h2, h3 {
299+
orphans: 3;
300+
widows: 3;
301+
}
302+
h2, h3 {
303+
page-break-after: avoid;
304+
}
305+
table {
306+
border-collapse: collapse !important;
307+
}
308+
table td, table th {
309+
background-color: #fff !important;
310+
}
311+
}

0 commit comments

Comments
 (0)