]> git.lizzy.rs Git - rust.git/blob - src/librustdoc/html/static/rustdoc.css
Greatly improve display for small mobile devices screens
[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 .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% - 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 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:hover .tooltiptext {
1098         display: inline;
1099 }
1100
1101 .tooltip.compile_fail, .tooltip.should_panic, .tooltip.ignore {
1102         font-weight: bold;
1103         font-size: 20px;
1104 }
1105
1106 .notable-traits-tooltip {
1107         display: inline-block;
1108         cursor: pointer;
1109 }
1110
1111 .notable-traits:hover .notable-traits-tooltiptext,
1112 .notable-traits .notable-traits-tooltiptext.force-tooltip {
1113         display: inline-block;
1114 }
1115
1116 .notable-traits .notable-traits-tooltiptext {
1117         display: none;
1118         padding: 5px 3px 3px 3px;
1119         border-radius: 6px;
1120         margin-left: 5px;
1121         z-index: 10;
1122         font-size: 16px;
1123         cursor: default;
1124         position: absolute;
1125         border: 1px solid;
1126 }
1127
1128 .notable-traits-tooltip::after {
1129         /* The margin on the tooltip does not capture hover events,
1130            this extends the area of hover enough so that mouse hover is not
1131            lost when moving the mouse to the tooltip */
1132         content: "\00a0\00a0\00a0";
1133 }
1134
1135 .notable-traits .notable, .notable-traits .docblock {
1136         margin: 0;
1137 }
1138
1139 .notable-traits .docblock code.content{
1140         margin: 0;
1141         padding: 0;
1142         font-size: 20px;
1143 }
1144
1145 /* Example code has the "Run" button that needs to be positioned relative to the pre */
1146 pre.rust.rust-example-rendered {
1147         position: relative;
1148 }
1149
1150 pre.rust {
1151         tab-size: 4;
1152         -moz-tab-size: 4;
1153 }
1154
1155 .search-failed {
1156         text-align: center;
1157         margin-top: 20px;
1158 }
1159
1160 .search-failed > ul {
1161         text-align: left;
1162         max-width: 570px;
1163         margin-left: auto;
1164         margin-right: auto;
1165 }
1166
1167 #titles {
1168         height: 35px;
1169 }
1170
1171 #titles > div {
1172         float: left;
1173         width: 33.3%;
1174         text-align: center;
1175         font-size: 18px;
1176         cursor: pointer;
1177         border-top: 2px solid;
1178 }
1179
1180 #titles > div:not(:last-child) {
1181         margin-right: 1px;
1182         width: calc(33.3% - 1px);
1183 }
1184
1185 #titles > div > div.count {
1186         display: inline-block;
1187         font-size: 16px;
1188 }
1189
1190 .notable-traits {
1191         cursor: pointer;
1192         z-index: 2;
1193         margin-left: 5px;
1194 }
1195
1196 h4 > .notable-traits {
1197         position: absolute;
1198         left: -44px;
1199         top: 2px;
1200 }
1201
1202 #all-types {
1203         text-align: center;
1204         border: 1px solid;
1205         margin: 0 10px;
1206         margin-bottom: 10px;
1207         display: block;
1208         border-radius: 7px;
1209 }
1210 #all-types > p {
1211         margin: 5px 0;
1212 }
1213
1214 #sidebar-toggle {
1215         position: fixed;
1216         top: 30px;
1217         left: 300px;
1218         z-index: 10;
1219         padding: 3px;
1220         border-top-right-radius: 3px;
1221         border-bottom-right-radius: 3px;
1222         cursor: pointer;
1223         font-weight: bold;
1224         transition: left .5s;
1225         font-size: 1.2em;
1226         border: 1px solid;
1227         border-left: 0;
1228 }
1229 #source-sidebar {
1230         position: fixed;
1231         top: 0;
1232         bottom: 0;
1233         left: 0;
1234         width: 300px;
1235         z-index: 1;
1236         overflow: auto;
1237         transition: left .5s;
1238         border-right: 1px solid;
1239 }
1240 #source-sidebar > .title {
1241         font-size: 1.5em;
1242         text-align: center;
1243         border-bottom: 1px solid;
1244         margin-bottom: 6px;
1245 }
1246
1247 .theme-picker {
1248         position: absolute;
1249         left: 211px;
1250         top: 19px;
1251 }
1252
1253 .theme-picker button {
1254         outline: none;
1255 }
1256
1257 #settings-menu, .help-button {
1258         position: absolute;
1259         top: 10px;
1260 }
1261
1262 #settings-menu {
1263         right: 0;
1264         outline: none;
1265 }
1266
1267 .help-button {
1268         right: 30px;
1269         font-family: "Fira Sans",sans-serif;
1270         text-align: center;
1271         font-size: 17px;
1272 }
1273
1274 #theme-picker, #settings-menu, .help-button {
1275         padding: 4px;
1276         width: 27px;
1277         height: 29px;
1278         border: 1px solid;
1279         border-radius: 3px;
1280         cursor: pointer;
1281 }
1282
1283 #theme-choices {
1284         display: none;
1285         position: absolute;
1286         left: 0;
1287         top: 28px;
1288         border: 1px solid;
1289         border-radius: 3px;
1290         z-index: 1;
1291         cursor: pointer;
1292 }
1293
1294 #theme-choices > button {
1295         border: none;
1296         width: 100%;
1297         padding: 4px 8px;
1298         text-align: center;
1299         background: rgba(0,0,0,0);
1300 }
1301
1302 #theme-choices > button:not(:first-child) {
1303         border-top: 1px solid;
1304 }
1305
1306 /* Media Queries */
1307
1308 @media (min-width: 701px) {
1309         /* In case there is no documentation before a code block, we need to add some margin at the top
1310         to prevent an overlay between the "collapse toggle" and the information tooltip.
1311         However, it's needed needed with smaller screen width because the doc/code block is always put
1312         "one line" below. */
1313         .information:first-child > .tooltip {
1314                 margin-top: 16px;
1315         }
1316 }
1317
1318 @media (max-width: 700px) {
1319         body {
1320                 padding-top: 0px;
1321         }
1322
1323         .rustdoc > .sidebar {
1324                 height: 45px;
1325                 min-height: 40px;
1326                 margin: 0;
1327                 margin-left: -15px;
1328                 padding: 0 15px;
1329                 position: static;
1330                 z-index: 11;
1331         }
1332
1333         .sidebar > .location {
1334                 float: right;
1335                 margin: 0px;
1336                 margin-top: 2px;
1337                 padding: 3px 10px 1px 10px;
1338                 min-height: 39px;
1339                 background: inherit;
1340                 text-align: left;
1341                 font-size: 24px;
1342         }
1343
1344         .sidebar .location:empty {
1345                 padding: 0;
1346         }
1347
1348         .sidebar .logo-container {
1349                 width: 35px;
1350                 height: 35px;
1351                 margin-top: 5px;
1352                 margin-bottom: 5px;
1353                 float: left;
1354                 margin-left: 50px;
1355         }
1356
1357         .sidebar .logo-container > img {
1358                 max-width: 35px;
1359                 max-height: 35px;
1360         }
1361
1362         .sidebar-menu {
1363                 position: fixed;
1364                 z-index: 10;
1365                 font-size: 2rem;
1366                 cursor: pointer;
1367                 width: 45px;
1368                 left: 0;
1369                 text-align: center;
1370                 display: block;
1371                 border-bottom: 1px solid;
1372                 border-right: 1px solid;
1373                 height: 45px;
1374         }
1375
1376         .rustdoc.source > .sidebar > .sidebar-menu {
1377                 display: none;
1378         }
1379
1380         .sidebar-elems {
1381                 position: fixed;
1382                 z-index: 1;
1383                 left: 0;
1384                 top: 45px;
1385                 bottom: 0;
1386                 overflow-y: auto;
1387                 border-right: 1px solid;
1388                 display: none;
1389         }
1390
1391         .sidebar > .block.version {
1392                 border-bottom: none;
1393                 margin-top: 12px;
1394         }
1395
1396         nav.sub {
1397                 width: calc(100% - 32px);
1398                 float: right;
1399         }
1400
1401         .content {
1402                 margin-left: 0px;
1403         }
1404
1405         #main {
1406                 margin-top: 45px;
1407                 padding: 0;
1408         }
1409
1410         .content .in-band {
1411                 width: 100%;
1412         }
1413
1414         .content h4 > .out-of-band {
1415                 position: inherit;
1416         }
1417
1418         .toggle-wrapper > .collapse-toggle {
1419                 left: 0px;
1420         }
1421
1422         .toggle-wrapper {
1423                 height: 1.5em;
1424         }
1425
1426         #search {
1427                 margin-left: 0;
1428         }
1429
1430         .content .impl-items .method, .content .impl-items > .type, .impl-items > .associatedconstant {
1431                 display: flex;
1432         }
1433
1434         .anchor {
1435                 display: none !important;
1436         }
1437
1438         h1.fqn {
1439                 overflow: initial;
1440         }
1441
1442         .theme-picker {
1443                 left: 10px;
1444                 top: 54px;
1445                 z-index: 1;
1446         }
1447
1448         h4 > .notable-traits {
1449                 position: absolute;
1450                 left: -22px;
1451                 top: 24px;
1452         }
1453
1454         #titles > div > div.count {
1455                 float: left;
1456                 width: 100%;
1457         }
1458
1459         #titles {
1460                 height: 50px;
1461         }
1462
1463         .sidebar.mobile {
1464                 position: fixed;
1465                 width: 100%;
1466                 margin-left: 0;
1467                 background-color: rgba(0,0,0,0);
1468                 height: 100%;
1469         }
1470         .sidebar {
1471                 width: calc(100% + 30px);
1472         }
1473
1474         .show-it {
1475                 display: block;
1476                 width: 246px;
1477         }
1478
1479         .show-it > .block.items {
1480                 margin: 8px 0;
1481         }
1482
1483         .show-it > .block.items > ul {
1484                 margin: 0;
1485         }
1486
1487         .show-it > .block.items > ul > li {
1488                 text-align: center;
1489                 margin: 2px 0;
1490         }
1491
1492         .show-it > .block.items > ul > li > a {
1493                 font-size: 21px;
1494         }
1495
1496         /* Because of ios, we need to actually have a full height sidebar title so the
1497          * actual sidebar can show up. But then we need to make it transparent so we don't
1498          * hide content. The filler just allows to create the background for the sidebar
1499          * title. But because of the absolute position, I had to lower the z-index.
1500          */
1501         #sidebar-filler {
1502                 position: fixed;
1503                 left: 45px;
1504                 width: calc(100% - 45px);
1505                 top: 0;
1506                 height: 45px;
1507                 z-index: -1;
1508                 border-bottom: 1px solid;
1509         }
1510
1511         .collapse-toggle {
1512                 left: -20px;
1513         }
1514
1515         .impl > .collapse-toggle {
1516                 left: -10px;
1517         }
1518
1519         #all-types {
1520                 margin: 10px;
1521         }
1522
1523         #sidebar-toggle {
1524                 top: 100px;
1525                 width: 30px;
1526                 font-size: 1.5rem;
1527                 text-align: center;
1528                 padding: 0;
1529         }
1530
1531         #source-sidebar {
1532                 z-index: 11;
1533         }
1534
1535         #main > .line-numbers {
1536                 margin-top: 0;
1537         }
1538
1539         .notable-traits .notable-traits-tooltiptext {
1540                 left: 0;
1541                 top: 100%;
1542         }
1543
1544         /* We don't display the help button on mobile devices. */
1545         .help-button {
1546                 display: none;
1547         }
1548         .search-container > div {
1549                 width: calc(100% - 32px);
1550         }
1551 }
1552
1553 @media print {
1554         nav.sub, .content .out-of-band, .collapse-toggle {
1555                 display: none;
1556         }
1557 }
1558
1559 @media (max-width: 416px) {
1560         #titles, #titles > div {
1561                 height: 73px;
1562         }
1563
1564         #main > table:not(.table-display) td {
1565                 word-break: break-word;
1566                 min-width: 10%;
1567         }
1568
1569         .search-container > div {
1570                 display: block;
1571                 width: calc(100% - 37px);
1572         }
1573
1574         #crate-search {
1575                 width: 100%;
1576                 border-radius: 4px;
1577                 border: 0;
1578         }
1579
1580         #crate-search + .search-input {
1581                 width: calc(100% + 71px);
1582                 margin-left: -36px;
1583         }
1584
1585         #theme-picker, #settings-menu {
1586                 padding: 5px;
1587                 width: 31px;
1588                 height: 31px;
1589         }
1590
1591         #theme-picker {
1592                 margin-top: -2px;
1593         }
1594
1595         #settings-menu {
1596                 top: 7px;
1597         }
1598 }
1599
1600 h3.notable {
1601         margin: 0;
1602         margin-bottom: 13px;
1603         font-size: 19px;
1604 }
1605
1606 kbd {
1607         display: inline-block;
1608         padding: 3px 5px;
1609         font: 15px monospace;
1610         line-height: 10px;
1611         vertical-align: middle;
1612         border: solid 1px;
1613         border-radius: 3px;
1614         box-shadow: inset 0 -1px 0;
1615         cursor: default;
1616 }
1617
1618 .hidden-by-impl-hider,
1619 .hidden-by-usual-hider {
1620         /* important because of conflicting rule for small screens */
1621         display: none !important;
1622 }
1623
1624 #implementations-list > h3 > span.in-band {
1625         width: 100%;
1626 }
1627
1628 .table-display {
1629         width: 100%;
1630         border: 0;
1631         border-collapse: collapse;
1632         border-spacing: 0;
1633         font-size: 16px;
1634 }
1635
1636 .table-display tr td:first-child {
1637         padding-right: 0;
1638 }
1639
1640 .table-display tr td:last-child {
1641         float: right;
1642 }
1643 .table-display .out-of-band {
1644         position: relative;
1645         font-size: 19px;
1646         display: block;
1647 }
1648 #implementors-list > .impl-items .table-display .out-of-band {
1649         font-size: 17px;
1650 }
1651
1652 .table-display td:hover .anchor {
1653         display: block;
1654         top: 2px;
1655         left: -5px;
1656 }
1657
1658 #main > ul {
1659         padding-left: 10px;
1660 }
1661 #main > ul > li {
1662         list-style: none;
1663 }
1664
1665 .non-exhaustive {
1666         margin-bottom: 1em;
1667 }
1668
1669 div.children {
1670         padding-left: 27px;
1671         display: none;
1672 }
1673 div.name {
1674         cursor: pointer;
1675         position: relative;
1676         margin-left: 16px;
1677 }
1678 div.files > a {
1679         display: block;
1680         padding: 0 3px;
1681 }
1682 div.files > a:hover, div.name:hover {
1683         background-color: #a14b4b;
1684 }
1685 div.name.expand + .children {
1686         display: block;
1687 }
1688 div.name::before {
1689         content: "\25B6";
1690         padding-left: 4px;
1691         font-size: 0.7em;
1692         position: absolute;
1693         left: -16px;
1694         top: 4px;
1695 }
1696 div.name.expand::before {
1697         transform: rotate(90deg);
1698         left: -15px;
1699         top: 2px;
1700 }
1701
1702 /* This part is to fix the "Expand attributes" part in the type declaration. */
1703 .type-decl > pre > .toggle-wrapper.toggle-attributes.top-attr {
1704         margin-left: 0 !important;
1705 }
1706 .type-decl > pre > .docblock.attributes.top-attr {
1707         margin-left: 1.8em !important;
1708 }
1709 .type-decl > pre > .toggle-attributes {
1710         margin-left: 2.2em;
1711 }
1712 .type-decl > pre > .docblock.attributes {
1713         margin-left: 4em;
1714 }