]> git.lizzy.rs Git - rust.git/blob - src/librustdoc/html/static/rustdoc.css
Auto merge of #77853 - ijackson:slice-strip-stab, r=Amanieu
[rust.git] / src / librustdoc / html / static / rustdoc.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'), url("FiraSans-Regular.woff") format('woff');
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 }
14
15 /* See SourceSerifPro-LICENSE.txt for the Source Serif Pro license. */
16 @font-face {
17         font-family: 'Source Serif Pro';
18         font-style: normal;
19         font-weight: 400;
20         src: local('Source Serif Pro'), url("SourceSerifPro-Regular.ttf.woff") format('woff');
21 }
22 @font-face {
23         font-family: 'Source Serif Pro';
24         font-style: italic;
25         font-weight: 400;
26         src: local('Source Serif Pro Italic'), url("SourceSerifPro-It.ttf.woff") format('woff');
27 }
28 @font-face {
29         font-family: 'Source Serif Pro';
30         font-style: normal;
31         font-weight: 700;
32         src: local('Source Serif Pro Bold'), url("SourceSerifPro-Bold.ttf.woff") format('woff');
33 }
34
35 /* See SourceCodePro-LICENSE.txt for the Source Code Pro license. */
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 }
44 @font-face {
45         font-family: 'Source Code Pro';
46         font-style: normal;
47         font-weight: 600;
48         src: url("SourceCodePro-Semibold.woff") format('woff');
49 }
50
51 * {
52         -webkit-box-sizing: border-box;
53         -moz-box-sizing: border-box;
54         box-sizing: border-box;
55 }
56
57 /* This part handles the "default" theme being used depending on the system one. */
58 html {
59         content: "";
60 }
61 @media (prefers-color-scheme: light) {
62         html {
63                 content: "light";
64         }
65 }
66 @media (prefers-color-scheme: dark) {
67         html {
68                 content: "dark";
69         }
70 }
71
72 /* General structure and fonts */
73
74 body {
75         font: 16px/1.4 "Source Serif Pro", serif;
76         margin: 0;
77         position: relative;
78         padding: 10px 15px 20px 15px;
79
80         -webkit-font-feature-settings: "kern", "liga";
81         -moz-font-feature-settings: "kern", "liga";
82         font-feature-settings: "kern", "liga";
83 }
84
85 h1 {
86         font-size: 1.5em;
87 }
88 h2 {
89         font-size: 1.4em;
90 }
91 h3 {
92         font-size: 1.3em;
93 }
94 h1, h2, h3:not(.impl):not(.method):not(.type):not(.tymethod):not(.notable),
95 h4:not(.method):not(.type):not(.tymethod):not(.associatedconstant) {
96         font-weight: 500;
97         margin: 20px 0 15px 0;
98         padding-bottom: 6px;
99 }
100 h1.fqn {
101         border-bottom: 1px dashed;
102         margin-top: 0;
103 }
104 h1.fqn > .in-band > a:hover {
105         text-decoration: underline;
106 }
107 h2, h3:not(.impl):not(.method):not(.type):not(.tymethod),
108 h4:not(.method):not(.type):not(.tymethod):not(.associatedconstant) {
109         border-bottom: 1px solid;
110 }
111 h3.impl, h3.method, h4.method, h3.type, h4.type, h4.associatedconstant {
112         flex-basis: 100%;
113         font-weight: 600;
114         margin-top: 16px;
115         margin-bottom: 10px;
116         position: relative;
117 }
118 h3.impl, h3.method, h3.type {
119         padding-left: 15px;
120 }
121
122 h1, h2, h3, h4,
123 .sidebar, a.source, .search-input, .content table td:first-child > a,
124 .collapse-toggle, div.item-list .out-of-band,
125 #source-sidebar, #sidebar-toggle,
126 /* This selector is for the items listed in the "all items" page. */
127 #main > ul.docblock > li > a {
128         font-family: "Fira Sans", sans-serif;
129 }
130
131 .content ul.crate a.crate {
132         font: 16px/1.6 "Fira Sans";
133 }
134
135 ol, ul {
136         padding-left: 25px;
137 }
138 ul ul, ol ul, ul ol, ol ol {
139         margin-bottom: .6em;
140 }
141
142 p {
143         margin: 0 0 .6em 0;
144 }
145
146 summary {
147         outline: none;
148 }
149
150 code, pre, a.test-arrow {
151         font-family: "Source Code Pro", monospace;
152 }
153 .docblock code, .docblock-short code {
154         border-radius: 3px;
155         padding: 0 0.1em;
156 }
157 .docblock pre code, .docblock-short pre code, .docblock code.spotlight {
158         padding: 0;
159 }
160 .docblock code.spotlight :last-child {
161         padding-bottom: 0.6em;
162 }
163 pre {
164         padding: 14px;
165 }
166
167 .source .content pre {
168         padding: 20px;
169 }
170
171 img {
172         max-width: 100%;
173 }
174
175 li {
176         position: relative;
177 }
178
179 .source .content {
180         margin-top: 50px;
181         max-width: none;
182         overflow: visible;
183         margin-left: 0px;
184         min-width: 70em;
185 }
186
187 nav.sub {
188         font-size: 16px;
189         text-transform: uppercase;
190 }
191
192 .sidebar {
193         width: 200px;
194         position: fixed;
195         left: 0;
196         top: 0;
197         bottom: 0;
198         overflow: auto;
199 }
200
201 /* Improve the scrollbar display on firefox */
202 * {
203         scrollbar-width: initial;
204 }
205 .sidebar {
206         scrollbar-width: thin;
207 }
208
209 /* Improve the scrollbar display on webkit-based browsers */
210 ::-webkit-scrollbar {
211         width: 12px;
212 }
213 .sidebar::-webkit-scrollbar {
214         width: 8px;
215 }
216 ::-webkit-scrollbar-track {
217         -webkit-box-shadow: inset 0;
218 }
219
220 .sidebar .block > ul > li {
221         margin-right: -10px;
222 }
223
224 .content, nav {
225         max-width: 960px;
226 }
227
228 /* Everything else */
229
230 .hidden {
231         display: none !important;
232 }
233
234 .logo-container {
235         height: 100px;
236         width: 100px;
237         position: relative;
238         margin: 20px auto;
239         display: block;
240         margin-top: 10px;
241 }
242
243 .logo-container > img {
244         max-width: 100px;
245         max-height: 100px;
246         position: absolute;
247         left: 50%;
248         top: 50%;
249         transform: translate(-50%, -50%);
250         display: block;
251 }
252
253 .sidebar .location {
254         border: 1px solid;
255         font-size: 17px;
256         margin: 30px 10px 20px 10px;
257         text-align: center;
258         word-wrap: break-word;
259 }
260
261 .sidebar .version {
262         font-size: 15px;
263         text-align: center;
264         border-bottom: 1px solid;
265         overflow-wrap: break-word;
266         word-wrap: break-word; /* deprecated */
267         word-break: break-word; /* Chrome, non-standard */
268 }
269
270 .location:empty {
271         border: none;
272 }
273
274 .location a:first-child {
275         font-weight: 500;
276 }
277
278 .block {
279         padding: 0;
280         margin-bottom: 14px;
281 }
282 .block h2, .block h3 {
283         margin-top: 0;
284         margin-bottom: 8px;
285         text-align: center;
286 }
287 .block ul, .block li {
288         margin: 0 10px;
289         padding: 0;
290         list-style: none;
291 }
292
293 .block a {
294         display: block;
295         text-overflow: ellipsis;
296         overflow: hidden;
297         line-height: 15px;
298         padding: 7px 5px;
299         font-size: 14px;
300         font-weight: 300;
301         transition: border 500ms ease-out;
302 }
303
304 .sidebar-title {
305         border-top: 1px solid;
306         border-bottom: 1px solid;
307         text-align: center;
308         font-size: 17px;
309         margin-bottom: 5px;
310 }
311
312 .sidebar-links {
313         margin-bottom: 15px;
314 }
315
316 .sidebar-links > a {
317         padding-left: 10px;
318         width: 100%;
319 }
320
321 .sidebar-menu {
322         display: none;
323 }
324
325 .content {
326         padding: 15px 0;
327 }
328
329 .source .content pre.rust {
330         white-space: pre;
331         overflow: auto;
332         padding-left: 0;
333 }
334
335 .rustdoc:not(.source) .example-wrap {
336         display: inline-flex;
337         margin-bottom: 10px;
338         position: relative;
339 }
340
341 .example-wrap {
342         width: 100%;
343 }
344
345 .example-wrap > pre.line-number {
346         overflow: initial;
347         border: 1px solid;
348         border-top-left-radius: 5px;
349         border-bottom-left-radius: 5px;
350         padding: 13px 8px;
351         text-align: right;
352 }
353
354 .rustdoc:not(.source) .example-wrap > pre.rust {
355         width: 100%;
356         overflow-x: auto;
357 }
358
359 .rustdoc:not(.source) .example-wrap > pre {
360         margin: 0;
361 }
362
363 #search {
364         margin-left: 230px;
365         position: relative;
366 }
367
368 #results {
369         position: absolute;
370         right: 0;
371         left: 0;
372         overflow: auto;
373 }
374
375 #results > table {
376         width: 100%;
377         table-layout: fixed;
378         margin-bottom: 40px;
379 }
380
381 .content pre.line-numbers {
382         float: left;
383         border: none;
384         position: relative;
385
386         -webkit-user-select: none;
387         -moz-user-select: none;
388         -ms-user-select: none;
389         user-select: none;
390 }
391 .line-numbers span {
392         cursor: pointer;
393 }
394
395 .docblock-short {
396         overflow-wrap: anywhere;
397 }
398 .docblock-short p {
399         display: inline;
400 }
401
402 .docblock-short p {
403         overflow: hidden;
404         text-overflow: ellipsis;
405         margin: 0;
406 }
407 .docblock code, .docblock-short code {
408         white-space: pre-wrap;
409 }
410
411 .docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5 {
412         border-bottom: 1px solid;
413 }
414
415 #main > .docblock h1 { font-size: 1.3em; }
416 #main > .docblock h2 { font-size: 1.15em; }
417 #main > .docblock h3, #main > .docblock h4, #main > .docblock h5 { font-size: 1em; }
418
419 #main > h2 + div, #main > h2 + h3, #main > h3 + div {
420         display: none; /* Changed to flex or block via js once the page is loaded */
421         flex-wrap: wrap;
422 }
423
424 .docblock h1 { font-size: 1em; }
425 .docblock h2 { font-size: 0.95em; }
426 .docblock h3, .docblock h4, .docblock h5 { font-size: 0.9em; }
427
428 .docblock {
429         margin-left: 24px;
430         position: relative;
431 }
432
433 .content .out-of-band {
434         float: right;
435         font-size: 23px;
436         margin: 0px;
437         padding: 0px;
438         font-weight: normal;
439 }
440
441 h3.impl > .out-of-band {
442         font-size: 21px;
443 }
444
445 h4.method > .out-of-band {
446         font-size: 19px;
447 }
448
449 h4 > code, h3 > code, .invisible > code {
450         max-width: calc(100% - 41px);
451         display: block;
452 }
453
454 .invisible {
455         width: 100%;
456         display: inline-block;
457 }
458
459 .content .in-band {
460         margin: 0px;
461         padding: 0px;
462 }
463
464 .in-band > code {
465         display: inline-block;
466 }
467
468 #main {
469         position: relative;
470 }
471 #main > .since {
472         top: inherit;
473         font-family: "Fira Sans", sans-serif;
474 }
475
476 .content table:not(.table-display) {
477         border-spacing: 0 5px;
478 }
479 .content td { vertical-align: top; }
480 .content td:first-child { padding-right: 20px; }
481 .content td p:first-child { margin-top: 0; }
482 .content td h1, .content td h2 { margin-left: 0; font-size: 1.1em; }
483 .content tr:first-child td { border-top: 0; }
484
485 .docblock table {
486         margin: .5em 0;
487         width: calc(100% - 2px);
488         border: 1px dashed;
489 }
490
491 .docblock table td {
492         padding: .5em;
493         border: 1px dashed;
494 }
495
496 .docblock table th {
497         padding: .5em;
498         text-align: left;
499         border: 1px solid;
500 }
501
502 .fields + table {
503         margin-bottom: 1em;
504 }
505
506 .content .item-list {
507         list-style-type: none;
508         padding: 0;
509 }
510
511 .content .multi-column {
512         -moz-column-count: 5;
513         -moz-column-gap: 2.5em;
514         -webkit-column-count: 5;
515         -webkit-column-gap: 2.5em;
516         column-count: 5;
517         column-gap: 2.5em;
518 }
519 .content .multi-column li { width: 100%; display: inline-block; }
520
521 .content .method {
522         font-size: 1em;
523         position: relative;
524 }
525 /* Shift "where ..." part of method or fn definition down a line */
526 .content .method .where,
527 .content .fn .where,
528 .content .where.fmt-newline {
529         display: block;
530         font-size: 0.8em;
531 }
532
533 .content .methods > div:not(.notable-traits) {
534         margin-left: 40px;
535         margin-bottom: 15px;
536 }
537
538 .content .docblock > .impl-items {
539         margin-left: 20px;
540         margin-top: -34px;
541 }
542 .content .docblock > .impl-items > h4 {
543         border-bottom: 0;
544 }
545 .content .docblock >.impl-items .table-display {
546         margin: 0;
547 }
548 .content .docblock >.impl-items table td {
549         padding: 0;
550 }
551 .toggle-wrapper.marg-left > .collapse-toggle {
552         left: -24px;
553 }
554 .content .docblock > .impl-items .table-display, .impl-items table td {
555         border: none;
556 }
557
558 .content .item-info code {
559         font-size: 90%;
560 }
561
562 .content .item-info {
563         position: relative;
564         margin-left: 33px;
565         margin-top: -13px;
566 }
567
568 .sub-variant > div > .item-info {
569         margin-top: initial;
570 }
571
572 .content .item-info::before {
573         content: '⬑';
574         font-size: 25px;
575         position: absolute;
576         top: -6px;
577         left: -19px;
578 }
579
580 .content .impl-items .method, .content .impl-items > .type, .impl-items > .associatedconstant {
581         margin-left: 20px;
582 }
583
584 .content .impl-items .docblock, .content .impl-items .item-info {
585         margin-bottom: .6em;
586 }
587
588 .content .impl-items > .item-info {
589         margin-left: 40px;
590 }
591
592 .methods > .item-info, .content .impl-items > .item-info {
593         margin-top: -8px;
594 }
595
596 .impl-items {
597         flex-basis: 100%;
598 }
599
600 #main > .item-info {
601         margin-top: 0;
602 }
603
604 nav:not(.sidebar) {
605         border-bottom: 1px solid;
606         padding-bottom: 10px;
607         margin-bottom: 10px;
608 }
609 nav.main {
610         padding: 20px 0;
611         text-align: center;
612 }
613 nav.main .current {
614         border-top: 1px solid;
615         border-bottom: 1px solid;
616 }
617 nav.main .separator {
618         border: 1px solid;
619         display: inline-block;
620         height: 23px;
621         margin: 0 20px;
622 }
623 nav.sum { text-align: right; }
624 nav.sub form { display: inline; }
625
626 nav.sub, .content {
627         margin-left: 230px;
628 }
629
630 a {
631         text-decoration: none;
632         background: transparent;
633 }
634
635 .small-section-header:hover > .anchor {
636         display: initial;
637 }
638
639 .in-band:hover > .anchor, .impl:hover > .anchor {
640         display: inline-block;
641         position: absolute;
642 }
643 .anchor {
644         display: none;
645         position: absolute;
646         left: -7px;
647 }
648 .anchor.field {
649         left: -5px;
650 }
651 .small-section-header > .anchor {
652         left: -28px;
653         padding-right: 10px; /* avoid gap that causes hover to disappear */
654 }
655 .anchor:before {
656         content: '\2002\00a7\2002';
657 }
658
659 .docblock a:not(.srclink):not(.test-arrow):hover,
660 .docblock-short a:not(.srclink):not(.test-arrow):hover, .item-info a {
661         text-decoration: underline;
662 }
663
664 .invisible > .srclink, h4 > code + .srclink, h3 > code + .srclink {
665         position: absolute;
666         top: 0;
667         right: 0;
668         font-size: 17px;
669         font-weight: normal;
670 }
671
672 .block a.current.crate { font-weight: 500; }
673
674 .search-container {
675         position: relative;
676 }
677 .search-container > div {
678         display: inline-flex;
679         width: calc(100% - 63px);
680 }
681 #crate-search {
682         margin-top: 5px;
683         padding: 6px;
684         padding-right: 19px;
685         flex: none;
686         border: 0;
687         border-right: 0;
688         border-radius: 4px 0 0 4px;
689         outline: none;
690         cursor: pointer;
691         border-right: 1px solid;
692         -moz-appearance: none;
693         -webkit-appearance: none;
694         /* Removes default arrow from firefox */
695         text-indent: 0.01px;
696         text-overflow: "";
697         background-repeat: no-repeat;
698         background-color: transparent;
699         background-size: 20px;
700         background-position: calc(100% - 1px) 56%;
701 }
702 .search-container > .top-button {
703         position: absolute;
704         right: 0;
705         top: 10px;
706 }
707 .search-input {
708         /* Override Normalize.css: we have margins and do
709          not want to overflow - the `moz` attribute is necessary
710          until Firefox 29, too early to drop at this point */
711         -moz-box-sizing: border-box !important;
712         box-sizing: border-box !important;
713         outline: none;
714         border: none;
715         border-radius: 1px;
716         margin-top: 5px;
717         padding: 10px 16px;
718         font-size: 17px;
719         transition: border-color 300ms ease;
720         transition: border-radius 300ms ease-in-out;
721         transition: box-shadow 300ms ease-in-out;
722         width: 100%;
723 }
724
725 #crate-search + .search-input {
726         border-radius: 0 1px 1px 0;
727         width: calc(100% - 32px);
728 }
729
730 .search-input:focus {
731         border-radius: 2px;
732         border: 0;
733         outline: 0;
734 }
735
736 .search-results .desc {
737         white-space: nowrap;
738         text-overflow: ellipsis;
739         overflow: hidden;
740         display: block;
741 }
742
743 .search-results a {
744         display: block;
745 }
746
747 .content .search-results td:first-child {
748         padding-right: 0;
749         width: 50%;
750 }
751 .content .search-results td:first-child a {
752         padding-right: 10px;
753 }
754 .content .search-results td:first-child a:after {
755         clear: both;
756         content: "";
757         display: block;
758 }
759 .content .search-results td:first-child a span {
760         float: left;
761 }
762
763 tr.result span.primitive::after {
764         content: ' (primitive type)';
765         font-style: italic;
766 }
767
768 tr.result span.keyword::after {
769         content: ' (keyword)';
770         font-style: italic;
771 }
772
773 body.blur > :not(#help) {
774         filter: blur(8px);
775         -webkit-filter: blur(8px);
776         opacity: .7;
777 }
778
779 #help {
780         width: 100%;
781         height: 100vh;
782         position: fixed;
783         top: 0;
784         left: 0;
785         display: flex;
786         justify-content: center;
787         align-items: center;
788 }
789 #help > div {
790         flex: 0 0 auto;
791         box-shadow: 0 0 6px rgba(0,0,0,.2);
792         width: 550px;
793         height: auto;
794         border: 1px solid;
795 }
796 #help dt {
797         float: left;
798         clear: left;
799         display: block;
800 }
801 #help > div > span {
802         text-align: center;
803         display: block;
804         margin: 10px 0;
805         font-size: 18px;
806         border-bottom: 1px solid #ccc;
807         padding-bottom: 4px;
808         margin-bottom: 6px;
809 }
810 #help dd { margin: 5px 35px; }
811 #help .infos { padding-left: 0; }
812 #help h1, #help h2 { margin-top: 0; }
813 #help > div div {
814         width: 50%;
815         float: left;
816         padding: 0 20px 20px 17px;;
817 }
818
819 .stab {
820         display: table;
821         border-width: 1px;
822         border-style: solid;
823         padding: 3px;
824         margin-bottom: 5px;
825         font-size: 90%;
826 }
827 .stab p {
828         display: inline;
829 }
830
831 .stab summary {
832         display: list-item;
833 }
834
835 .stab .emoji {
836         font-size: 1.5em;
837 }
838
839 .module-item .stab {
840         border-radius: 3px;
841         display: inline-block;
842         font-size: 80%;
843         line-height: 1.2;
844         margin-bottom: 0;
845         margin-right: .3em;
846         padding: 2px;
847         vertical-align: text-bottom;
848 }
849
850 .module-item.unstable {
851         opacity: 0.65;
852 }
853
854 .since {
855         font-weight: normal;
856         font-size: initial;
857         position: absolute;
858         right: 0;
859         top: 0;
860 }
861
862 .impl-items .since, .impl .since, .methods .since {
863         flex-grow: 0;
864         padding-left: 12px;
865         padding-right: 2px;
866         position: initial;
867 }
868
869 .impl-items .srclink, .impl .srclink, .methods .srclink {
870         flex-grow: 0;
871         /* Override header settings otherwise it's too bold */
872         font-size: 17px;
873         font-weight: normal;
874 }
875
876 .impl-items code, .impl code, .methods code {
877         flex-grow: 1;
878 }
879
880 .impl-items h4, h4.impl, h3.impl, .methods h3 {
881         display: flex;
882         flex-basis: 100%;
883         font-size: 16px;
884         margin-bottom: 12px;
885         /* Push the src link out to the right edge consistently */
886         justify-content: space-between;
887 }
888
889 .variants_table {
890         width: 100%;
891 }
892
893 .variants_table tbody tr td:first-child {
894         width: 1%; /* make the variant name as small as possible */
895 }
896
897 td.summary-column {
898         width: 100%;
899 }
900
901 .summary {
902         padding-right: 0px;
903 }
904
905 pre.rust .question-mark {
906         font-weight: bold;
907 }
908
909 a.test-arrow {
910         display: inline-block;
911         position: absolute;
912         padding: 5px 10px 5px 10px;
913         border-radius: 5px;
914         font-size: 130%;
915         top: 5px;
916         right: 5px;
917         z-index: 1;
918 }
919 a.test-arrow:hover{
920         text-decoration: none;
921 }
922
923 .section-header:hover a:before {
924         position: absolute;
925         left: -25px;
926         padding-right: 10px; /* avoid gap that causes hover to disappear */
927         content: '\2002\00a7\2002';
928 }
929
930 .section-header:hover a {
931         text-decoration: none;
932 }
933
934 .section-header a {
935         color: inherit;
936 }
937
938 .collapse-toggle {
939         font-weight: 300;
940         position: absolute;
941         left: -23px;
942         top: 0;
943 }
944
945 h3 > .collapse-toggle, h4 > .collapse-toggle {
946         font-size: 0.8em;
947         top: 5px;
948 }
949
950 .toggle-wrapper > .collapse-toggle {
951         left: -24px;
952         margin-top: 0px;
953 }
954
955 .toggle-wrapper {
956         position: relative;
957         margin-top: 0;
958 }
959
960 .toggle-wrapper.collapsed {
961         height: 25px;
962         transition: height .2s;
963         margin-bottom: .6em;
964 }
965
966 .collapse-toggle > .inner {
967         display: inline-block;
968         width: 1.2ch;
969         text-align: center;
970 }
971
972 .collapse-toggle.hidden-default {
973         position: relative;
974         margin-left: 20px;
975 }
976
977 .since + .srclink {
978         display: table-cell;
979         padding-left: 10px;
980 }
981
982 .item-spacer {
983         width: 100%;
984         height: 12px;
985 }
986
987 .out-of-band > span.since {
988         position: initial;
989         font-size: 20px;
990         margin-right: 5px;
991 }
992
993 .toggle-wrapper > .collapse-toggle {
994         left: 0;
995 }
996
997 .variant + .toggle-wrapper + .docblock > p {
998         margin-top: 5px;
999 }
1000
1001 .sub-variant, .sub-variant > h3 {
1002         margin-top: 1px !important;
1003 }
1004
1005 #main > .sub-variant > h3 {
1006         font-size: 15px;
1007         margin-left: 25px;
1008         margin-bottom: 5px;
1009 }
1010
1011 .sub-variant > div {
1012         margin-left: 20px;
1013         margin-bottom: 10px;
1014 }
1015
1016 .sub-variant > div > span {
1017         display: block;
1018         position: relative;
1019 }
1020
1021 .toggle-label {
1022         display: inline-block;
1023         margin-left: 4px;
1024         margin-top: 3px;
1025 }
1026
1027 .enum > .toggle-wrapper + .docblock, .struct > .toggle-wrapper + .docblock {
1028         margin-left: 30px;
1029         margin-bottom: 20px;
1030         margin-top: 5px;
1031 }
1032
1033 .docblock > .section-header:first-child {
1034         margin-left: 15px;
1035         margin-top: 0;
1036 }
1037
1038 .docblock > .section-header:first-child:hover > a:before {
1039         left: -10px;
1040 }
1041
1042 .enum > .collapsed, .struct > .collapsed {
1043         margin-bottom: 25px;
1044 }
1045
1046 #main > .variant, #main > .structfield {
1047         display: block;
1048 }
1049
1050 .attributes {
1051         display: block;
1052         margin-top: 0px !important;
1053         margin-right: 0px;
1054         margin-bottom: 0px !important;
1055         margin-left: 30px;
1056 }
1057 .toggle-attributes.collapsed {
1058         margin-bottom: 0;
1059 }
1060 .impl-items > .toggle-attributes {
1061         margin-left: 20px;
1062 }
1063 .impl-items .attributes {
1064         font-weight: 500;
1065 }
1066
1067 :target > code {
1068         opacity: 1;
1069 }
1070
1071 .information {
1072         position: absolute;
1073         left: -25px;
1074         margin-top: 7px;
1075         z-index: 1;
1076 }
1077
1078 .tooltip {
1079         position: relative;
1080         display: inline-block;
1081         cursor: pointer;
1082 }
1083
1084 .tooltip::after {
1085         display: none;
1086         text-align: center;
1087         padding: 5px 3px 3px 3px;
1088         border-radius: 6px;
1089         margin-left: 5px;
1090         font-size: 16px;
1091 }
1092
1093 .tooltip.ignore::after {
1094         content: "This example is not tested";
1095 }
1096 .tooltip.compile_fail::after {
1097         content: "This example deliberately fails to compile";
1098 }
1099 .tooltip.should_panic::after {
1100         content: "This example panics";
1101 }
1102 .tooltip.edition::after {
1103         content: "This code runs with edition " attr(data-edition);
1104 }
1105
1106 .tooltip::before {
1107         content: " ";
1108         position: absolute;
1109         top: 50%;
1110         left: 16px;
1111         margin-top: -5px;
1112         border-width: 5px;
1113         border-style: solid;
1114         display: none;
1115 }
1116
1117 .tooltip:hover::before, .tooltip:hover::after {
1118         display: inline;
1119 }
1120
1121 .tooltip.compile_fail, .tooltip.should_panic, .tooltip.ignore {
1122         font-weight: bold;
1123         font-size: 20px;
1124 }
1125
1126 .notable-traits-tooltip {
1127         display: inline-block;
1128         cursor: pointer;
1129 }
1130
1131 .notable-traits:hover .notable-traits-tooltiptext,
1132 .notable-traits .notable-traits-tooltiptext.force-tooltip {
1133         display: inline-block;
1134 }
1135
1136 .notable-traits .notable-traits-tooltiptext {
1137         display: none;
1138         padding: 5px 3px 3px 3px;
1139         border-radius: 6px;
1140         margin-left: 5px;
1141         z-index: 10;
1142         font-size: 16px;
1143         cursor: default;
1144         position: absolute;
1145         border: 1px solid;
1146 }
1147
1148 .notable-traits-tooltip::after {
1149         /* The margin on the tooltip does not capture hover events,
1150            this extends the area of hover enough so that mouse hover is not
1151            lost when moving the mouse to the tooltip */
1152         content: "\00a0\00a0\00a0";
1153 }
1154
1155 .notable-traits .notable, .notable-traits .docblock {
1156         margin: 0;
1157 }
1158
1159 .notable-traits .docblock code.content{
1160         margin: 0;
1161         padding: 0;
1162         font-size: 20px;
1163 }
1164
1165 /* Example code has the "Run" button that needs to be positioned relative to the pre */
1166 pre.rust.rust-example-rendered {
1167         position: relative;
1168 }
1169
1170 pre.rust {
1171         tab-size: 4;
1172         -moz-tab-size: 4;
1173 }
1174
1175 .search-failed {
1176         text-align: center;
1177         margin-top: 20px;
1178 }
1179
1180 .search-failed > ul {
1181         text-align: left;
1182         max-width: 570px;
1183         margin-left: auto;
1184         margin-right: auto;
1185 }
1186
1187 #titles {
1188         height: 35px;
1189 }
1190
1191 #titles > button {
1192         float: left;
1193         width: 33.3%;
1194         text-align: center;
1195         font-size: 18px;
1196         cursor: pointer;
1197         border: 0;
1198         border-top: 2px solid;
1199 }
1200
1201 #titles > button:not(:last-child) {
1202         margin-right: 1px;
1203         width: calc(33.3% - 1px);
1204 }
1205
1206 #titles > button > div.count {
1207         display: inline-block;
1208         font-size: 16px;
1209 }
1210
1211 .notable-traits {
1212         cursor: pointer;
1213         z-index: 2;
1214         margin-left: 5px;
1215 }
1216
1217 h4 > .notable-traits {
1218         position: absolute;
1219         left: -44px;
1220         top: 2px;
1221 }
1222
1223 #all-types {
1224         text-align: center;
1225         border: 1px solid;
1226         margin: 0 10px;
1227         margin-bottom: 10px;
1228         display: block;
1229         border-radius: 7px;
1230 }
1231 #all-types > p {
1232         margin: 5px 0;
1233 }
1234
1235 #sidebar-toggle {
1236         position: fixed;
1237         top: 30px;
1238         left: 300px;
1239         z-index: 10;
1240         padding: 3px;
1241         border-top-right-radius: 3px;
1242         border-bottom-right-radius: 3px;
1243         cursor: pointer;
1244         font-weight: bold;
1245         transition: left .5s;
1246         font-size: 1.2em;
1247         border: 1px solid;
1248         border-left: 0;
1249 }
1250 #source-sidebar {
1251         position: fixed;
1252         top: 0;
1253         bottom: 0;
1254         left: 0;
1255         width: 300px;
1256         z-index: 1;
1257         overflow: auto;
1258         transition: left .5s;
1259         border-right: 1px solid;
1260 }
1261 #source-sidebar > .title {
1262         font-size: 1.5em;
1263         text-align: center;
1264         border-bottom: 1px solid;
1265         margin-bottom: 6px;
1266 }
1267
1268 .theme-picker {
1269         position: absolute;
1270         left: 211px;
1271         top: 19px;
1272 }
1273
1274 .theme-picker button {
1275         outline: none;
1276 }
1277
1278 #settings-menu, .help-button {
1279         position: absolute;
1280         top: 10px;
1281 }
1282
1283 #settings-menu {
1284         right: 0;
1285         outline: none;
1286 }
1287
1288 .help-button {
1289         right: 30px;
1290         font-family: "Fira Sans",sans-serif;
1291         text-align: center;
1292         font-size: 17px;
1293 }
1294
1295 #theme-picker, #settings-menu, .help-button {
1296         padding: 4px;
1297         width: 27px;
1298         height: 29px;
1299         border: 1px solid;
1300         border-radius: 3px;
1301         cursor: pointer;
1302 }
1303
1304 #theme-choices {
1305         display: none;
1306         position: absolute;
1307         left: 0;
1308         top: 28px;
1309         border: 1px solid;
1310         border-radius: 3px;
1311         z-index: 1;
1312         cursor: pointer;
1313 }
1314
1315 #theme-choices > button {
1316         border: none;
1317         width: 100%;
1318         padding: 4px 8px;
1319         text-align: center;
1320         background: rgba(0,0,0,0);
1321 }
1322
1323 #theme-choices > button:not(:first-child) {
1324         border-top: 1px solid;
1325 }
1326
1327 /* Media Queries */
1328
1329 @media (min-width: 701px) {
1330         /* In case there is no documentation before a code block, we need to add some margin at the top
1331         to prevent an overlay between the "collapse toggle" and the information tooltip.
1332         However, it's needed needed with smaller screen width because the doc/code block is always put
1333         "one line" below. */
1334         .information:first-child > .tooltip {
1335                 margin-top: 16px;
1336         }
1337 }
1338
1339 @media (max-width: 700px) {
1340         body {
1341                 padding-top: 0px;
1342         }
1343
1344         .rustdoc > .sidebar {
1345                 height: 45px;
1346                 min-height: 40px;
1347                 margin: 0;
1348                 margin-left: -15px;
1349                 padding: 0 15px;
1350                 position: static;
1351                 z-index: 11;
1352         }
1353
1354         .sidebar > .location {
1355                 float: right;
1356                 margin: 0px;
1357                 margin-top: 2px;
1358                 padding: 3px 10px 1px 10px;
1359                 min-height: 39px;
1360                 background: inherit;
1361                 text-align: left;
1362                 font-size: 24px;
1363         }
1364
1365         .sidebar .location:empty {
1366                 padding: 0;
1367         }
1368
1369         .sidebar .logo-container {
1370                 width: 35px;
1371                 height: 35px;
1372                 margin-top: 5px;
1373                 margin-bottom: 5px;
1374                 float: left;
1375                 margin-left: 50px;
1376         }
1377
1378         .sidebar .logo-container > img {
1379                 max-width: 35px;
1380                 max-height: 35px;
1381         }
1382
1383         .sidebar-menu {
1384                 position: fixed;
1385                 z-index: 10;
1386                 font-size: 2rem;
1387                 cursor: pointer;
1388                 width: 45px;
1389                 left: 0;
1390                 text-align: center;
1391                 display: block;
1392                 border-bottom: 1px solid;
1393                 border-right: 1px solid;
1394                 height: 45px;
1395         }
1396
1397         .rustdoc.source > .sidebar > .sidebar-menu {
1398                 display: none;
1399         }
1400
1401         .sidebar-elems {
1402                 position: fixed;
1403                 z-index: 1;
1404                 left: 0;
1405                 top: 45px;
1406                 bottom: 0;
1407                 overflow-y: auto;
1408                 border-right: 1px solid;
1409                 display: none;
1410         }
1411
1412         .sidebar > .block.version {
1413                 border-bottom: none;
1414                 margin-top: 12px;
1415         }
1416
1417         nav.sub {
1418                 width: calc(100% - 32px);
1419                 float: right;
1420         }
1421
1422         .content {
1423                 margin-left: 0px;
1424         }
1425
1426         #main {
1427                 margin-top: 45px;
1428                 padding: 0;
1429         }
1430
1431         .content .in-band {
1432                 width: 100%;
1433         }
1434
1435         .content h4 > .out-of-band {
1436                 position: inherit;
1437         }
1438
1439         .toggle-wrapper > .collapse-toggle {
1440                 left: 0px;
1441         }
1442
1443         .toggle-wrapper {
1444                 height: 1.5em;
1445         }
1446
1447         #search {
1448                 margin-left: 0;
1449         }
1450
1451         .content .impl-items .method, .content .impl-items > .type, .impl-items > .associatedconstant {
1452                 display: flex;
1453         }
1454
1455         .anchor {
1456                 display: none !important;
1457         }
1458
1459         h1.fqn {
1460                 overflow: initial;
1461         }
1462
1463         .theme-picker {
1464                 left: 10px;
1465                 top: 54px;
1466                 z-index: 1;
1467         }
1468
1469         h4 > .notable-traits {
1470                 position: absolute;
1471                 left: -22px;
1472                 top: 24px;
1473         }
1474
1475         #titles > button > div.count {
1476                 float: left;
1477                 width: 100%;
1478         }
1479
1480         #titles {
1481                 height: 50px;
1482         }
1483
1484         .sidebar.mobile {
1485                 position: fixed;
1486                 width: 100%;
1487                 margin-left: 0;
1488                 background-color: rgba(0,0,0,0);
1489                 height: 100%;
1490         }
1491         .sidebar {
1492                 width: calc(100% + 30px);
1493         }
1494
1495         .show-it {
1496                 display: block;
1497                 width: 246px;
1498         }
1499
1500         .show-it > .block.items {
1501                 margin: 8px 0;
1502         }
1503
1504         .show-it > .block.items > ul {
1505                 margin: 0;
1506         }
1507
1508         .show-it > .block.items > ul > li {
1509                 text-align: center;
1510                 margin: 2px 0;
1511         }
1512
1513         .show-it > .block.items > ul > li > a {
1514                 font-size: 21px;
1515         }
1516
1517         /* Because of ios, we need to actually have a full height sidebar title so the
1518          * actual sidebar can show up. But then we need to make it transparent so we don't
1519          * hide content. The filler just allows to create the background for the sidebar
1520          * title. But because of the absolute position, I had to lower the z-index.
1521          */
1522         #sidebar-filler {
1523                 position: fixed;
1524                 left: 45px;
1525                 width: calc(100% - 45px);
1526                 top: 0;
1527                 height: 45px;
1528                 z-index: -1;
1529                 border-bottom: 1px solid;
1530         }
1531
1532         .collapse-toggle {
1533                 left: -20px;
1534         }
1535
1536         .impl > .collapse-toggle {
1537                 left: -10px;
1538         }
1539
1540         #all-types {
1541                 margin: 10px;
1542         }
1543
1544         #sidebar-toggle {
1545                 top: 100px;
1546                 width: 30px;
1547                 font-size: 1.5rem;
1548                 text-align: center;
1549                 padding: 0;
1550         }
1551
1552         #source-sidebar {
1553                 z-index: 11;
1554         }
1555
1556         #main > .line-numbers {
1557                 margin-top: 0;
1558         }
1559
1560         .notable-traits .notable-traits-tooltiptext {
1561                 left: 0;
1562                 top: 100%;
1563         }
1564
1565         /* We don't display the help button on mobile devices. */
1566         .help-button {
1567                 display: none;
1568         }
1569         .search-container > div {
1570                 width: calc(100% - 32px);
1571         }
1572 }
1573
1574 @media print {
1575         nav.sub, .content .out-of-band, .collapse-toggle {
1576                 display: none;
1577         }
1578 }
1579
1580 @media (max-width: 416px) {
1581         #titles, #titles > button {
1582                 height: 73px;
1583         }
1584
1585         /* This is to prevent the search bar from being underneath the <section>
1586          * element following it.
1587          */
1588         #main, #search {
1589                 margin-top: 100px;
1590         }
1591
1592         #main > table:not(.table-display) td {
1593                 word-break: break-word;
1594                 width: 50%;
1595         }
1596
1597         .search-container > div {
1598                 display: block;
1599                 width: calc(100% - 37px);
1600         }
1601
1602         #crate-search {
1603                 width: 100%;
1604                 border-radius: 4px;
1605                 border: 0;
1606         }
1607
1608         #crate-search + .search-input {
1609                 width: calc(100% + 71px);
1610                 margin-left: -36px;
1611         }
1612
1613         #theme-picker, #settings-menu {
1614                 padding: 5px;
1615                 width: 31px;
1616                 height: 31px;
1617         }
1618
1619         #theme-picker {
1620                 margin-top: -2px;
1621         }
1622
1623         #settings-menu {
1624                 top: 7px;
1625         }
1626 }
1627
1628 h3.notable {
1629         margin: 0;
1630         margin-bottom: 13px;
1631         font-size: 19px;
1632 }
1633
1634 kbd {
1635         display: inline-block;
1636         padding: 3px 5px;
1637         font: 15px monospace;
1638         line-height: 10px;
1639         vertical-align: middle;
1640         border: solid 1px;
1641         border-radius: 3px;
1642         box-shadow: inset 0 -1px 0;
1643         cursor: default;
1644 }
1645
1646 .hidden-by-impl-hider,
1647 .hidden-by-usual-hider {
1648         /* important because of conflicting rule for small screens */
1649         display: none !important;
1650 }
1651
1652 #implementations-list > h3 > span.in-band {
1653         width: 100%;
1654 }
1655
1656 .table-display {
1657         width: 100%;
1658         border: 0;
1659         border-collapse: collapse;
1660         border-spacing: 0;
1661         font-size: 16px;
1662 }
1663
1664 .table-display tr td:first-child {
1665         padding-right: 0;
1666 }
1667
1668 .table-display tr td:last-child {
1669         float: right;
1670 }
1671 .table-display .out-of-band {
1672         position: relative;
1673         font-size: 19px;
1674         display: block;
1675 }
1676 #implementors-list > .impl-items .table-display .out-of-band {
1677         font-size: 17px;
1678 }
1679
1680 .table-display td:hover .anchor {
1681         display: block;
1682         top: 2px;
1683         left: -5px;
1684 }
1685
1686 #main > ul {
1687         padding-left: 10px;
1688 }
1689 #main > ul > li {
1690         list-style: none;
1691 }
1692
1693 .non-exhaustive {
1694         margin-bottom: 1em;
1695 }
1696
1697 div.children {
1698         padding-left: 27px;
1699         display: none;
1700 }
1701 div.name {
1702         cursor: pointer;
1703         position: relative;
1704         margin-left: 16px;
1705 }
1706 div.files > a {
1707         display: block;
1708         padding: 0 3px;
1709 }
1710 div.files > a:hover, div.name:hover {
1711         background-color: #a14b4b;
1712 }
1713 div.name.expand + .children {
1714         display: block;
1715 }
1716 div.name::before {
1717         content: "\25B6";
1718         padding-left: 4px;
1719         font-size: 0.7em;
1720         position: absolute;
1721         left: -16px;
1722         top: 4px;
1723 }
1724 div.name.expand::before {
1725         transform: rotate(90deg);
1726         left: -15px;
1727         top: 2px;
1728 }
1729
1730 /* This part is to fix the "Expand attributes" part in the type declaration. */
1731 .type-decl > pre > .toggle-wrapper.toggle-attributes.top-attr {
1732         margin-left: 0 !important;
1733 }
1734 .type-decl > pre > .docblock.attributes.top-attr {
1735         margin-left: 1.8em !important;
1736 }
1737 .type-decl > pre > .toggle-attributes {
1738         margin-left: 2.2em;
1739 }
1740 .type-decl > pre > .docblock.attributes {
1741         margin-left: 4em;
1742 }