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