]> git.lizzy.rs Git - rust.git/blob - src/librustdoc/html/static/rustdoc.css
Rollup merge of #41910 - mersinvald:master, r=Mark-Simulacrum
[rust.git] / src / librustdoc / html / static / rustdoc.css
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  *
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 /* See FiraSans-LICENSE.txt for the Fira Sans license. */
14 @font-face {
15         font-family: 'Fira Sans';
16         font-style: normal;
17         font-weight: 400;
18         src: local('Fira Sans'), url("FiraSans-Regular.woff") format('woff');
19 }
20 @font-face {
21         font-family: 'Fira Sans';
22         font-style: normal;
23         font-weight: 500;
24         src: local('Fira Sans Medium'), url("FiraSans-Medium.woff") format('woff');
25 }
26
27 /* See SourceSerifPro-LICENSE.txt for the Source Serif Pro license and
28  * Heuristica-LICENSE.txt for the Heuristica license. */
29 @font-face {
30         font-family: 'Source Serif Pro';
31         font-style: normal;
32         font-weight: 400;
33         src: local('Source Serif Pro'), url("SourceSerifPro-Regular.woff") format('woff');
34 }
35 @font-face {
36         font-family: 'Source Serif Pro';
37         font-style: italic;
38         font-weight: 400;
39         src: url("Heuristica-Italic.woff") format('woff');
40 }
41 @font-face {
42         font-family: 'Source Serif Pro';
43         font-style: normal;
44         font-weight: 700;
45         src: local('Source Serif Pro Bold'), url("SourceSerifPro-Bold.woff") format('woff');
46 }
47
48 /* See SourceCodePro-LICENSE.txt for the Source Code Pro license. */
49 @font-face {
50         font-family: 'Source Code Pro';
51         font-style: normal;
52         font-weight: 400;
53         /* Avoid using locally installed font because bad versions are in circulation:
54          * see https://github.com/rust-lang/rust/issues/24355 */
55         src: url("SourceCodePro-Regular.woff") format('woff');
56 }
57 @font-face {
58         font-family: 'Source Code Pro';
59         font-style: normal;
60         font-weight: 600;
61         src: url("SourceCodePro-Semibold.woff") format('woff');
62 }
63
64 * {
65   -webkit-box-sizing: border-box;
66          -moz-box-sizing: border-box;
67                   box-sizing: border-box;
68 }
69
70 /* General structure and fonts */
71
72 body {
73         font: 16px/1.4 "Source Serif Pro", Georgia, Times, "Times New Roman", serif;
74         margin: 0;
75         position: relative;
76         padding: 10px 15px 20px 15px;
77
78         -webkit-font-feature-settings: "kern", "liga";
79         -moz-font-feature-settings: "kern", "liga";
80         font-feature-settings: "kern", "liga";
81 }
82
83 h1 {
84         font-size: 1.5em;
85 }
86 h2 {
87         font-size: 1.4em;
88 }
89 h3 {
90         font-size: 1.3em;
91 }
92 h1, h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod):not(.associatedconstant) {
93         font-weight: 500;
94         margin: 20px 0 15px 0;
95         padding-bottom: 6px;
96 }
97 h1.fqn {
98         border-bottom: 1px dashed;
99         margin-top: 0;
100         position: relative;
101 }
102 h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod):not(.associatedconstant) {
103         border-bottom: 1px solid;
104 }
105 h3.impl, h3.method, h4.method, h3.type, h4.type, h4.associatedconstant {
106         font-weight: 600;
107         margin-top: 10px;
108         margin-bottom: 10px;
109         position: relative;
110 }
111 h3.impl, h3.method, h3.type {
112         margin-top: 15px;
113 }
114 h1, h2, h3, h4, .sidebar, a.source, .search-input, .content table :not(code)>a, .collapse-toggle {
115         font-family: "Fira Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
116 }
117
118 ol, ul {
119         padding-left: 25px;
120 }
121 ul ul, ol ul, ul ol, ol ol {
122         margin-bottom: 0;
123 }
124
125 p {
126         margin: 0 0 .6em 0;
127 }
128
129 code, pre {
130         font-family: "Source Code Pro", Menlo, Monaco, Consolas, "DejaVu Sans Mono", Inconsolata, monospace;
131         white-space: pre-wrap;
132 }
133 .docblock code, .docblock-short code {
134         border-radius: 3px;
135         padding: 0 0.2em;
136 }
137 .docblock pre code, .docblock-short pre code {
138         padding: 0;
139 }
140 pre {
141         padding: 14px;
142 }
143
144 .source .content pre {
145         padding: 20px;
146 }
147
148 img {
149         max-width: 100%;
150 }
151
152 .source .content {
153         margin-top: 50px;
154         max-width: none;
155         overflow: visible;
156         margin-left: 0px;
157         min-width: 70em;
158 }
159
160 nav.sub {
161         font-size: 16px;
162         text-transform: uppercase;
163 }
164
165 .sidebar {
166         width: 200px;
167         position: absolute;
168         left: 0;
169         top: 0;
170         min-height: 100%;
171 }
172
173 .sidebar .current {
174         margin-right: -20px;
175 }
176
177 .content, nav { max-width: 960px; }
178
179 /* Everything else */
180
181 .js-only, .hidden { display: none !important; }
182
183 .sidebar {
184         padding: 10px;
185 }
186 .sidebar img {
187         margin: 20px auto;
188         display: block;
189 }
190
191 .sidebar .location {
192         border: 1px solid;
193         font-size: 17px;
194         margin: 30px 0 20px 0;
195         text-align: center;
196         word-wrap: break-word;
197 }
198
199 .location:empty {
200         border: none;
201 }
202
203 .location a:first-child { font-weight: 500; }
204
205 .block {
206         padding: 0 10px;
207         margin-bottom: 14px;
208 }
209 .block h2, .block h3 {
210         margin-top: 0;
211         margin-bottom: 8px;
212         text-align: center;
213 }
214 .block ul, .block li {
215         margin: 0;
216         padding: 0;
217         list-style: none;
218 }
219
220 .block a {
221         display: block;
222         text-overflow: ellipsis;
223         overflow: hidden;
224         line-height: 15px;
225         padding: 7px 5px;
226         font-size: 14px;
227         font-weight: 300;
228         transition: border 500ms ease-out;
229 }
230
231 .content {
232         padding: 15px 0;
233 }
234
235 .source .content pre.rust {
236         white-space: pre;
237         overflow: auto;
238         padding-left: 0;
239 }
240 #search {
241         margin-left: 230px;
242 }
243 .content pre.line-numbers {
244         float: left;
245         border: none;
246         position: relative;
247
248         -webkit-user-select: none;
249         -moz-user-select: none;
250         -ms-user-select: none;
251         user-select: none;
252 }
253 .line-numbers span { cursor: pointer; }
254
255 .docblock-short p {
256         display: inline;
257 }
258
259 .docblock-short.nowrap {
260         display: block;
261         overflow: hidden;
262         white-space: nowrap;
263         text-overflow: ellipsis;
264 }
265
266 .docblock-short p {
267         overflow: hidden;
268         text-overflow: ellipsis;
269         margin: 0;
270 }
271 .docblock-short code { white-space: nowrap; }
272
273 .docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5 {
274         border-bottom: 1px solid;
275 }
276
277 .docblock h1 { font-size: 1.3em; }
278 .docblock h2 { font-size: 1.15em; }
279 .docblock h3, .docblock h4, .docblock h5 { font-size: 1em; }
280
281 .docblock {
282         margin-left: 24px;
283 }
284
285 .content .out-of-band {
286         font-size: 23px;
287         margin: 0px;
288         padding: 0px;
289         text-align: right;
290         display: inline-block;
291         font-weight: normal;
292         position: absolute;
293         right: 0;
294 }
295
296 h3.impl > .out-of-band {
297         font-size: 21px;
298 }
299
300 h4 > code, h3 > code, .invisible > code {
301         position: inherit;
302 }
303
304 .in-band, code {
305         z-index: 5;
306 }
307
308 .invisible {
309         background: rgba(0, 0, 0, 0);
310         width: 100%;
311         display: inline-block;
312 }
313
314 .content .in-band {
315         margin: 0px;
316         padding: 0px;
317         display: inline-block;
318 }
319
320 #main { position: relative; }
321 #main > .since {
322         top: inherit;
323         font-family: "Fira Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
324 }
325
326 .content table {
327         border-spacing: 0 5px;
328         border-collapse: separate;
329 }
330 .content td { vertical-align: top; }
331 .content td:first-child { padding-right: 20px; }
332 .content td p:first-child { margin-top: 0; }
333 .content td h1, .content td h2 { margin-left: 0; font-size: 1.1em; }
334
335 .docblock table {
336         border: 1px solid;
337         margin: .5em 0;
338         border-collapse: collapse;
339         width: 100%;
340 }
341
342 .docblock table td {
343         padding: .5em;
344         border-top: 1px dashed;
345         border-bottom: 1px dashed;
346 }
347
348 .docblock table th {
349         padding: .5em;
350         text-align: left;
351         border-top: 1px solid;
352         border-bottom: 1px solid;
353 }
354
355 .fields + table {
356         margin-bottom: 1em;
357 }
358
359 .content .item-list {
360         list-style-type: none;
361         padding: 0;
362 }
363
364 .content .item-list li { margin-bottom: 3px; }
365
366 .content .multi-column {
367         -moz-column-count: 5;
368         -moz-column-gap: 2.5em;
369         -webkit-column-count: 5;
370         -webkit-column-gap: 2.5em;
371         column-count: 5;
372         column-gap: 2.5em;
373 }
374 .content .multi-column li { width: 100%; display: inline-block; }
375
376 .content .method {
377         font-size: 1em;
378         position: relative;
379 }
380 /* Shift "where ..." part of method or fn definition down a line */
381 .content .method .where,
382 .content .fn .where,
383 .content .where.fmt-newline {
384         display: block;
385 }
386
387 .content .methods > div { margin-left: 40px; }
388
389 .content .impl-items .docblock, .content .impl-items .stability {
390         margin-left: 40px;
391 }
392 .content .impl-items .method, .content .impl-items > .type, .impl-items > .associatedconstant {
393         margin-left: 20px;
394 }
395
396 .content .stability code {
397         font-size: 90%;
398 }
399
400 nav {
401         border-bottom: 1px solid;
402         padding-bottom: 10px;
403         margin-bottom: 10px;
404 }
405 nav.main {
406         padding: 20px 0;
407         text-align: center;
408 }
409 nav.main .current {
410         border-top: 1px solid;
411         border-bottom: 1px solid;
412 }
413 nav.main .separator {
414         border: 1px solid;
415         display: inline-block;
416         height: 23px;
417         margin: 0 20px;
418 }
419 nav.sum { text-align: right; }
420 nav.sub form { display: inline; }
421
422 nav.sub, .content {
423         margin-left: 230px;
424 }
425
426 a {
427         text-decoration: none;
428         background: transparent;
429 }
430
431 .docblock a:hover, .docblock-short a:hover, .stability a {
432         text-decoration: underline;
433 }
434
435 .content span.enum, .content a.enum, .block a.current.enum { color: #5e9766; }
436 .content span.struct, .content a.struct, .block a.current.struct { color: #df3600; }
437 .content span.type, .content a.type, .block a.current.type { color: #e57300; }
438 .content span.macro, .content a.macro, .block a.current.macro { color: #068000; }
439 .block a.current.crate { font-weight: 500; }
440
441 .search-input {
442         width: 100%;
443         /* Override Normalize.css: we have margins and do
444          not want to overflow - the `moz` attribute is necessary
445          until Firefox 29, too early to drop at this point */
446         -moz-box-sizing: border-box !important;
447         box-sizing: border-box !important;
448         outline: none;
449         border: none;
450         border-radius: 1px;
451         margin-top: 5px;
452         padding: 10px 16px;
453         font-size: 17px;
454         transition: border-color 300ms ease;
455         transition: border-radius 300ms ease-in-out;
456         transition: box-shadow 300ms ease-in-out;
457 }
458
459 .search-input:focus {
460         border-color: #66afe9;
461         border-radius: 2px;
462         border: 0;
463         outline: 0;
464         box-shadow: 0 0 8px #078dd8;
465 }
466
467 .search-results .desc {
468         white-space: nowrap;
469         text-overflow: ellipsis;
470         overflow: hidden;
471         display: block;
472 }
473
474 .search-results a {
475         display: block;
476 }
477
478 .content .search-results td:first-child { padding-right: 0; }
479 .content .search-results td:first-child a { padding-right: 10px; }
480
481 tr.result span.primitive::after { content: ' (primitive type)'; font-style: italic; color: black;
482 }
483
484 body.blur > :not(#help) {
485         filter: blur(8px);
486         -webkit-filter: blur(8px);
487         opacity: .7;
488 }
489
490 #help {
491         width: 100%;
492         height: 100vh;
493         position: fixed;
494         top: 0;
495         left: 0;
496         display: flex;
497         justify-content: center;
498         align-items: center;
499 }
500 #help > div {
501         flex: 0 0 auto;
502         box-shadow: 0 0 6px rgba(0,0,0,.2);
503         width: 550px;
504         height: 330px;
505         border: 1px solid;
506 }
507 #help dt {
508         float: left;
509         border-radius: 4px;
510         border: 1px solid;
511         width: 23px;
512         text-align: center;
513         clear: left;
514         display: block;
515         margin-top: -1px;
516 }
517 #help dd { margin: 5px 33px; }
518 #help .infos { padding-left: 0; }
519 #help h1, #help h2 { margin-top: 0; }
520 #help > div div {
521         width: 50%;
522         float: left;
523         padding: 20px;
524 }
525
526 .stab {
527         display: table;
528         border-width: 1px;
529         border-style: solid;
530         padding: 3px;
531         margin-bottom: 5px;
532         font-size: 90%;
533 }
534 .stab p {
535         display: inline;
536 }
537
538 .stab summary {
539         display: list-item;
540 }
541
542 .stab .microscope {
543         font-size: 1.5em;
544 }
545
546 .module-item .stab {
547         display: inline;
548         border-width: 0;
549         padding: 0;
550         margin: 0;
551         background: inherit !important;
552 }
553
554 .module-item.unstable {
555         opacity: 0.65;
556 }
557
558 .since {
559         font-weight: normal;
560         font-size: initial;
561         position: absolute;
562         right: 0;
563         top: 0;
564 }
565
566 .variants_table {
567         width: 100%;
568 }
569
570 .variants_table tbody tr td:first-child {
571         width: 1%; /* make the variant name as small as possible */
572 }
573
574 td.summary-column {
575         width: 100%;
576 }
577
578 .summary {
579         padding-right: 0px;
580 }
581
582 pre.rust .question-mark {
583         font-weight: bold;
584 }
585
586 pre.rust { position: relative; }
587 a.test-arrow {
588         display: inline-block;
589         position: absolute;
590         padding: 5px 10px 5px 10px;
591         border-radius: 5px;
592         font-size: 130%;
593         top: 5px;
594         right: 5px;
595 }
596 a.test-arrow:hover{
597         text-decoration: none;
598 }
599
600 .section-header:hover a:after {
601         content: '\2002\00a7\2002';
602 }
603
604 .section-header:hover a {
605         text-decoration: none;
606 }
607
608 .section-header a {
609         color: inherit;
610 }
611
612 .collapse-toggle {
613         font-weight: 300;
614         position: absolute;
615         left: -23px;
616         color: #999;
617         top: 0;
618 }
619
620 h3 > .collapse-toggle, h4 > .collapse-toggle {
621         font-size: 0.8em;
622         top: 5px;
623 }
624
625 .toggle-wrapper > .collapse-toggle {
626         left: -24px;
627         margin-top: 0px;
628 }
629
630 .toggle-wrapper {
631         position: relative;
632 }
633
634 .toggle-wrapper.collapsed {
635         height: 1em;
636         transition: height .2s;
637 }
638
639 .collapse-toggle > .inner {
640         display: inline-block;
641         width: 1.2ch;
642         text-align: center;
643 }
644
645 .ghost {
646         display: none;
647 }
648
649 .ghost + .since {
650         position: initial;
651         display: table-cell;
652 }
653
654 .since + .srclink {
655         display: table-cell;
656         padding-left: 10px;
657 }
658
659 span.since {
660         position: initial;
661         font-size: 20px;
662         margin-right: 5px;
663 }
664
665 .toggle-wrapper > .collapse-toggle {
666         left: 0;
667 }
668
669 .variant + .toggle-wrapper > a {
670         margin-top: 5px;
671 }
672
673 .sub-variant, .sub-variant > h3 {
674         margin-top: 0 !important;
675 }
676
677 .enum > .toggle-wrapper + .docblock, .struct > .toggle-wrapper + .docblock {
678         margin-left: 30px;
679         margin-bottom: 20px;
680         margin-top: 5px;
681 }
682
683 .enum > .collapsed, .struct > .collapsed {
684         margin-bottom: 25px;
685 }
686
687 .enum .variant, .struct .structfield {
688         display: block;
689 }
690
691 .attributes {
692         display: block;
693         margin: 0px 0px 0px 30px !important;
694 }
695 .toggle-attributes.collapsed {
696         margin-bottom: 5px;
697 }
698
699 :target > code {
700         opacity: 1;
701 }
702
703 /* Media Queries */
704
705 @media (max-width: 700px) {
706         body {
707                 padding-top: 0px;
708         }
709
710         .sidebar {
711                 height: 40px;
712                 min-height: 40px;
713                 width: 100%;
714                 margin: 0px;
715                 padding: 0px;
716                 position: static;
717         }
718
719         .sidebar .location {
720                 float: right;
721                 margin: 0px;
722                 padding: 3px 10px 1px 10px;
723                 min-height: 39px;
724                 background: inherit;
725                 text-align: left;
726                 font-size: 24px;
727         }
728
729         .sidebar .location:empty {
730                 padding: 0;
731         }
732
733         .sidebar img {
734                 width: 35px;
735                 margin-top: 5px;
736                 margin-bottom: 0px;
737                 float: left;
738         }
739
740         nav.sub {
741                 margin: 0 auto;
742         }
743
744         .sidebar .block {
745                 display: none;
746         }
747
748         .content {
749                 margin-left: 0px;
750         }
751
752         .content .in-band {
753                 width: 100%;
754         }
755
756         .content .out-of-band {
757                 display: none;
758         }
759
760         .toggle-wrapper > .collapse-toggle {
761                 left: 0px;
762         }
763
764         .toggle-wrapper {
765                 height: 1.5em;
766         }
767 }
768
769 @media print {
770         nav.sub, .content .out-of-band, .collapse-toggle {
771                 display: none;
772         }
773 }