]> git.lizzy.rs Git - rust.git/blob - src/doc/rust.css
Rollup merge of #28878 - sourcefrog:doc-links, r=steveklabnik
[rust.git] / src / doc / rust.css
1 /**
2  * Copyright 2013-2014 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.2 (MIT 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 @font-face {
14     font-family: 'Fira Sans';
15     font-style: normal;
16     font-weight: 400;
17     src: local('Fira Sans'), url("FiraSans-Regular.woff") format('woff');
18 }
19 @font-face {
20     font-family: 'Fira Sans';
21     font-style: normal;
22     font-weight: 500;
23     src: local('Fira Sans Medium'), url("FiraSans-Medium.woff") format('woff');
24 }
25 @font-face {
26     font-family: 'Source Serif Pro';
27     font-style: normal;
28     font-weight: 400;
29     src: local('Source Serif Pro'), url("SourceSerifPro-Regular.woff") format('woff');
30 }
31 @font-face {
32     font-family: 'Source Serif Pro';
33     font-style: italic;
34     font-weight: 400;
35     src: url("Heuristica-Italic.woff") format('woff');
36 }
37 @font-face {
38     font-family: 'Source Serif Pro';
39     font-style: normal;
40     font-weight: 700;
41     src: local('Source Serif Pro Bold'), url("SourceSerifPro-Bold.woff") format('woff');
42 }
43 @font-face {
44     font-family: 'Source Code Pro';
45     font-style: normal;
46     font-weight: 400;
47     src: local('Source Code Pro'), url("SourceCodePro-Regular.woff") format('woff');
48 }
49
50 *:not(body) {
51   -webkit-box-sizing: border-box;
52      -moz-box-sizing: border-box;
53           box-sizing: border-box;
54 }
55
56 /* General structure */
57
58 body {
59     background-color: white;
60     margin: 0 auto;
61     padding: 0 15px;
62     font-family: "Source Serif Pro", Georgia, Times, "Times New Roman", serif;
63     font-size: 18px;
64     color: #333;
65     line-height: 1.428571429;
66
67     -webkit-font-feature-settings: "kern", "liga";
68     -moz-font-feature-settings: "kern", "liga";
69     font-feature-settings: "kern", "liga";
70 }
71 @media (min-width: 768px) {
72     body {
73         max-width: 750px;
74     }
75 }
76
77 h1, h2, h3, h4, h5, h6, nav, #versioninfo {
78     font-family: "Fira Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
79 }
80 h1, h2, h3, h4, h5, h6 {
81     color: black;
82     font-weight: 400;
83     line-height: 1.1;
84 }
85 h1, h2, h3 {
86     margin-top: 20px;
87     margin-bottom: 15px;
88 }
89 h1 {
90     margin-bottom: 20px;
91 }
92 h4, h5, h6 {
93     margin-top: 12px;
94     margin-bottom: 10px;
95     padding: 5px 10px;
96 }
97 h5, h6 {
98     text-decoration: underline;
99 }
100
101 h1 {
102     font-size: 28px;
103     font-weight: 500;
104     padding: .1em .4em;
105     border-bottom: 2px solid #ddd;
106 }
107 h1.title {
108     line-height: 1.5em;
109 }
110 h2 {
111     font-size: 26px;
112     padding: .2em .5em;
113     border-bottom: 1px solid #ddd;
114 }
115 h3 {
116     font-size: 24px;
117     padding: .2em .7em;
118     border-bottom: 1px solid #DDE8FC;
119 }
120 h4 {
121     font-size: 22px;
122 }
123 h5 {
124     font-size: 20px;
125 }
126 h6 {
127     font-size: 18px;
128 }
129 @media (min-width: 992px) {
130     h1 {
131         font-size: 36px;
132     }
133     h2 {
134         font-size: 30px;
135     }
136     h3 {
137         font-size: 26px;
138     }
139 }
140
141 nav {
142     column-count: 2;
143     -moz-column-count: 2;
144     -webkit-column-count: 2;
145     font-size: 15px;
146     margin: 0 0 1em 0;
147 }
148 p {
149     margin: 0 0 1em 0;
150 }
151
152 strong {
153     font-weight: bold;
154 }
155
156 em {
157     font-style: italic;
158 }
159
160 footer {
161     border-top: 1px solid #ddd;
162     font-size: 14.3px;
163     font-style: italic;
164     padding-top: 5px;
165     margin-top: 3em;
166     margin-bottom: 1em;
167 }
168
169 /* Links layout */
170
171 a {
172     text-decoration: none;
173     color: #428BCA;
174     background: transparent;
175 }
176 a:hover, a:focus {
177     color: #2A6496;
178     text-decoration: underline;
179 }
180 a:focus {
181     outline: thin dotted #333;
182     outline: 5px auto -webkit-focus-ring-color;
183     outline-offset: -2px;
184 }
185 a:hover, a:active {
186     outline: 0;
187 }
188
189 h1 a:link, h1 a:visited, h2 a:link, h2 a:visited,
190 h3 a:link, h3 a:visited, h4 a:link, h4 a:visited,
191 h5 a:link, h5 a:visited {color: black;}
192 h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover,
193 h5 a:hover {text-decoration: none;}
194
195 /* Code */
196
197 pre, code {
198     font-family: "Source Code Pro", Menlo, Monaco, Consolas, "DejaVu Sans Mono", monospace;
199     word-wrap: break-word;
200 }
201 pre {
202     border-left: 2px solid #eee;
203     white-space: pre-wrap;
204     padding: 14px;
205     padding-right: 0;
206     margin: 20px 0;
207     font-size: 13px;
208     word-break: break-all;
209 }
210 code {
211     padding: 0 2px;
212     color: #8D1A38;
213 }
214 pre code {
215     padding: 0;
216     font-size: inherit;
217     color: inherit;
218 }
219
220 a > code {
221     color: #428BCA;
222 }
223
224 .section-header > a > code {
225     color: #8D1A38;
226 }
227
228 /* Code highlighting */
229 pre.rust .kw { color: #8959A8; }
230 pre.rust .kw-2, pre.rust .prelude-ty { color: #4271AE; }
231 pre.rust .number, pre.rust .string { color: #718C00; }
232 pre.rust .self, pre.rust .boolval, pre.rust .prelude-val,
233 pre.rust .attribute, pre.rust .attribute .ident { color: #C82829; }
234 pre.rust .comment { color: #8E908C; }
235 pre.rust .doccomment { color: #4D4D4C; }
236 pre.rust .macro, pre.rust .macro-nonterminal { color: #3E999F; }
237 pre.rust .lifetime { color: #B76514; }
238
239 /* The rest */
240
241 #versioninfo {
242     text-align: center;
243     margin: 0.5em;
244     font-size: 1.1em;
245 }
246 @media (min-width: 992px) {
247     #versioninfo {
248         font-size: 0.8em;
249         position: fixed;
250         bottom: 0px;
251         right: 0px;
252     }
253     .white-sticker {
254         background-color: #fff;
255         margin: 2px;
256         padding: 0 2px;
257         border-radius: .2em;
258     }
259 }
260 #versioninfo a.hash {
261     color: gray;
262     font-size: 80%;
263 }
264
265 blockquote {
266     color: #000;
267     margin: 20px 0;
268     padding: 15px 20px;
269     background-color: #f2f7f9;
270     border-top: .1em solid #e5eef2;
271     border-bottom: .1em solid #e5eef2;
272 }
273 blockquote p {
274     font-size: 17px;
275     font-weight: 300;
276     line-height: 1.4;
277 }
278 blockquote p:last-child {
279     margin-bottom: 0;
280 }
281
282 ul, ol {
283     padding-left: 25px;
284 }
285 ul ul, ol ul, ul ol, ol ol {
286     margin-bottom: 0;
287 }
288 dl {
289     margin-bottom: 20px;
290 }
291 dd {
292     margin-left: 0;
293 }
294
295 nav ul {
296     list-style-type: none;
297     margin: 0;
298     padding-left: 0px;
299 }
300
301 /* Only display one level of hierarchy in the TOC */
302 nav ul ul {
303     display: none;
304 }
305
306 sub,
307 sup {
308     font-size: 75%;
309     line-height: 0;
310     position: relative;
311 }
312
313 hr {
314     margin-top: 20px;
315     margin-bottom: 20px;
316     border: 0;
317     border-top: 1px solid #eeeeee;
318 }
319
320 table {
321     border-collapse: collapse;
322     border-spacing: 0;
323     overflow-x: auto;
324     display: block;
325 }
326
327 table tr.odd {
328     background: #eee;
329 }
330
331 table td,
332 table th {
333     border: 1px solid #ddd;
334     padding: 5px;
335 }
336
337 /* Code snippets */
338
339 .rusttest { display: none; }
340 pre.rust { position: relative; }
341 .test-arrow {
342     display: inline-block;
343     position: absolute;
344     top: 0;
345     right: 10px;
346     font-size: 150%;
347     -webkit-transform: scaleX(-1);
348     transform: scaleX(-1);
349 }
350
351 .unstable-feature {
352     border: 2px solid red;
353     padding: 5px;
354 }
355
356 @media (min-width: 1170px) {
357     pre {
358         font-size: 15px;
359     }
360 }
361
362 @media print {
363     * {
364         text-shadow: none !important;
365         color: #000 !important;
366         background: transparent !important;
367         box-shadow: none !important;
368     }
369     a, a:visited {
370         text-decoration: underline;
371     }
372     p a[href]:after {
373         content: " (" attr(href) ")";
374     }
375     footer a[href]:after {
376         content: "";
377     }
378     a[href^="javascript:"]:after, a[href^="#"]:after {
379         content: "";
380     }
381     pre, blockquote {
382         border: 1px solid #999;
383         page-break-inside: avoid;
384     }
385     @page {
386         margin: 2cm .5cm;
387     }
388     h1:not(.title), h2, h3 {
389         border-bottom: 0px none;
390     }
391     p, h2, h3 {
392         orphans: 3;
393         widows: 3;
394     }
395     h2, h3 {
396         page-break-after: avoid;
397     }
398     table {
399         border-collapse: collapse !important;
400     }
401     table td, table th {
402         background-color: #fff !important;
403     }
404 }
405
406 #keyword-table-marker + table thead { display: none; }
407 #keyword-table-marker + table td { border: none; }
408 #keyword-table-marker + table {
409     margin-left: 2em;
410     margin-bottom: 1em;
411 }