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