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