]> git.lizzy.rs Git - rust.git/blob - src/librustdoc/html/static/css/rustdoc.css
Auto merge of #99756 - fasterthanlime:ra-sync-and-pms-component, r=Mark-Simulacrum
[rust.git] / src / librustdoc / html / static / css / 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         font-display: swap;
9 }
10 @font-face {
11         font-family: 'Fira Sans';
12         font-style: normal;
13         font-weight: 500;
14         src: local('Fira Sans Medium'),
15                 url("FiraSans-Medium.woff2") format("woff2");
16         font-display: swap;
17 }
18
19 /* See SourceSerif4-LICENSE.md for the Source Serif 4 license. */
20 @font-face {
21         font-family: 'Source Serif 4';
22         font-style: normal;
23         font-weight: 400;
24         src: local('Source Serif 4'),
25                 url("SourceSerif4-Regular.ttf.woff2") format("woff2");
26         font-display: swap;
27 }
28 @font-face {
29         font-family: 'Source Serif 4';
30         font-style: italic;
31         font-weight: 400;
32         src: local('Source Serif 4 Italic'),
33                 url("SourceSerif4-It.ttf.woff2") format("woff2");
34         font-display: swap;
35 }
36 @font-face {
37         font-family: 'Source Serif 4';
38         font-style: normal;
39         font-weight: 700;
40         src: local('Source Serif 4 Bold'),
41                 url("SourceSerif4-Bold.ttf.woff2") format("woff2");
42         font-display: swap;
43 }
44
45 /* See SourceCodePro-LICENSE.txt for the Source Code Pro license. */
46 @font-face {
47         font-family: 'Source Code Pro';
48         font-style: normal;
49         font-weight: 400;
50         /* Avoid using locally installed font because bad versions are in circulation:
51          * see https://github.com/rust-lang/rust/issues/24355 */
52         src: url("SourceCodePro-Regular.ttf.woff2") format("woff2");
53         font-display: swap;
54 }
55 @font-face {
56         font-family: 'Source Code Pro';
57         font-style: italic;
58         font-weight: 400;
59         src: url("SourceCodePro-It.ttf.woff2") format("woff2");
60         font-display: swap;
61 }
62 @font-face {
63         font-family: 'Source Code Pro';
64         font-style: normal;
65         font-weight: 600;
66         src: url("SourceCodePro-Semibold.ttf.woff2") format("woff2");
67         font-display: swap;
68 }
69
70 /* Avoid using legacy CJK serif fonts in Windows like Batang. */
71 @font-face {
72         font-family: 'NanumBarunGothic';
73         src: url("NanumBarunGothic.ttf.woff2") format("woff2");
74         font-display: swap;
75         unicode-range: U+AC00-D7AF, U+1100-11FF, U+3130-318F, U+A960-A97F, U+D7B0-D7FF;
76 }
77
78 * {
79         -webkit-box-sizing: border-box;
80         -moz-box-sizing: border-box;
81         box-sizing: border-box;
82 }
83
84 /* This part handles the "default" theme being used depending on the system one. */
85 html {
86         content: "";
87 }
88 @media (prefers-color-scheme: light) {
89         html {
90                 content: "light";
91         }
92 }
93 @media (prefers-color-scheme: dark) {
94         html {
95                 content: "dark";
96         }
97 }
98
99 /* General structure and fonts */
100
101 body {
102         /* Line spacing at least 1.5 per Web Content Accessibility Guidelines
103            https://www.w3.org/WAI/WCAG21/Understanding/visual-presentation.html */
104         font: 1rem/1.5 "Source Serif 4", NanumBarunGothic, serif;
105         margin: 0;
106         position: relative;
107         /* We use overflow-wrap: break-word for Safari, which doesn't recognize
108            `anywhere`: https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-wrap */
109         overflow-wrap: break-word;
110         /* Then override it with `anywhere`, which is required to make non-Safari browsers break
111            more aggressively when we want them to. */
112         overflow-wrap: anywhere;
113
114         -webkit-font-feature-settings: "kern", "liga";
115         -moz-font-feature-settings: "kern", "liga";
116         font-feature-settings: "kern", "liga";
117
118         background-color: var(--main-background-color);
119         color: var(--main-color);
120 }
121
122 h1 {
123         font-size: 1.5rem; /* 24px */
124 }
125 h2 {
126         font-size: 1.375rem; /* 22px */
127 }
128 h3 {
129         font-size: 1.25rem; /* 20px */
130 }
131 h1, h2, h3, h4, h5, h6 {
132         font-weight: 500;
133 }
134 h1, h2, h3, h4 {
135         margin: 20px 0 15px 0;
136         padding-bottom: 6px;
137 }
138 .docblock h3, .docblock h4, h5, h6 {
139         margin: 15px 0 5px 0;
140 }
141 h1.fqn {
142         margin: 0;
143         padding: 0;
144         border-bottom-color: var(--headings-border-bottom-color);
145 }
146 h2, h3, h4 {
147         border-bottom-color: var(--headings-border-bottom-color);
148 }
149 .main-heading {
150         display: flex;
151         flex-wrap: wrap;
152         justify-content: space-between;
153         padding-bottom: 6px;
154         margin-bottom: 15px;
155 }
156 .main-heading a:hover {
157         text-decoration: underline;
158 }
159 #toggle-all-docs {
160         text-decoration: none;
161 }
162 /* The only headings that get underlines are:
163          Markdown-generated headings within the top-doc
164          Rustdoc-generated h2 section headings (e.g. "Implementations", "Required Methods", etc)
165         Underlines elsewhere in the documentation break up visual flow and tend to invert
166         section hierarchies. */
167 h2,
168 .top-doc .docblock > h3,
169 .top-doc .docblock > h4 {
170         border-bottom: 1px solid var(--headings-border-bottom-color);
171 }
172 h3.code-header {
173         font-size: 1.125rem; /* 18px */
174 }
175 h4.code-header {
176         font-size: 1rem;
177 }
178 .code-header {
179         font-weight: 600;
180         border-bottom-style: none;
181         margin: 0;
182         padding: 0;
183         margin-top: 0.6em;
184         margin-bottom: 0.4em;
185 }
186 .impl,
187 .impl-items .method,
188 .methods .method,
189 .impl-items .type,
190 .methods .type,
191 .impl-items .associatedconstant,
192 .methods .associatedconstant,
193 .impl-items .associatedtype,
194 .methods .associatedtype {
195         flex-basis: 100%;
196         font-weight: 600;
197         position: relative;
198 }
199
200 div.impl-items > div {
201         padding-left: 0;
202 }
203
204 h1, h2, h3, h4, h5, h6,
205 .sidebar,
206 .mobile-topbar,
207 a.source,
208 .search-input,
209 .search-results .result-name,
210 .content table td:first-child > a,
211 .item-left > a,
212 .out-of-band,
213 span.since,
214 #source-sidebar, #sidebar-toggle,
215 details.rustdoc-toggle > summary::before,
216 div.impl-items > div:not(.docblock):not(.item-info),
217 .content ul.crate a.crate,
218 a.srclink,
219 #main-content > .since,
220 #help-button > button,
221 details.rustdoc-toggle.top-doc > summary,
222 details.rustdoc-toggle.top-doc > summary::before,
223 details.rustdoc-toggle.non-exhaustive > summary,
224 details.rustdoc-toggle.non-exhaustive > summary::before,
225 .scraped-example-title,
226 .more-examples-toggle summary, .more-examples-toggle .hide-more,
227 .example-links a,
228 /* This selector is for the items listed in the "all items" page. */
229 #main-content > ul.docblock > li > a {
230         font-family: "Fira Sans", Arial, NanumBarunGothic, sans-serif;
231 }
232
233 h1, h2, h3, h4,
234 a#toggle-all-docs,
235 a.anchor,
236 .small-section-header a,
237 #source-sidebar a,
238 pre.rust a,
239 .sidebar h2 a,
240 .sidebar h3 a,
241 .mobile-topbar h2 a,
242 .in-band a,
243 .search-results a,
244 .module-item .stab,
245 .import-item .stab,
246 .result-name .primitive > i, .result-name .keyword > i,
247 .content .method .where,
248 .content .fn .where,
249 .content .where.fmt-newline {
250         color: var(--main-color);
251 }
252
253 ol, ul {
254         padding-left: 24px;
255 }
256 ul ul, ol ul, ul ol, ol ol {
257         margin-bottom: .625em;
258 }
259
260 p {
261         /* Paragraph spacing at least 1.5 times line spacing per Web Content Accessibility Guidelines.
262            Line-height is 1.5rem, so line spacing is .5rem; .75em is 1.5 times that.
263            https://www.w3.org/WAI/WCAG21/Understanding/visual-presentation.html */
264         margin: 0 0 .75em 0;
265 }
266
267 summary {
268         outline: none;
269 }
270
271 /* Fix some style changes due to normalize.css 8 */
272
273 td,
274 th {
275         padding: 0;
276 }
277
278 table {
279         border-collapse: collapse;
280 }
281
282 button,
283 input,
284 optgroup,
285 select,
286 textarea {
287         color: inherit;
288         font: inherit;
289         margin: 0;
290 }
291
292 button {
293         /* Buttons on Safari have different default padding than other platforms. Make them the same. */
294         padding: 1px 6px;
295 }
296
297 /* end tweaks for normalize.css 8 */
298
299 .rustdoc {
300         display: flex;
301         flex-direction: row;
302         flex-wrap: nowrap;
303 }
304
305 main {
306         position: relative;
307         flex-grow: 1;
308         padding: 10px 15px 40px 45px;
309         min-width: 0;
310 }
311
312 .source main {
313         padding: 15px;
314 }
315
316 .width-limiter {
317         max-width: 960px;
318         margin-right: auto;
319 }
320
321 .source .width-limiter {
322         max-width: unset;
323 }
324
325 details:not(.rustdoc-toggle) summary {
326         margin-bottom: .6em;
327 }
328
329 code, pre, a.test-arrow, .code-header {
330         font-family: "Source Code Pro", monospace;
331 }
332 .docblock code, .docblock-short code {
333         border-radius: 3px;
334         padding: 0 0.125em;
335 }
336 .docblock pre code, .docblock-short pre code {
337         padding: 0;
338 }
339 pre {
340         padding: 14px;
341 }
342 .docblock.item-decl {
343         margin-left: 0;
344 }
345 .item-decl pre {
346         overflow-x: auto;
347 }
348
349 .source .content pre {
350         padding: 20px;
351 }
352
353 img {
354         max-width: 100%;
355 }
356
357 li {
358         position: relative;
359 }
360
361 .source .content {
362         max-width: none;
363         overflow: visible;
364         margin-left: 0px;
365 }
366
367 nav.sub {
368         position: relative;
369         font-size: 1rem;
370 }
371
372 .sub-container {
373         display: flex;
374         flex-direction: row;
375         flex-wrap: nowrap;
376 }
377
378 .sub-logo-container {
379         display: none;
380         margin-right: 20px;
381 }
382
383 .source .sub-logo-container {
384         display: block;
385 }
386
387 .source .sub-logo-container > img {
388         height: 60px;
389         width: 60px;
390         object-fit: contain;
391 }
392
393 .sidebar, .mobile-topbar, .sidebar-menu-toggle {
394         background-color: var(--sidebar-background-color);
395 }
396
397 .sidebar {
398         font-size: 0.875rem;
399         width: 250px;
400         min-width: 200px;
401         overflow-y: scroll;
402         position: sticky;
403         height: 100vh;
404         top: 0;
405         left: 0;
406 }
407
408 .sidebar-elems,
409 .sidebar > .location {
410         padding-left: 24px;
411 }
412
413 .sidebar .location {
414         overflow-wrap: anywhere;
415 }
416
417 .rustdoc.source .sidebar {
418         width: 50px;
419         min-width: 0px;
420         max-width: 300px;
421         flex-grow: 0;
422         flex-shrink: 0;
423         flex-basis: auto;
424         border-right: 1px solid;
425         overflow-x: hidden;
426         /* The sidebar is by default hidden  */
427         overflow-y: hidden;
428 }
429
430 .rustdoc.source .sidebar .sidebar-logo {
431         display: none;
432 }
433
434 .source .sidebar, #sidebar-toggle, #source-sidebar {
435         background-color: var(--sidebar-background-color);
436 }
437
438 #sidebar-toggle > button:hover, #sidebar-toggle > button:focus {
439         background-color: var(--sidebar-background-color-hover);
440 }
441
442 .source .sidebar > *:not(#sidebar-toggle) {
443         opacity: 0;
444         visibility: hidden;
445 }
446
447 .source-sidebar-expanded .source .sidebar {
448         overflow-y: auto;
449 }
450
451 .source-sidebar-expanded .source .sidebar > *:not(#sidebar-toggle) {
452         opacity: 1;
453         visibility: visible;
454 }
455
456 #all-types {
457         margin-top: 1em;
458 }
459
460 /* Improve the scrollbar display on firefox */
461 * {
462         scrollbar-width: initial;
463         scrollbar-color: var(--scrollbar-color);
464 }
465 .sidebar {
466         scrollbar-width: thin;
467         scrollbar-color: var(--scrollbar-color);
468 }
469
470 /* Improve the scrollbar display on webkit-based browsers */
471 ::-webkit-scrollbar {
472         width: 12px;
473 }
474 .sidebar::-webkit-scrollbar {
475         width: 8px;
476 }
477 ::-webkit-scrollbar-track {
478         -webkit-box-shadow: inset 0;
479         background-color: var(--scrollbar-track-background-color);
480 }
481 .sidebar::-webkit-scrollbar-track {
482         background-color: var(--scrollbar-track-background-color);
483 }
484 ::-webkit-scrollbar-thumb, .sidebar::-webkit-scrollbar-thumb {
485         background-color: var(--scrollbar-thumb-background-color);
486 }
487
488 /* Everything else */
489
490 .hidden {
491         display: none !important;
492 }
493
494 .sidebar .logo-container {
495         display: flex;
496         margin-top: 10px;
497         margin-bottom: 10px;
498         justify-content: center;
499 }
500
501 .version {
502         overflow-wrap: break-word;
503 }
504
505 .logo-container > img {
506         height: 100px;
507         width: 100px;
508 }
509
510 .location:empty {
511         border: none;
512 }
513
514 .location a:first-of-type {
515         font-weight: 500;
516 }
517
518 .block {
519         padding: 0;
520 }
521 .block ul, .block li {
522         padding: 0;
523         margin: 0;
524         list-style: none;
525 }
526
527 .block a,
528 h2.location a {
529         display: block;
530         padding: 0.25rem;
531         margin-left: -0.25rem;
532
533         text-overflow: ellipsis;
534         overflow: hidden;
535 }
536
537 .sidebar h2 {
538         border-bottom: none;
539         font-weight: 500;
540         padding: 0;
541         margin: 0;
542         margin-top: 0.7rem;
543         margin-bottom: 0.7rem;
544 }
545
546 .sidebar h3 {
547         font-size: 1.125rem; /* 18px */
548         font-weight: 500;
549         padding: 0;
550         margin: 0;
551 }
552
553 .sidebar-elems .block {
554         margin-bottom: 2em;
555 }
556
557 .sidebar-elems .block li a {
558         white-space: nowrap;
559 }
560
561 .mobile-topbar {
562         display: none;
563 }
564
565 .source .content pre.rust {
566         white-space: pre;
567         overflow: auto;
568         padding-left: 0;
569 }
570
571 .rustdoc .example-wrap {
572         display: inline-flex;
573         margin-bottom: 10px;
574 }
575
576 .example-wrap {
577         position: relative;
578         width: 100%;
579 }
580
581 .example-wrap > pre.line-number {
582         overflow: initial;
583         border: 1px solid;
584         padding: 13px 8px;
585         text-align: right;
586         border-top-left-radius: 5px;
587         border-bottom-left-radius: 5px;
588 }
589
590 .example-wrap > pre.rust a:hover {
591         text-decoration: underline;
592 }
593
594 .line-numbers {
595         text-align: right;
596 }
597 .rustdoc:not(.source) .example-wrap > pre:not(.line-number) {
598         width: 100%;
599         overflow-x: auto;
600 }
601
602 .rustdoc:not(.source) .example-wrap > pre.line-numbers {
603         width: auto;
604         overflow-x: visible;
605 }
606
607 .rustdoc .example-wrap > pre {
608         margin: 0;
609 }
610
611 #search {
612         position: relative;
613 }
614
615 .search-loading {
616         text-align: center;
617 }
618
619 #results > table {
620         width: 100%;
621         table-layout: fixed;
622 }
623
624 .content > .example-wrap pre.line-numbers {
625         position: relative;
626         -webkit-user-select: none;
627         -moz-user-select: none;
628         -ms-user-select: none;
629         user-select: none;
630 }
631 .line-numbers span {
632         cursor: pointer;
633 }
634
635 .docblock-short {
636         overflow-wrap: break-word;
637         overflow-wrap: anywhere;
638 }
639 .docblock-short p {
640         display: inline;
641 }
642
643 .docblock-short p {
644         overflow: hidden;
645         text-overflow: ellipsis;
646         margin: 0;
647 }
648 /* Wrap non-pre code blocks (`text`) but not (```text```). */
649 .docblock > :not(pre) > code,
650 .docblock-short > :not(pre) > code {
651         white-space: pre-wrap;
652 }
653
654 .top-doc .docblock h2 { font-size: 1.375rem; }
655 .top-doc .docblock h3 { font-size: 1.25rem; }
656 .top-doc .docblock h4,
657 .top-doc .docblock h5 {
658         font-size: 1.125rem;
659 }
660 .top-doc .docblock h6 {
661         font-size: 1rem;
662 }
663
664 .docblock h5 { font-size: 1rem; }
665 .docblock h6 { font-size: 0.875rem; }
666 .docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5, .docblock h6 {
667         border-bottom-color: var(--headings-border-bottom-color);
668 }
669
670 .docblock {
671         margin-left: 24px;
672         position: relative;
673 }
674
675 .docblock > :not(.information):not(.more-examples-toggle) {
676         max-width: 100%;
677         overflow-x: auto;
678 }
679
680 .content .out-of-band {
681         flex-grow: 0;
682         font-size: 1.125rem;
683         font-weight: normal;
684         float: right;
685 }
686
687 .method > .code-header, .trait-impl > .code-header {
688         max-width: calc(100% - 41px);
689         display: block;
690 }
691
692 .content .in-band {
693         flex-grow: 1;
694         margin: 0px;
695         padding: 0px;
696         overflow-wrap: break-word;
697         overflow-wrap: anywhere;
698 }
699
700 .in-band > code, .in-band > .code-header {
701         display: inline-block;
702 }
703
704 .docblock code, .docblock-short code,
705 pre, .rustdoc.source .example-wrap {
706         background-color: var(--code-block-background-color);
707 }
708
709 #main-content {
710         position: relative;
711 }
712 #main-content > .since {
713         top: inherit;
714 }
715
716 .content table:not(.table-display) {
717         border-spacing: 0 5px;
718 }
719 .content td { vertical-align: top; }
720 .content td:first-child { padding-right: 20px; }
721 .content td p:first-child { margin-top: 0; }
722 .content td h1, .content td h2 { margin-left: 0; font-size: 1.125rem; }
723 .content tr:first-child td { border-top: 0; }
724
725 .docblock table {
726         margin: .5em 0;
727         width: calc(100% - 2px);
728         overflow-x: auto;
729         display: block;
730 }
731
732 .docblock table td {
733         padding: .5em;
734         border: 1px dashed;
735 }
736
737 .docblock table th {
738         padding: .5em;
739         text-align: left;
740         border: 1px solid;
741 }
742
743 .fields + table {
744         margin-bottom: 1em;
745 }
746
747 .content .item-list {
748         list-style-type: none;
749         padding: 0;
750 }
751
752 .content .multi-column {
753         -moz-column-count: 5;
754         -moz-column-gap: 2.5em;
755         -webkit-column-count: 5;
756         -webkit-column-gap: 2.5em;
757         column-count: 5;
758         column-gap: 2.5em;
759 }
760 .content .multi-column li { width: 100%; display: inline-block; }
761
762 .content > .methods > .method {
763         font-size: 1rem;
764         position: relative;
765 }
766 /* Shift "where ..." part of method or fn definition down a line */
767 .content .method .where,
768 .content .fn .where,
769 .content .where.fmt-newline {
770         display: block;
771         font-size: 0.875rem;
772 }
773
774 .content .methods > div:not(.notable-traits):not(.method) {
775         margin-left: 40px;
776         margin-bottom: 15px;
777 }
778
779 .content .docblock > .impl-items {
780         margin-left: 20px;
781         margin-top: -34px;
782 }
783 .content .docblock >.impl-items .table-display {
784         margin: 0;
785 }
786 .content .docblock >.impl-items table td {
787         padding: 0;
788 }
789 .content .docblock > .impl-items .table-display, .impl-items table td {
790         border: none;
791 }
792
793 .item-info {
794         display: block;
795 }
796
797 .content .item-info code {
798         font-size: 0.875rem;
799 }
800
801 .content .item-info {
802         position: relative;
803         margin-left: 24px;
804 }
805
806 .sub-variant > div > .item-info {
807         margin-top: initial;
808 }
809
810 .content .impl-items .docblock, .content .impl-items .item-info {
811         margin-bottom: .6em;
812 }
813
814 .content .impl-items > .item-info {
815         margin-left: 40px;
816 }
817
818 .methods > .item-info, .content .impl-items > .item-info {
819         margin-top: -8px;
820 }
821
822 .impl-items {
823         flex-basis: 100%;
824 }
825
826 #main-content > .item-info {
827         margin-top: 0;
828         margin-left: 0;
829 }
830
831 nav.sub {
832         flex-grow: 1;
833         margin-bottom: 25px;
834 }
835 .source nav.sub {
836         margin-left: 32px;
837 }
838 nav.main {
839         padding: 20px 0;
840         text-align: center;
841 }
842 nav.main .current {
843         border-top: 1px solid;
844         border-bottom: 1px solid;
845 }
846 nav.main .separator {
847         border: 1px solid;
848         display: inline-block;
849         height: 23px;
850         margin: 0 20px;
851 }
852 nav.sum { text-align: right; }
853 nav.sub form { display: inline; }
854
855 a {
856         text-decoration: none;
857         background: transparent;
858 }
859
860 .small-section-header {
861         display: flex;
862         justify-content: space-between;
863         position: relative;
864 }
865
866 .small-section-header:hover > .anchor {
867         display: initial;
868 }
869
870 .in-band:hover > .anchor, .impl:hover > .anchor, .method.trait-impl:hover > .anchor,
871 .type.trait-impl:hover > .anchor, .associatedconstant.trait-impl:hover > .anchor,
872 .associatedtype.trait-impl:hover > .anchor {
873         display: inline-block;
874         position: absolute;
875 }
876 .anchor {
877         display: none;
878         position: absolute;
879         left: -0.5em;
880         background: none !important;
881 }
882 .anchor.field {
883         left: -5px;
884 }
885 .small-section-header > .anchor {
886         left: -15px;
887         padding-right: 8px;
888 }
889 h2.small-section-header > .anchor {
890         padding-right: 6px;
891 }
892 .anchor::before {
893         content: '§';
894 }
895
896 .docblock a:not(.srclink):not(.test-arrow):not(.scrape-help):hover,
897 .docblock-short a:not(.srclink):not(.test-arrow):not(.scrape-help):hover, .item-info a {
898         text-decoration: underline;
899 }
900
901 .block a.current.crate { font-weight: 500; }
902
903 /*  In most contexts we use `overflow-wrap: anywhere` to ensure that we can wrap
904         as much as needed on mobile (see
905         src/test/rustdoc-gui/type-declaration-overflow.goml for an example of why
906         this matters). The `anywhere` value means:
907
908         "Soft wrap opportunities introduced by the word break are considered when
909          calculating min-content intrinsic sizes."
910
911         https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-wrap#values
912
913         For table layouts, that becomes a problem: the browser tries to make each
914         column as narrow as possible, and `overflow-wrap: anywhere` means it can do
915         so by breaking words - even if some other column could be shrunk without
916         breaking words! This shows up, for instance, in the `Structs` / `Modules` /
917         `Functions` (etcetera) sections of a module page, and when a docblock
918         contains a table.
919
920         So, for table layouts, override the default with break-word, which does
921         _not_ affect min-content intrinsic sizes.
922 */
923 table,
924 .item-table {
925         overflow-wrap: break-word;
926 }
927
928 .item-table {
929         display: table;
930 }
931 .item-row {
932         display: table-row;
933 }
934 .item-left, .item-right {
935         display: table-cell;
936 }
937 .item-left {
938         padding-right: 1.25rem;
939 }
940
941 .search-container {
942         position: relative;
943         display: flex;
944         height: 34px;
945 }
946 .search-container > * {
947         height: 100%;
948 }
949 .search-results-title {
950         display: inline;
951 }
952 #search-settings {
953         font-size: 1.5rem;
954         font-weight: 500;
955         margin-bottom: 20px;
956 }
957 #crate-search {
958         min-width: 115px;
959         margin-top: 5px;
960         padding-left: 0.15em;
961         padding-right: 23px;
962         border: 1px solid;
963         border-radius: 4px;
964         outline: none;
965         cursor: pointer;
966         -moz-appearance: none;
967         -webkit-appearance: none;
968         /* Removes default arrow from firefox */
969         background-repeat: no-repeat;
970         background-color: transparent;
971         background-size: 20px;
972         background-position: calc(100% - 1px) 56%;
973         background-image: /* AUTOREPLACE: */url("down-arrow.svg");
974         max-width: 100%;
975         text-overflow: ellipsis;
976 }
977 .search-container {
978         margin-top: 4px;
979 }
980 .search-input {
981         /* Override Normalize.css: it has a rule that sets
982            -webkit-appearance: textfield for search inputs. That
983            causes rounded corners and no border on iOS Safari. */
984         -webkit-appearance: none;
985         /* Override Normalize.css: we have margins and do
986          not want to overflow - the `moz` attribute is necessary
987          until Firefox 29, too early to drop at this point */
988         -moz-box-sizing: border-box !important;
989         box-sizing: border-box !important;
990         outline: none;
991         border: 1px solid;
992         border-radius: 2px;
993         padding: 8px;
994         font-size: 1rem;
995         width: 100%;
996 }
997
998 .search-results {
999         display: none;
1000         padding-bottom: 2em;
1001 }
1002
1003 .search-results.active {
1004         display: block;
1005         /* prevent overhanging tabs from moving the first result */
1006         clear: both;
1007 }
1008
1009 .search-results .desc > span {
1010         white-space: nowrap;
1011         text-overflow: ellipsis;
1012         overflow: hidden;
1013         display: block;
1014 }
1015
1016 .search-results > a {
1017         display: block;
1018         width: 100%;
1019         /* A little margin ensures the browser's outlining of focused links has room to display. */
1020         margin-left: 2px;
1021         margin-right: 2px;
1022         border-bottom: 1px solid #aaa3;
1023 }
1024
1025 .search-results > a > div {
1026         display: flex;
1027         flex-flow: row wrap;
1028 }
1029
1030 .search-results .result-name, .search-results div.desc, .search-results .result-description {
1031         width: 50%;
1032 }
1033 .search-results .result-name {
1034         padding-right: 1em;
1035 }
1036
1037 .search-results .result-name > span {
1038         display: inline-block;
1039         margin: 0;
1040         font-weight: normal;
1041 }
1042
1043 .popover {
1044         font-size: 1rem;
1045         position: absolute;
1046         right: 0;
1047         z-index: 2;
1048         display: block;
1049         margin-top: 7px;
1050         border-radius: 3px;
1051         border: 1px solid;
1052         font-size: 1rem;
1053 }
1054
1055 /* This rule is to draw the little arrow connecting the settings menu to the gear icon. */
1056 .popover::before {
1057         content: '';
1058         position: absolute;
1059         right: 11px;
1060         border: solid;
1061         border-width: 1px 1px 0 0;
1062         display: inline-block;
1063         padding: 4px;
1064         transform: rotate(-45deg);
1065         top: -5px;
1066 }
1067
1068 .popover, .popover::before {
1069         background-color: var(--main-background-color);
1070         color: var(--main-color);
1071 }
1072
1073 #help-button .popover {
1074         max-width: 600px;
1075 }
1076
1077 #help-button .popover::before {
1078         right: 48px;
1079 }
1080
1081 #help-button dt {
1082         float: left;
1083         clear: left;
1084         display: block;
1085         margin-right: 0.5rem;
1086 }
1087 #help-button span.top, #help-button span.bottom {
1088         text-align: center;
1089         display: block;
1090         font-size: 1.125rem;
1091 }
1092 #help-button span.top {
1093         text-align: center;
1094         display: block;
1095         margin: 10px 0;
1096         border-bottom: 1px solid;
1097         padding-bottom: 4px;
1098         margin-bottom: 6px;
1099 }
1100 #help-button span.bottom {
1101         clear: both;
1102         border-top: 1px solid;
1103 }
1104 .side-by-side {
1105         text-align: initial;
1106 }
1107 .side-by-side > div {
1108         width: 50%;
1109         float: left;
1110         padding: 0 20px 20px 17px;
1111 }
1112
1113 .item-info .stab {
1114         display: inline-block;
1115 }
1116 .stab {
1117         padding: 3px;
1118         margin-bottom: 5px;
1119         font-size: 0.875rem;
1120         font-weight: normal;
1121 }
1122 .stab p {
1123         display: inline;
1124 }
1125
1126 .stab .emoji {
1127         font-size: 1.25rem;
1128 }
1129
1130 /* Black one-pixel outline around emoji shapes */
1131 .emoji {
1132         text-shadow:
1133                 1px 0 0 black,
1134                 -1px 0 0 black,
1135                 0  1px 0 black,
1136                 0 -1px 0 black;
1137 }
1138
1139 .module-item .stab,
1140 .import-item .stab {
1141         border-radius: 3px;
1142         display: inline-block;
1143         font-size: 0.875rem;
1144         line-height: 1.2;
1145         margin-bottom: 0;
1146         margin-left: 0.3125em;
1147         padding: 2px;
1148         vertical-align: text-bottom;
1149 }
1150
1151 .module-item.unstable,
1152 .import-item.unstable {
1153         opacity: 0.65;
1154 }
1155
1156 .since {
1157         font-weight: normal;
1158         font-size: initial;
1159 }
1160
1161 .rightside {
1162         padding-left: 12px;
1163         padding-right: 2px;
1164         position: initial;
1165 }
1166
1167 .impl-items .srclink, .impl .srclink, .methods .srclink {
1168         /* Override header settings otherwise it's too bold */
1169         font-weight: normal;
1170         font-size: 1rem;
1171 }
1172
1173 .rightside {
1174         float: right;
1175 }
1176
1177 .variants_table {
1178         width: 100%;
1179 }
1180
1181 .variants_table tbody tr td:first-child {
1182         width: 1%; /* make the variant name as small as possible */
1183 }
1184
1185 td.summary-column {
1186         width: 100%;
1187 }
1188
1189 .summary {
1190         padding-right: 0px;
1191 }
1192
1193 pre.rust .question-mark {
1194         font-weight: bold;
1195 }
1196
1197 a.test-arrow {
1198         display: inline-block;
1199         visibility: hidden;
1200         position: absolute;
1201         padding: 5px 10px 5px 10px;
1202         border-radius: 5px;
1203         font-size: 1.375rem;
1204         top: 5px;
1205         right: 5px;
1206         z-index: 1;
1207 }
1208 .example-wrap:hover .test-arrow {
1209         visibility: visible;
1210 }
1211 a.test-arrow:hover{
1212         text-decoration: none;
1213 }
1214
1215 .code-attribute {
1216         font-weight: 300;
1217 }
1218
1219 .item-spacer {
1220         width: 100%;
1221         height: 12px;
1222 }
1223
1224 .out-of-band > span.since {
1225         position: initial;
1226         font-size: 1.25rem;
1227 }
1228
1229 h3.variant {
1230         font-weight: 600;
1231         font-size: 1.125rem;
1232         margin-bottom: 10px;
1233         border-bottom: none;
1234 }
1235
1236 .sub-variant h4 {
1237         font-size: 1rem;
1238         font-weight: 400;
1239         border-bottom: none;
1240         margin-top: 0;
1241         margin-bottom: 0;
1242 }
1243
1244 .sub-variant {
1245         margin-left: 24px;
1246         margin-bottom: 40px;
1247 }
1248
1249 .sub-variant > .sub-variant-field {
1250         margin-left: 24px;
1251 }
1252
1253 .toggle-label {
1254         display: inline-block;
1255         margin-left: 4px;
1256         margin-top: 3px;
1257 }
1258
1259 :target > code, :target > .code-header {
1260         opacity: 1;
1261 }
1262
1263 :target {
1264         padding-right: 3px;
1265 }
1266
1267 .information {
1268         position: absolute;
1269         left: -25px;
1270         margin-top: 7px;
1271         z-index: 1;
1272 }
1273
1274 .tooltip {
1275         position: relative;
1276         display: inline-block;
1277         cursor: pointer;
1278 }
1279
1280 .tooltip::after {
1281         display: none;
1282         text-align: center;
1283         padding: 5px 3px 3px 3px;
1284         border-radius: 6px;
1285         margin-left: 5px;
1286         font-size: 1rem;
1287 }
1288
1289 .tooltip.ignore::after {
1290         content: "This example is not tested";
1291 }
1292 .tooltip.compile_fail::after {
1293         content: "This example deliberately fails to compile";
1294 }
1295 .tooltip.should_panic::after {
1296         content: "This example panics";
1297 }
1298 .tooltip.edition::after {
1299         content: "This code runs with edition " attr(data-edition);
1300 }
1301
1302 .tooltip::before {
1303         content: " ";
1304         position: absolute;
1305         top: 50%;
1306         left: 16px;
1307         margin-top: -5px;
1308         border-width: 5px;
1309         border-style: solid;
1310         display: none;
1311 }
1312
1313 .tooltip:hover::before, .tooltip:hover::after {
1314         display: inline;
1315 }
1316
1317 .tooltip.compile_fail, .tooltip.should_panic, .tooltip.ignore {
1318         font-weight: bold;
1319         font-size: 1.25rem;
1320 }
1321
1322 .notable-traits-tooltip {
1323         display: inline-block;
1324         cursor: pointer;
1325 }
1326
1327 .notable-traits:hover .notable-traits-tooltiptext,
1328 .notable-traits .notable-traits-tooltiptext.force-tooltip {
1329         display: inline-block;
1330 }
1331
1332 .notable-traits .notable-traits-tooltiptext {
1333         display: none;
1334         padding: 5px 3px 3px 3px;
1335         border-radius: 6px;
1336         margin-left: 5px;
1337         z-index: 10;
1338         font-size: 1rem;
1339         cursor: default;
1340         position: absolute;
1341         border: 1px solid;
1342 }
1343
1344 .notable-traits-tooltip::after {
1345         /* The margin on the tooltip does not capture hover events,
1346            this extends the area of hover enough so that mouse hover is not
1347            lost when moving the mouse to the tooltip */
1348         content: "\00a0\00a0\00a0";
1349 }
1350
1351 .notable-traits .notable, .notable-traits .docblock {
1352         margin: 0;
1353 }
1354
1355 .notable-traits .notable {
1356         margin: 0;
1357         margin-bottom: 13px;
1358         font-size: 1.1875rem;
1359         font-weight: 600;
1360         display: block;
1361 }
1362
1363 .notable-traits .docblock code.content{
1364         margin: 0;
1365         padding: 0;
1366         font-size: 1.25rem;
1367 }
1368
1369 /* Example code has the "Run" button that needs to be positioned relative to the pre */
1370 pre.rust.rust-example-rendered {
1371         position: relative;
1372 }
1373
1374 pre.rust {
1375         tab-size: 4;
1376         -moz-tab-size: 4;
1377 }
1378
1379 .search-failed {
1380         text-align: center;
1381         margin-top: 20px;
1382         display: none;
1383 }
1384
1385 .search-failed.active {
1386         display: block;
1387 }
1388
1389 .search-failed > ul {
1390         text-align: left;
1391         max-width: 570px;
1392         margin-left: auto;
1393         margin-right: auto;
1394 }
1395
1396 #titles {
1397         height: 35px;
1398 }
1399
1400 #titles > button {
1401         float: left;
1402         width: 33.3%;
1403         text-align: center;
1404         font-size: 1.125rem;
1405         cursor: pointer;
1406         border: 0;
1407         border-top: 2px solid;
1408 }
1409
1410 #titles > button:first-child:last-child {
1411         margin-right: 1px;
1412         width: calc(100% - 1px);
1413 }
1414
1415 #titles > button:not(:last-child) {
1416         margin-right: 1px;
1417         width: calc(33.3% - 1px);
1418 }
1419
1420 #titles > button > div.count {
1421         display: inline-block;
1422         font-size: 1rem;
1423 }
1424
1425 .notable-traits {
1426         cursor: pointer;
1427         z-index: 2;
1428         margin-left: 5px;
1429 }
1430
1431 #sidebar-toggle {
1432         position: sticky;
1433         top: 0;
1434         left: 0;
1435         font-weight: bold;
1436         font-size: 1.25rem;
1437         border-bottom: 1px solid;
1438         display: flex;
1439         height: 40px;
1440         justify-content: center;
1441         align-items: center;
1442         z-index: 10;
1443 }
1444 #source-sidebar {
1445         width: 100%;
1446         z-index: 1;
1447         overflow: auto;
1448 }
1449 #source-sidebar > .title {
1450         font-size: 1.5rem;
1451         text-align: center;
1452         border-bottom: 1px solid;
1453         margin-bottom: 6px;
1454 }
1455 #sidebar-toggle > button {
1456         background: none;
1457         color: inherit;
1458         cursor: pointer;
1459         text-align: center;
1460         border: none;
1461         outline: none;
1462         position: absolute;
1463         top: 0;
1464         bottom: 0;
1465         left: 0;
1466         right: 0;
1467         /* work around button layout strangeness: https://stackoverflow.com/q/7271561 */
1468         width: 100%;
1469         /* iOS button gradient: https://stackoverflow.com/q/5438567 */
1470         -webkit-appearance: none;
1471         opacity: 1;
1472 }
1473 #settings-menu, #help-button {
1474         margin-left: 4px;
1475         outline: none;
1476 }
1477
1478 #copy-path {
1479         height: 34px;
1480 }
1481 #settings-menu > a, #help-button > button, #copy-path {
1482         padding: 5px;
1483         width: 33px;
1484         border: 1px solid;
1485         border-radius: 2px;
1486         cursor: pointer;
1487 }
1488 #settings-menu {
1489         padding: 0;
1490 }
1491 #settings-menu > a, #help-button > button {
1492         padding: 5px;
1493         height: 100%;
1494         display: block;
1495 }
1496
1497 @keyframes rotating {
1498         from {
1499                 transform: rotate(0deg);
1500         }
1501         to {
1502                 transform: rotate(360deg);
1503         }
1504 }
1505 #settings-menu.rotate > a img {
1506         animation: rotating 2s linear infinite;
1507 }
1508
1509 .setting-line .radio-line input:checked {
1510         box-shadow: inset 0 0 0 3px var(--main-background-color);
1511         background-color: var(--settings-input-color);
1512 }
1513 .setting-line .radio-line input:focus {
1514         box-shadow: 0 0 1px 1px var(--settings-input-color);
1515 }
1516 /* In here we combine both `:focus` and `:checked` properties. */
1517 .setting-line .radio-line input:checked:focus {
1518         box-shadow: inset 0 0 0 3px var(--main-background-color),
1519                 0 0 2px 2px var(--settings-input-color);
1520 }
1521 .setting-line .radio-line input:hover {
1522         border-color: var(--settings-input-color) !important;
1523 }
1524 input:checked + .slider {
1525         background-color: var(--settings-input-color);
1526 }
1527
1528 #help-button > button {
1529         text-align: center;
1530         /* Rare exception to specifying font sizes in rem. Since this is acting
1531            as an icon, it's okay to specify their sizes in pixels. */
1532         font-size: 20px;
1533         padding-top: 2px;
1534 }
1535
1536 #copy-path {
1537         background: initial;
1538         margin-left: 10px;
1539         padding: 0;
1540         padding-left: 2px;
1541         border: 0;
1542 }
1543
1544 #theme-choices {
1545         display: none;
1546         position: absolute;
1547         left: 0;
1548         top: 28px;
1549         border: 1px solid;
1550         border-radius: 3px;
1551         z-index: 1;
1552         cursor: pointer;
1553 }
1554
1555 #theme-choices > button {
1556         border: none;
1557         width: 100%;
1558         padding: 4px 8px;
1559         text-align: center;
1560         background: rgba(0,0,0,0);
1561         overflow-wrap: normal;
1562 }
1563
1564 #theme-choices > button:not(:first-child) {
1565         border-top: 1px solid;
1566 }
1567
1568 kbd {
1569         display: inline-block;
1570         padding: 3px 5px;
1571         font: 15px monospace;
1572         line-height: 10px;
1573         vertical-align: middle;
1574         border: solid 1px;
1575         border-radius: 3px;
1576         cursor: default;
1577 }
1578
1579 .hidden-by-impl-hider,
1580 .hidden-by-usual-hider {
1581         /* important because of conflicting rule for small screens */
1582         display: none !important;
1583 }
1584
1585 #implementations-list > h3 > span.in-band {
1586         width: 100%;
1587 }
1588
1589 .table-display {
1590         width: 100%;
1591         border: 0;
1592         border-collapse: collapse;
1593         border-spacing: 0;
1594         font-size: 1rem;
1595 }
1596
1597 .table-display tr td:first-child {
1598         padding-right: 0;
1599 }
1600
1601 .table-display tr td:last-child {
1602         float: right;
1603 }
1604 .table-display .out-of-band {
1605         position: relative;
1606         font-size: 1.125rem;
1607         display: block;
1608 }
1609
1610 .table-display td:hover .anchor {
1611         display: block;
1612         top: 2px;
1613         left: -5px;
1614 }
1615
1616 #main-content > ul {
1617         padding-left: 10px;
1618 }
1619 #main-content > ul > li {
1620         list-style: none;
1621 }
1622
1623 .non-exhaustive {
1624         margin-bottom: 1em;
1625 }
1626
1627 details.dir-entry {
1628         padding-left: 4px;
1629 }
1630
1631 details.dir-entry > summary {
1632         margin: 0 0 0 13px;
1633         list-style-position: outside;
1634         cursor: pointer;
1635 }
1636
1637 details.dir-entry div.folders, details.dir-entry div.files {
1638         padding-left: 23px;
1639 }
1640
1641 details.dir-entry a {
1642         display: block;
1643 }
1644
1645 /* The hideme class is used on summary tags that contain a span with
1646         placeholder text shown only when the toggle is closed. For instance,
1647         "Expand description" or "Show methods". */
1648 details.rustdoc-toggle > summary.hideme {
1649         cursor: pointer;
1650 }
1651
1652 details.rustdoc-toggle > summary {
1653         list-style: none;
1654 }
1655 details.rustdoc-toggle > summary::-webkit-details-marker,
1656 details.rustdoc-toggle > summary::marker {
1657         display: none;
1658 }
1659
1660 details.rustdoc-toggle > summary.hideme > span {
1661         margin-left: 9px;
1662 }
1663
1664 details.rustdoc-toggle > summary::before {
1665         content: "";
1666         cursor: pointer;
1667         width: 16px;
1668         height: 16px;
1669         background-repeat: no-repeat;
1670         background-position: top left;
1671         display: inline-block;
1672         vertical-align: middle;
1673         opacity: .5;
1674 }
1675
1676 /* Screen readers see the text version at the end the line.
1677         Visual readers see the icon at the start of the line, but small and transparent. */
1678 details.rustdoc-toggle > summary::after {
1679         content: "Expand";
1680         overflow: hidden;
1681         width: 0;
1682         height: 0;
1683         position: absolute;
1684 }
1685
1686 details.rustdoc-toggle > summary.hideme::after {
1687         /* "hideme" toggles already have a description when they're contracted */
1688         content: "";
1689 }
1690
1691 details.rustdoc-toggle > summary:focus::before,
1692 details.rustdoc-toggle > summary:hover::before {
1693         opacity: 1;
1694 }
1695
1696 details.rustdoc-toggle.top-doc > summary,
1697 details.rustdoc-toggle.top-doc > summary::before,
1698 details.rustdoc-toggle.non-exhaustive > summary,
1699 details.rustdoc-toggle.non-exhaustive > summary::before {
1700         font-size: 1rem;
1701 }
1702
1703 details.non-exhaustive {
1704         margin-bottom: 8px;
1705 }
1706
1707 details.rustdoc-toggle > summary.hideme::before {
1708         position: relative;
1709 }
1710
1711 details.rustdoc-toggle > summary:not(.hideme)::before {
1712         position: absolute;
1713         left: -24px;
1714         top: 4px;
1715 }
1716
1717 .impl-items > details.rustdoc-toggle > summary:not(.hideme)::before {
1718         position: absolute;
1719         left: -24px;
1720 }
1721
1722 /* When a "hideme" summary is open and the "Expand description" or "Show
1723         methods" text is hidden, we want the [-] toggle that remains to not
1724         affect the layout of the items to its right. To do that, we use
1725         absolute positioning. Note that we also set position: relative
1726         on the parent <details> to make this work properly. */
1727 details.rustdoc-toggle[open] > summary.hideme {
1728         position: absolute;
1729 }
1730
1731 details.rustdoc-toggle {
1732         position: relative;
1733 }
1734
1735 details.rustdoc-toggle[open] > summary.hideme > span {
1736         display: none;
1737 }
1738
1739 details.rustdoc-toggle[open] > summary::before,
1740 details.rustdoc-toggle[open] > summary.hideme::before {
1741         background-image: /* AUTOREPLACE: */url("toggle-minus.svg");
1742 }
1743
1744 details.rustdoc-toggle > summary::before {
1745         background-image: /* AUTOREPLACE: */url("toggle-plus.svg");
1746 }
1747
1748 details.rustdoc-toggle[open] > summary::before,
1749 details.rustdoc-toggle[open] > summary.hideme::before {
1750         width: 16px;
1751         height: 16px;
1752         background-repeat: no-repeat;
1753         background-position: top left;
1754         display: inline-block;
1755         content: "";
1756 }
1757
1758 details.rustdoc-toggle[open] > summary::after,
1759 details.rustdoc-toggle[open] > summary.hideme::after {
1760         content: "Collapse";
1761 }
1762
1763 /* This is needed in docblocks to have the "â–¶" element to be on the same line. */
1764 .docblock summary > * {
1765         display: inline-block;
1766 }
1767
1768 /* Media Queries */
1769
1770 /*
1771 WARNING: RUSTDOC_MOBILE_BREAKPOINT MEDIA QUERY;
1772 If you update this line, then you also need to update the line with the same warning
1773 in storage.js plus the media query with (max-width: 700px)
1774 */
1775 @media (min-width: 701px) {
1776         /* In case there is no documentation before a code block, we need to add some margin at the top
1777         to prevent an overlay between the "collapse toggle" and the information tooltip.
1778         However, it's not needed with smaller screen width because the doc/code block is always put
1779         "one line" below. */
1780         .docblock > .information:first-child > .tooltip {
1781                 margin-top: 16px;
1782         }
1783
1784         /* When we expand the sidebar on the source code page, we hide the logo on the left of the
1785         search bar to have more space. */
1786         .source-sidebar-expanded .source .sidebar + main .width-limiter .sub-logo-container.rust-logo {
1787                 display: none;
1788         }
1789
1790         .source-sidebar-expanded .source .sidebar {
1791                 width: 300px;
1792         }
1793 }
1794
1795 /*
1796 WARNING: RUSTDOC_MOBILE_BREAKPOINT MEDIA QUERY
1797 If you update this line, then you also need to update the line with the same warning
1798 in storage.js plus the media query with (min-width: 701px)
1799 */
1800 @media (max-width: 700px) {
1801         /* When linking to an item with an `id` (for instance, by clicking a link in the sidebar,
1802            or visiting a URL with a fragment like `#method.new`, we don't want the item to be obscured
1803            by the topbar. Anything with an `id` gets scroll-margin-top equal to .mobile-topbar's size.
1804         */
1805         *[id] {
1806                 scroll-margin-top: 45px;
1807         }
1808
1809         .rustdoc {
1810                 padding-top: 0px;
1811                 /* Sidebar should overlay main content, rather than pushing main content to the right.
1812                    Turn off `display: flex` on the body element. */
1813                 display: block;
1814         }
1815
1816         main {
1817                 padding-left: 15px;
1818                 padding-top: 0px;
1819         }
1820
1821         .rustdoc,
1822         .main-heading {
1823                 flex-direction: column;
1824         }
1825
1826         .content .out-of-band {
1827                 text-align: left;
1828                 margin-left: initial;
1829                 padding: initial;
1830         }
1831
1832         .content .out-of-band .since::before {
1833                 content: "Since ";
1834         }
1835
1836         #copy-path {
1837                 display: none;
1838         }
1839
1840         /* Hide the logo and item name from the sidebar. Those are displayed
1841            in the mobile-topbar instead. */
1842         .sidebar .sidebar-logo,
1843         .sidebar .location {
1844                 display: none;
1845         }
1846
1847         .sidebar-elems {
1848                 margin-top: 1em;
1849         }
1850
1851         .sidebar {
1852                 position: fixed;
1853                 top: 45px;
1854                 /* Hide the sidebar offscreen while not in use. Doing this instead of display: none means
1855                    the sidebar stays visible for screen readers, which is useful for navigation. */
1856                 left: -1000px;
1857                 margin-left: 0;
1858                 margin: 0;
1859                 padding: 0;
1860                 z-index: 11;
1861                 /* Reduce height slightly to account for mobile topbar. */
1862                 height: calc(100vh - 45px);
1863         }
1864
1865         /* The source view uses a different design for the sidebar toggle, and doesn't have a topbar,
1866            so don't bump down the main content or the sidebar. */
1867         .source main,
1868         .rustdoc.source .sidebar {
1869                 top: 0;
1870                 padding: 0;
1871                 height: 100vh;
1872                 border: 0;
1873         }
1874
1875         .sidebar.shown,
1876         .source-sidebar-expanded .source .sidebar,
1877         .sidebar:focus-within {
1878                 left: 0;
1879         }
1880
1881         .rustdoc.source > .sidebar {
1882                 position: fixed;
1883                 margin: 0;
1884                 z-index: 11;
1885                 width: 0;
1886         }
1887
1888         .mobile-topbar .location a {
1889                 padding: 0;
1890                 margin: 0;
1891         }
1892
1893         .mobile-topbar .location {
1894                 border: none;
1895                 padding: 0;
1896                 margin: auto 0.5em auto auto;
1897                 text-overflow: ellipsis;
1898                 overflow: hidden;
1899                 white-space: nowrap;
1900                 /* Rare exception to specifying font sizes in rem. Since the topbar
1901                    height is specified in pixels, this also has to be specified in
1902                    pixels to avoid overflowing the topbar when the user sets a bigger
1903                    font size. */
1904                 font-size: 24px;
1905         }
1906
1907         .mobile-topbar .logo-container {
1908                 max-height: 45px;
1909         }
1910
1911         .mobile-topbar .logo-container > img {
1912                 max-width: 35px;
1913                 max-height: 35px;
1914                 margin-left: 20px;
1915                 margin-top: 5px;
1916                 margin-bottom: 5px;
1917         }
1918
1919         .mobile-topbar {
1920                 display: flex;
1921                 flex-direction: row;
1922                 position: sticky;
1923                 z-index: 10;
1924                 font-size: 2rem;
1925                 height: 45px;
1926                 width: 100%;
1927                 left: 0;
1928                 top: 0;
1929         }
1930
1931         .source .mobile-topbar {
1932                 display: none;
1933         }
1934
1935         .sidebar-menu-toggle {
1936                 width: 45px;
1937                 /* Rare exception to specifying font sizes in rem. Since this is acting
1938                    as an icon, it's okay to specify its sizes in pixels. */
1939                 font-size: 32px;
1940                 border: none;
1941         }
1942
1943         .sidebar-elems {
1944                 background-color: var(--sidebar-background-color);
1945         }
1946
1947         .source nav:not(.sidebar).sub {
1948                 margin-left: 32px;
1949         }
1950
1951         .content {
1952                 margin-left: 0px;
1953         }
1954
1955         .source .content {
1956                 margin-top: 10px;
1957         }
1958
1959         #search {
1960                 margin-left: 0;
1961                 padding: 0;
1962         }
1963
1964         .anchor {
1965                 display: none !important;
1966         }
1967
1968         .notable-traits {
1969                 position: absolute;
1970                 left: -22px;
1971                 top: 24px;
1972         }
1973
1974         #titles > button > div.count {
1975                 float: left;
1976                 width: 100%;
1977         }
1978
1979         #titles {
1980                 height: 50px;
1981         }
1982
1983         /* Because of ios, we need to actually have a full height sidebar title so the
1984          * actual sidebar can show up. But then we need to make it transparent so we don't
1985          * hide content. The filler just allows to create the background for the sidebar
1986          * title. But because of the absolute position, I had to lower the z-index.
1987          */
1988         #sidebar-filler {
1989                 position: fixed;
1990                 left: 45px;
1991                 width: calc(100% - 45px);
1992                 top: 0;
1993                 height: 45px;
1994                 z-index: -1;
1995                 border-bottom: 1px solid;
1996         }
1997
1998         #main-content > details.rustdoc-toggle > summary::before,
1999         #main-content > div > details.rustdoc-toggle > summary::before {
2000                 left: -11px;
2001         }
2002
2003         #sidebar-toggle {
2004                 position: fixed;
2005                 left: 1px;
2006                 top: 100px;
2007                 width: 30px;
2008                 font-size: 1.5rem;
2009                 text-align: center;
2010                 padding: 0;
2011                 z-index: 10;
2012                 border-top-right-radius: 3px;
2013                 border-bottom-right-radius: 3px;
2014                 cursor: pointer;
2015                 font-weight: bold;
2016                 border: 1px solid;
2017                 border-left: 0;
2018         }
2019
2020         .source-sidebar-expanded #sidebar-toggle {
2021                 left: unset;
2022                 top: unset;
2023                 width: unset;
2024                 border-top-right-radius: unset;
2025                 border-bottom-right-radius: unset;
2026                 position: sticky;
2027                 border: 0;
2028                 border-bottom: 1px solid;
2029         }
2030
2031         #source-sidebar {
2032                 z-index: 11;
2033         }
2034
2035         #main-content > .line-numbers {
2036                 margin-top: 0;
2037         }
2038
2039         .notable-traits .notable-traits-tooltiptext {
2040                 left: 0;
2041                 top: 100%;
2042         }
2043
2044         /* We don't display the help button on mobile devices. */
2045         #help-button {
2046                 display: none;
2047         }
2048
2049         /* Display an alternating layout on tablets and phones */
2050         .item-table {
2051                 display: block;
2052         }
2053         .item-row {
2054                 display: flex;
2055                 flex-flow: column wrap;
2056         }
2057         .item-left, .item-right {
2058                 width: 100%;
2059         }
2060
2061         /* Display an alternating layout on tablets and phones */
2062         .search-results > a {
2063                 border-bottom: 1px solid #aaa9;
2064                 padding: 5px 0px;
2065         }
2066         .search-results .result-name, .search-results div.desc, .search-results .result-description {
2067                 width: 100%;
2068         }
2069         .search-results div.desc, .search-results .result-description, .item-right {
2070                 padding-left: 2em;
2071         }
2072
2073         .source-sidebar-expanded .source .sidebar {
2074                 max-width: 100vw;
2075                 width: 100vw;
2076         }
2077
2078         /* Position of the "[-]" element. */
2079         details.rustdoc-toggle:not(.top-doc) > summary {
2080                 margin-left: 10px;
2081         }
2082         .impl-items > details.rustdoc-toggle > summary:not(.hideme)::before,
2083         #main-content > details.rustdoc-toggle:not(.top-doc) > summary::before,
2084         #main-content > div > details.rustdoc-toggle > summary::before {
2085                 left: -11px;
2086         }
2087 }
2088
2089 @media print {
2090         nav.sidebar, nav.sub, .content .out-of-band, a.srclink, #copy-path,
2091         details.rustdoc-toggle[open] > summary::before, details.rustdoc-toggle > summary::before,
2092         details.rustdoc-toggle.top-doc > summary {
2093                 display: none;
2094         }
2095
2096         .docblock {
2097                 margin-left: 0;
2098         }
2099
2100         main {
2101                 padding: 10px;
2102         }
2103 }
2104
2105 @media (max-width: 464px) {
2106         #titles, #titles > button {
2107                 height: 73px;
2108         }
2109
2110         #main-content > table:not(.table-display) td {
2111                 word-break: break-word;
2112                 width: 50%;
2113         }
2114
2115         #crate-search {
2116                 border-radius: 4px;
2117         }
2118
2119         .docblock {
2120                 margin-left: 12px;
2121         }
2122
2123         .docblock code {
2124                 overflow-wrap: break-word;
2125                 overflow-wrap: anywhere;
2126         }
2127
2128         .sub-container {
2129                 flex-direction: column;
2130         }
2131
2132         .sub-logo-container {
2133                 align-self: center;
2134         }
2135
2136         .source .sub-logo-container > img {
2137                 height: 35px;
2138                 width: 35px;
2139         }
2140
2141         #sidebar-toggle {
2142                 top: 10px;
2143         }
2144         .source-sidebar-expanded #sidebar-toggle {
2145                 top: unset;
2146         }
2147 }
2148
2149 .method-toggle summary,
2150 .implementors-toggle summary,
2151 .impl {
2152         margin-bottom: 0.75em;
2153 }
2154
2155 .method-toggle[open] {
2156         margin-bottom: 2em;
2157 }
2158
2159 .implementors-toggle[open]  {
2160         margin-bottom: 2em;
2161 }
2162
2163 #trait-implementations-list .method-toggle,
2164 #synthetic-implementations-list .method-toggle,
2165 #blanket-implementations-list .method-toggle {
2166         margin-bottom: 1em;
2167 }
2168
2169 /* Begin: styles for --scrape-examples feature */
2170
2171 .scraped-example-list .scrape-help {
2172         margin-left: 10px;
2173         padding: 0 4px;
2174         font-weight: normal;
2175         font-size: 12px;
2176         position: relative;
2177         bottom: 1px;
2178         background: transparent;
2179         border-width: 1px;
2180         border-style: solid;
2181         border-radius: 50px;
2182 }
2183
2184 .scraped-example .code-wrapper {
2185         position: relative;
2186         display: flex;
2187         flex-direction: row;
2188         flex-wrap: wrap;
2189         width: 100%;
2190 }
2191
2192 .scraped-example:not(.expanded) .code-wrapper {
2193         max-height: 240px;
2194 }
2195
2196 .scraped-example:not(.expanded) .code-wrapper pre {
2197         overflow-y: hidden;
2198         max-height: 240px;
2199         padding-bottom: 0;
2200 }
2201
2202 .scraped-example:not(.expanded) .code-wrapper pre.line-numbers {
2203         overflow-x: hidden;
2204 }
2205
2206 .scraped-example .code-wrapper .prev {
2207         position: absolute;
2208         top: 0.25em;
2209         right: 2.25em;
2210         z-index: 100;
2211         cursor: pointer;
2212 }
2213
2214 .scraped-example .code-wrapper .next {
2215         position: absolute;
2216         top: 0.25em;
2217         right: 1.25em;
2218         z-index: 100;
2219         cursor: pointer;
2220 }
2221
2222 .scraped-example .code-wrapper .expand {
2223         position: absolute;
2224         top: 0.25em;
2225         right: 0.25em;
2226         z-index: 100;
2227         cursor: pointer;
2228 }
2229
2230 .scraped-example:not(.expanded) .code-wrapper:before {
2231         content: " ";
2232         width: 100%;
2233         height: 5px;
2234         position: absolute;
2235         z-index: 100;
2236         top: 0;
2237 }
2238
2239 .scraped-example:not(.expanded) .code-wrapper:after {
2240         content: " ";
2241         width: 100%;
2242         height: 5px;
2243         position: absolute;
2244         z-index: 100;
2245         bottom: 0;
2246 }
2247
2248 .scraped-example .code-wrapper .line-numbers {
2249         margin: 0;
2250         padding: 14px 0;
2251 }
2252
2253 .scraped-example .code-wrapper .line-numbers span {
2254         padding: 0 14px;
2255 }
2256
2257 .scraped-example .code-wrapper .example-wrap {
2258         flex: 1;
2259         overflow-x: auto;
2260         overflow-y: hidden;
2261         margin-bottom: 0;
2262 }
2263
2264 .scraped-example:not(.expanded) .code-wrapper .example-wrap {
2265         overflow-x: hidden;
2266 }
2267
2268 .scraped-example .code-wrapper .example-wrap pre.rust {
2269         overflow-x: inherit;
2270         width: inherit;
2271         overflow-y: hidden;
2272 }
2273
2274
2275 .more-examples-toggle {
2276         max-width: calc(100% + 25px);
2277         margin-top: 10px;
2278         margin-left: -25px;
2279 }
2280
2281 .more-examples-toggle .hide-more {
2282         margin-left: 25px;
2283         margin-bottom: 5px;
2284         cursor: pointer;
2285 }
2286
2287 .more-scraped-examples {
2288         margin-left: 5px;
2289         display: flex;
2290         flex-direction: row;
2291 }
2292
2293 .more-scraped-examples-inner {
2294         /* 20px is width of toggle-line + toggle-line-inner */
2295         width: calc(100% - 20px);
2296 }
2297
2298 .toggle-line {
2299         align-self: stretch;
2300         margin-right: 10px;
2301         margin-top: 5px;
2302         padding: 0 4px;
2303         cursor: pointer;
2304 }
2305
2306 .toggle-line-inner {
2307         min-width: 2px;
2308         height: 100%;
2309 }
2310
2311 .more-scraped-examples .scraped-example {
2312         margin-bottom: 20px;
2313 }
2314
2315 .more-scraped-examples .scraped-example:last-child {
2316         margin-bottom: 0;
2317 }
2318
2319 .example-links a {
2320         margin-top: 20px;
2321 }
2322
2323 .example-links ul {
2324         margin-bottom: 0;
2325 }
2326
2327 /* End: styles for --scrape-examples feature */