]> git.lizzy.rs Git - rust.git/blob - src/librustdoc/html/static/rustdoc.css
Rollup merge of #74444 - Alexendoo:test-69414, r=nikomatsakis
[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(.important),
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 :not(code)>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 ol, ul {
130         padding-left: 25px;
131 }
132 ul ul, ol ul, ul ol, ol ol {
133         margin-bottom: .6em;
134 }
135
136 p {
137         margin: 0 0 .6em 0;
138 }
139
140 summary {
141         outline: none;
142 }
143
144 code, pre, a.test-arrow {
145         font-family: "Source Code Pro", monospace;
146 }
147 .docblock code, .docblock-short code {
148         border-radius: 3px;
149         padding: 0 0.1em;
150 }
151 .docblock pre code, .docblock-short pre code, .docblock code.spotlight {
152         padding: 0;
153 }
154 .docblock code.spotlight :last-child {
155         padding-bottom: 0.6em;
156 }
157 pre {
158         padding: 14px;
159 }
160
161 .source .content pre {
162         padding: 20px;
163 }
164
165 img {
166         max-width: 100%;
167 }
168
169 li {
170         position: relative;
171 }
172
173 .source .content {
174         margin-top: 50px;
175         max-width: none;
176         overflow: visible;
177         margin-left: 0px;
178         min-width: 70em;
179 }
180
181 nav.sub {
182         font-size: 16px;
183         text-transform: uppercase;
184 }
185
186 .sidebar {
187         width: 200px;
188         position: fixed;
189         left: 0;
190         top: 0;
191         bottom: 0;
192         overflow: auto;
193 }
194
195 /* Improve the scrollbar display on firefox */
196 * {
197         scrollbar-width: initial;
198 }
199 .sidebar {
200         scrollbar-width: thin;
201 }
202
203 /* Improve the scrollbar display on webkit-based browsers */
204 ::-webkit-scrollbar {
205         width: 12px;
206 }
207 .sidebar::-webkit-scrollbar {
208         width: 8px;
209 }
210 ::-webkit-scrollbar-track {
211         -webkit-box-shadow: inset 0;
212 }
213
214 .sidebar .block > ul > li {
215         margin-right: -10px;
216 }
217
218 .content, nav {
219         max-width: 960px;
220 }
221
222 /* Everything else */
223
224 .hidden {
225         display: none !important;
226 }
227
228 .logo-container {
229         height: 100px;
230         width: 100px;
231         position: relative;
232         margin: 20px auto;
233         display: block;
234         margin-top: 10px;
235 }
236
237 .logo-container > img {
238         max-width: 100px;
239         max-height: 100px;
240         position: absolute;
241         left: 50%;
242         top: 50%;
243         transform: translate(-50%, -50%);
244         display: block;
245 }
246
247 .sidebar .location {
248         border: 1px solid;
249         font-size: 17px;
250         margin: 30px 10px 20px 10px;
251         text-align: center;
252         word-wrap: break-word;
253 }
254
255 .sidebar .version {
256         font-size: 15px;
257         text-align: center;
258         border-bottom: 1px solid;
259         overflow-wrap: break-word;
260         word-wrap: break-word; /* deprecated */
261         word-break: break-word; /* Chrome, non-standard */
262 }
263
264 .location:empty {
265         border: none;
266 }
267
268 .location a:first-child {
269         font-weight: 500;
270 }
271
272 .block {
273         padding: 0;
274         margin-bottom: 14px;
275 }
276 .block h2, .block h3 {
277         margin-top: 0;
278         margin-bottom: 8px;
279         text-align: center;
280 }
281 .block ul, .block li {
282         margin: 0 10px;
283         padding: 0;
284         list-style: none;
285 }
286
287 .block a {
288         display: block;
289         text-overflow: ellipsis;
290         overflow: hidden;
291         line-height: 15px;
292         padding: 7px 5px;
293         font-size: 14px;
294         font-weight: 300;
295         transition: border 500ms ease-out;
296 }
297
298 .sidebar-title {
299         border-top: 1px solid;
300         border-bottom: 1px solid;
301         text-align: center;
302         font-size: 17px;
303         margin-bottom: 5px;
304 }
305
306 .sidebar-links {
307         margin-bottom: 15px;
308 }
309
310 .sidebar-links > a {
311         padding-left: 10px;
312         width: 100%;
313 }
314
315 .sidebar-menu {
316         display: none;
317 }
318
319 .content {
320         padding: 15px 0;
321 }
322
323 .source .content pre.rust {
324         white-space: pre;
325         overflow: auto;
326         padding-left: 0;
327 }
328
329 .rustdoc:not(.source) .example-wrap {
330         display: inline-flex;
331         margin-bottom: 10px;
332         position: relative;
333 }
334
335 .example-wrap {
336         width: 100%;
337 }
338
339 .example-wrap > pre.line-number {
340         overflow: initial;
341         border: 1px solid;
342         border-top-left-radius: 5px;
343         border-bottom-left-radius: 5px;
344         padding: 13px 8px;
345         text-align: right;
346 }
347
348 .rustdoc:not(.source) .example-wrap > pre.rust {
349         width: 100%;
350         overflow-x: auto;
351 }
352
353 .rustdoc:not(.source) .example-wrap > pre {
354         margin: 0;
355 }
356
357 #search {
358         margin-left: 230px;
359         position: relative;
360 }
361
362 #results {
363         position: absolute;
364         right: 0;
365         left: 0;
366         overflow: auto;
367 }
368
369 #results > table {
370         width: 100%;
371         table-layout: fixed;
372         margin-bottom: 40px;
373 }
374
375 .content pre.line-numbers {
376         float: left;
377         border: none;
378         position: relative;
379
380         -webkit-user-select: none;
381         -moz-user-select: none;
382         -ms-user-select: none;
383         user-select: none;
384 }
385 .line-numbers span {
386         cursor: pointer;
387 }
388
389 .docblock-short p {
390         display: inline;
391 }
392
393 .docblock-short.nowrap {
394         display: block;
395         overflow: hidden;
396         white-space: nowrap;
397         text-overflow: ellipsis;
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(.important-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 .stability code {
557         font-size: 90%;
558 }
559
560 .content .stability {
561         position: relative;
562         margin-left: 33px;
563         margin-top: -13px;
564 }
565
566 .sub-variant > div > .stability {
567         margin-top: initial;
568 }
569
570 .content .stability::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 .stability {
583         margin-bottom: .6em;
584 }
585
586 .content .impl-items > .stability {
587         margin-left: 40px;
588 }
589
590 .methods > .stability, .content .impl-items > .stability {
591         margin-top: -8px;
592 }
593
594 .impl-items {
595         flex-basis: 100%;
596 }
597
598 #main > .stability {
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, .stability a {
659         text-decoration: underline;
660 }
661
662 .invisible > .srclink, h4 > 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% - 34px);
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 dd { margin: 5px 35px; }
800 #help .infos { padding-left: 0; }
801 #help h1, #help h2 { margin-top: 0; }
802 #help > div div {
803         width: 50%;
804         float: left;
805         padding: 20px;
806         padding-left: 17px;
807 }
808
809 .stab {
810         display: table;
811         border-width: 1px;
812         border-style: solid;
813         padding: 3px;
814         margin-bottom: 5px;
815         font-size: 90%;
816 }
817 .stab p {
818         display: inline;
819 }
820
821 .stab summary {
822         display: list-item;
823 }
824
825 .stab .emoji {
826         font-size: 1.5em;
827 }
828
829 .module-item .stab {
830         border-radius: 3px;
831         display: inline-block;
832         font-size: 80%;
833         line-height: 1.2;
834         margin-bottom: 0;
835         margin-right: .3em;
836         padding: 2px;
837         vertical-align: text-bottom;
838 }
839
840 .module-item.unstable {
841         opacity: 0.65;
842 }
843
844 .since {
845         font-weight: normal;
846         font-size: initial;
847         position: absolute;
848         right: 0;
849         top: 0;
850 }
851
852 .impl-items .since, .impl .since {
853         flex-grow: 0;
854         padding-left: 12px;
855         padding-right: 2px;
856         position: initial;
857 }
858
859 .impl-items .srclink, .impl .srclink {
860         flex-grow: 0;
861         /* Override header settings otherwise it's too bold */
862         font-size: 17px;
863         font-weight: normal;
864 }
865
866 .impl-items code, .impl code {
867         flex-grow: 1;
868 }
869
870 .impl-items h4, h4.impl, h3.impl {
871         display: flex;
872         flex-basis: 100%;
873         font-size: 16px;
874         margin-bottom: 12px;
875         /* Push the src link out to the right edge consistently */
876         justify-content: space-between;
877 }
878
879 .variants_table {
880         width: 100%;
881 }
882
883 .variants_table tbody tr td:first-child {
884         width: 1%; /* make the variant name as small as possible */
885 }
886
887 td.summary-column {
888         width: 100%;
889 }
890
891 .summary {
892         padding-right: 0px;
893 }
894
895 pre.rust .question-mark {
896         font-weight: bold;
897 }
898
899 a.test-arrow {
900         display: inline-block;
901         position: absolute;
902         padding: 5px 10px 5px 10px;
903         border-radius: 5px;
904         font-size: 130%;
905         top: 5px;
906         right: 5px;
907         z-index: 1;
908 }
909 a.test-arrow:hover{
910         text-decoration: none;
911 }
912
913 .section-header:hover a:before {
914         position: absolute;
915         left: -25px;
916         padding-right: 10px; /* avoid gap that causes hover to disappear */
917         content: '\2002\00a7\2002';
918 }
919
920 .section-header:hover a {
921         text-decoration: none;
922 }
923
924 .section-header a {
925         color: inherit;
926 }
927
928 .collapse-toggle {
929         font-weight: 300;
930         position: absolute;
931         left: -23px;
932         top: 0;
933 }
934
935 h3 > .collapse-toggle, h4 > .collapse-toggle {
936         font-size: 0.8em;
937         top: 5px;
938 }
939
940 .toggle-wrapper > .collapse-toggle {
941         left: -24px;
942         margin-top: 0px;
943 }
944
945 .toggle-wrapper {
946         position: relative;
947         margin-top: 0;
948 }
949
950 .toggle-wrapper.collapsed {
951         height: 25px;
952         transition: height .2s;
953         margin-bottom: .6em;
954 }
955
956 .collapse-toggle > .inner {
957         display: inline-block;
958         width: 1.2ch;
959         text-align: center;
960 }
961
962 .collapse-toggle.hidden-default {
963         position: relative;
964         margin-left: 20px;
965 }
966
967 .since + .srclink {
968         display: table-cell;
969         padding-left: 10px;
970 }
971
972 .item-spacer {
973         width: 100%;
974         height: 12px;
975 }
976
977 .out-of-band > span.since {
978         position: initial;
979         font-size: 20px;
980         margin-right: 5px;
981 }
982
983 .toggle-wrapper > .collapse-toggle {
984         left: 0;
985 }
986
987 .variant + .toggle-wrapper + .docblock > p {
988         margin-top: 5px;
989 }
990
991 .sub-variant, .sub-variant > h3 {
992         margin-top: 1px !important;
993 }
994
995 #main > .sub-variant > h3 {
996         font-size: 15px;
997         margin-left: 25px;
998         margin-bottom: 5px;
999 }
1000
1001 .sub-variant > div {
1002         margin-left: 20px;
1003         margin-bottom: 10px;
1004 }
1005
1006 .sub-variant > div > span {
1007         display: block;
1008         position: relative;
1009 }
1010
1011 .toggle-label {
1012         display: inline-block;
1013         margin-left: 4px;
1014         margin-top: 3px;
1015 }
1016
1017 .enum > .toggle-wrapper + .docblock, .struct > .toggle-wrapper + .docblock {
1018         margin-left: 30px;
1019         margin-bottom: 20px;
1020         margin-top: 5px;
1021 }
1022
1023 .docblock > .section-header:first-child {
1024         margin-left: 15px;
1025         margin-top: 0;
1026 }
1027
1028 .docblock > .section-header:first-child:hover > a:before {
1029         left: -10px;
1030 }
1031
1032 .enum > .collapsed, .struct > .collapsed {
1033         margin-bottom: 25px;
1034 }
1035
1036 #main > .variant, #main > .structfield {
1037         display: block;
1038 }
1039
1040 .attributes {
1041         display: block;
1042         margin-top: 0px !important;
1043         margin-right: 0px;
1044         margin-bottom: 0px !important;
1045         margin-left: 30px;
1046 }
1047 .toggle-attributes.collapsed {
1048         margin-bottom: 0;
1049 }
1050 .impl-items > .toggle-attributes {
1051         margin-left: 20px;
1052 }
1053 .impl-items .attributes {
1054         font-weight: 500;
1055 }
1056
1057 :target > code {
1058         opacity: 1;
1059 }
1060
1061 .information {
1062         position: absolute;
1063         left: -25px;
1064         margin-top: 7px;
1065         z-index: 1;
1066 }
1067
1068 .tooltip {
1069         position: relative;
1070         display: inline-block;
1071         cursor: pointer;
1072 }
1073
1074 .tooltip .tooltiptext {
1075         width: 120px;
1076         display: none;
1077         text-align: center;
1078         padding: 5px 3px 3px 3px;
1079         border-radius: 6px;
1080         margin-left: 5px;
1081         top: -5px;
1082         left: 105%;
1083         z-index: 10;
1084         font-size: 16px;
1085 }
1086
1087 .tooltip .tooltiptext::after {
1088         content: " ";
1089         position: absolute;
1090         top: 50%;
1091         left: 16px;
1092         margin-top: -5px;
1093         border-width: 5px;
1094         border-style: solid;
1095 }
1096
1097 .tooltip.compile_fail, .tooltip.should_panic, .tooltip.ignore {
1098         font-weight: bold;
1099         font-size: 20px;
1100 }
1101
1102 .important-traits-tooltip {
1103         display: inline-block;
1104         cursor: pointer;
1105 }
1106
1107 .important-traits:hover .important-traits-tooltiptext,
1108 .important-traits .important-traits-tooltiptext.force-tooltip {
1109         display: inline-block;
1110 }
1111
1112 .important-traits .important-traits-tooltiptext {
1113         display: none;
1114         padding: 5px 3px 3px 3px;
1115         border-radius: 6px;
1116         margin-left: 5px;
1117         z-index: 10;
1118         font-size: 16px;
1119         cursor: default;
1120         position: absolute;
1121         border: 1px solid;
1122 }
1123
1124 .important-traits-tooltip::after {
1125         /* The margin on the tooltip does not capture hover events,
1126            this extends the area of hover enough so that mouse hover is not
1127            lost when moving the mouse to the tooltip */
1128         content: "\00a0\00a0\00a0";
1129 }
1130
1131 .important-traits .important, .important-traits .docblock {
1132         margin: 0;
1133 }
1134
1135 .important-traits .docblock code.content{
1136         margin: 0;
1137         padding: 0;
1138         font-size: 20px;
1139 }
1140
1141 /* Example code has the "Run" button that needs to be positioned relative to the pre */
1142 pre.rust.rust-example-rendered {
1143         position: relative;
1144 }
1145
1146 pre.rust {
1147         tab-size: 4;
1148         -moz-tab-size: 4;
1149 }
1150
1151 .search-failed {
1152         text-align: center;
1153         margin-top: 20px;
1154 }
1155
1156 .search-failed > ul {
1157         text-align: left;
1158         max-width: 570px;
1159         margin-left: auto;
1160         margin-right: auto;
1161 }
1162
1163 #titles {
1164         height: 35px;
1165 }
1166
1167 #titles > div {
1168         float: left;
1169         width: 33.3%;
1170         text-align: center;
1171         font-size: 18px;
1172         cursor: pointer;
1173         border-top: 2px solid;
1174 }
1175
1176 #titles > div:not(:last-child) {
1177         margin-right: 1px;
1178         width: calc(33.3% - 1px);
1179 }
1180
1181 #titles > div > div.count {
1182         display: inline-block;
1183         font-size: 16px;
1184 }
1185
1186 .important-traits {
1187         cursor: pointer;
1188         z-index: 2;
1189         margin-left: 5px;
1190 }
1191
1192 h4 > .important-traits {
1193         position: absolute;
1194         left: -44px;
1195         top: 2px;
1196 }
1197
1198 #all-types {
1199         text-align: center;
1200         border: 1px solid;
1201         margin: 0 10px;
1202         margin-bottom: 10px;
1203         display: block;
1204         border-radius: 7px;
1205 }
1206 #all-types > p {
1207         margin: 5px 0;
1208 }
1209
1210 #sidebar-toggle {
1211         position: fixed;
1212         top: 30px;
1213         left: 300px;
1214         z-index: 10;
1215         padding: 3px;
1216         border-top-right-radius: 3px;
1217         border-bottom-right-radius: 3px;
1218         cursor: pointer;
1219         font-weight: bold;
1220         transition: left .5s;
1221         font-size: 1.2em;
1222         border: 1px solid;
1223         border-left: 0;
1224 }
1225 #source-sidebar {
1226         position: fixed;
1227         top: 0;
1228         bottom: 0;
1229         left: 0;
1230         width: 300px;
1231         z-index: 1;
1232         overflow: auto;
1233         transition: left .5s;
1234         border-right: 1px solid;
1235 }
1236 #source-sidebar > .title {
1237         font-size: 1.5em;
1238         text-align: center;
1239         border-bottom: 1px solid;
1240         margin-bottom: 6px;
1241 }
1242
1243 .theme-picker {
1244         position: absolute;
1245         left: 211px;
1246         top: 19px;
1247 }
1248
1249 .theme-picker button {
1250         outline: none;
1251 }
1252
1253 #settings-menu {
1254         position: absolute;
1255         right: 0;
1256         top: 10px;
1257         outline: none;
1258 }
1259
1260 #theme-picker, #settings-menu {
1261         padding: 4px;
1262         width: 27px;
1263         height: 29px;
1264         border: 1px solid;
1265         border-radius: 3px;
1266         cursor: pointer;
1267 }
1268
1269 #theme-choices {
1270         display: none;
1271         position: absolute;
1272         left: 0;
1273         top: 28px;
1274         border: 1px solid;
1275         border-radius: 3px;
1276         z-index: 1;
1277         cursor: pointer;
1278 }
1279
1280 #theme-choices > button {
1281         border: none;
1282         width: 100%;
1283         padding: 4px;
1284         text-align: center;
1285         background: rgba(0,0,0,0);
1286 }
1287
1288 #theme-choices > button:not(:first-child) {
1289         border-top: 1px solid;
1290 }
1291
1292 /* Media Queries */
1293
1294 @media (max-width: 700px) {
1295         body {
1296                 padding-top: 0px;
1297         }
1298
1299         .rustdoc > .sidebar {
1300                 height: 45px;
1301                 min-height: 40px;
1302                 margin: 0;
1303                 margin-left: -15px;
1304                 padding: 0 15px;
1305                 position: static;
1306                 z-index: 11;
1307         }
1308
1309         .sidebar > .location {
1310                 float: right;
1311                 margin: 0px;
1312                 margin-top: 2px;
1313                 padding: 3px 10px 1px 10px;
1314                 min-height: 39px;
1315                 background: inherit;
1316                 text-align: left;
1317                 font-size: 24px;
1318         }
1319
1320         .sidebar .location:empty {
1321                 padding: 0;
1322         }
1323
1324         .sidebar .logo-container {
1325                 width: 35px;
1326                 height: 35px;
1327                 margin-top: 5px;
1328                 margin-bottom: 5px;
1329                 float: left;
1330                 margin-left: 50px;
1331         }
1332
1333         .sidebar .logo-container > img {
1334                 max-width: 35px;
1335                 max-height: 35px;
1336         }
1337
1338         .sidebar-menu {
1339                 position: fixed;
1340                 z-index: 10;
1341                 font-size: 2rem;
1342                 cursor: pointer;
1343                 width: 45px;
1344                 left: 0;
1345                 text-align: center;
1346                 display: block;
1347                 border-bottom: 1px solid;
1348                 border-right: 1px solid;
1349                 height: 45px;
1350         }
1351
1352         .rustdoc.source > .sidebar > .sidebar-menu {
1353                 display: none;
1354         }
1355
1356         .sidebar-elems {
1357                 position: fixed;
1358                 z-index: 1;
1359                 left: 0;
1360                 top: 45px;
1361                 bottom: 0;
1362                 overflow-y: auto;
1363                 border-right: 1px solid;
1364                 display: none;
1365         }
1366
1367         .sidebar > .block.version {
1368                 border-bottom: none;
1369                 margin-top: 12px;
1370         }
1371
1372         nav.sub {
1373                 width: calc(100% - 32px);
1374                 float: right;
1375         }
1376
1377         .content {
1378                 margin-left: 0px;
1379         }
1380
1381         #main {
1382                 margin-top: 45px;
1383                 padding: 0;
1384         }
1385
1386         .content .in-band {
1387                 width: 100%;
1388         }
1389
1390         .content h4 > .out-of-band {
1391                 position: inherit;
1392         }
1393
1394         .toggle-wrapper > .collapse-toggle {
1395                 left: 0px;
1396         }
1397
1398         .toggle-wrapper {
1399                 height: 1.5em;
1400         }
1401
1402         #search {
1403                 margin-left: 0;
1404         }
1405
1406         .content .impl-items .method, .content .impl-items > .type, .impl-items > .associatedconstant {
1407                 display: flex;
1408         }
1409
1410         .anchor {
1411                 display: none !important;
1412         }
1413
1414         h1.fqn {
1415                 overflow: initial;
1416         }
1417
1418         .theme-picker {
1419                 left: 10px;
1420                 top: 54px;
1421                 z-index: 1;
1422         }
1423
1424         h4 > .important-traits {
1425                 position: absolute;
1426                 left: -22px;
1427                 top: 24px;
1428         }
1429
1430         #titles > div > div.count {
1431                 float: left;
1432                 width: 100%;
1433         }
1434
1435         #titles {
1436                 height: 50px;
1437         }
1438
1439         .sidebar.mobile {
1440                 position: fixed;
1441                 width: 100%;
1442                 margin-left: 0;
1443                 background-color: rgba(0,0,0,0);
1444                 height: 100%;
1445         }
1446         .sidebar {
1447                 width: calc(100% + 30px);
1448         }
1449
1450         .show-it {
1451                 display: block;
1452                 width: 246px;
1453         }
1454
1455         .show-it > .block.items {
1456                 margin: 8px 0;
1457         }
1458
1459         .show-it > .block.items > ul {
1460                 margin: 0;
1461         }
1462
1463         .show-it > .block.items > ul > li {
1464                 text-align: center;
1465                 margin: 2px 0;
1466         }
1467
1468         .show-it > .block.items > ul > li > a {
1469                 font-size: 21px;
1470         }
1471
1472         /* Because of ios, we need to actually have a full height sidebar title so the
1473          * actual sidebar can show up. But then we need to make it transparent so we don't
1474          * hide content. The filler just allows to create the background for the sidebar
1475          * title. But because of the absolute position, I had to lower the z-index.
1476          */
1477         #sidebar-filler {
1478                 position: fixed;
1479                 left: 45px;
1480                 width: calc(100% - 45px);
1481                 top: 0;
1482                 height: 45px;
1483                 z-index: -1;
1484                 border-bottom: 1px solid;
1485         }
1486
1487         .collapse-toggle {
1488                 left: -20px;
1489         }
1490
1491         .impl > .collapse-toggle {
1492                 left: -10px;
1493         }
1494
1495         #all-types {
1496                 margin: 10px;
1497         }
1498
1499         #sidebar-toggle {
1500                 top: 100px;
1501                 width: 30px;
1502                 font-size: 1.5rem;
1503                 text-align: center;
1504                 padding: 0;
1505         }
1506
1507         #source-sidebar {
1508                 z-index: 11;
1509         }
1510
1511         #main > .line-numbers {
1512                 margin-top: 0;
1513         }
1514 }
1515
1516 @media print {
1517         nav.sub, .content .out-of-band, .collapse-toggle {
1518                 display: none;
1519         }
1520 }
1521
1522 @media (max-width: 416px) {
1523         #titles {
1524                 height: 73px;
1525         }
1526
1527         #titles > div {
1528                 height: 73px;
1529         }
1530 }
1531
1532 h3.important {
1533         margin: 0;
1534         margin-bottom: 13px;
1535         font-size: 19px;
1536 }
1537
1538 kbd {
1539         display: inline-block;
1540         padding: 3px 5px;
1541         font: 15px monospace;
1542         line-height: 10px;
1543         vertical-align: middle;
1544         border: solid 1px;
1545         border-radius: 3px;
1546         box-shadow: inset 0 -1px 0;
1547         cursor: default;
1548 }
1549
1550 .hidden-by-impl-hider,
1551 .hidden-by-usual-hider {
1552         /* important because of conflicting rule for small screens */
1553         display: none !important;
1554 }
1555
1556 #implementations-list > h3 > span.in-band {
1557         width: 100%;
1558 }
1559
1560 .table-display {
1561         width: 100%;
1562         border: 0;
1563         border-collapse: collapse;
1564         border-spacing: 0;
1565         font-size: 16px;
1566 }
1567
1568 .table-display tr td:first-child {
1569         padding-right: 0;
1570 }
1571
1572 .table-display tr td:last-child {
1573         float: right;
1574 }
1575 .table-display .out-of-band {
1576         position: relative;
1577         font-size: 19px;
1578         display: block;
1579 }
1580 #implementors-list > .impl-items .table-display .out-of-band {
1581         font-size: 17px;
1582 }
1583
1584 .table-display td:hover .anchor {
1585         display: block;
1586         top: 2px;
1587         left: -5px;
1588 }
1589
1590 #main > ul {
1591         padding-left: 10px;
1592 }
1593 #main > ul > li {
1594         list-style: none;
1595 }
1596
1597 .non-exhaustive {
1598         margin-bottom: 1em;
1599 }
1600
1601 div.children {
1602         padding-left: 27px;
1603         display: none;
1604 }
1605 div.name {
1606         cursor: pointer;
1607         position: relative;
1608         margin-left: 16px;
1609 }
1610 div.files > a {
1611         display: block;
1612         padding: 0 3px;
1613 }
1614 div.files > a:hover, div.name:hover {
1615         background-color: #a14b4b;
1616 }
1617 div.name.expand + .children {
1618         display: block;
1619 }
1620 div.name::before {
1621         content: "\25B6";
1622         padding-left: 4px;
1623         font-size: 0.7em;
1624         position: absolute;
1625         left: -16px;
1626         top: 4px;
1627 }
1628 div.name.expand::before {
1629         transform: rotate(90deg);
1630         left: -15px;
1631         top: 2px;
1632 }
1633
1634 /* This part is to fix the "Expand attributes" part in the type declaration. */
1635 .type-decl > pre > .toggle-wrapper.toggle-attributes.top-attr {
1636         margin-left: 0 !important;
1637 }
1638 .type-decl > pre > .docblock.attributes.top-attr {
1639         margin-left: 1.8em !important;
1640 }
1641 .type-decl > pre > .toggle-attributes {
1642         margin-left: 2.2em;
1643 }
1644 .type-decl > pre > .docblock.attributes {
1645         margin-left: 4em;
1646 }