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