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