]> git.lizzy.rs Git - rust.git/blob - src/librustdoc/html/static/css/rustdoc.css
Auto merge of #99833 - andrewpollack:fuchsia-rust-ci-zircon-lib-improvement, r=Mark...
[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         width: fit-content;
1115         /* This min-height is needed to unify the height of the stab elements because some of them
1116            have emojis.
1117         */
1118         min-height: 36px;
1119         display: flex;
1120         align-items: center;
1121         white-space: pre-wrap;
1122 }
1123 .stab {
1124         padding: 3px;
1125         margin-bottom: 5px;
1126         font-size: 0.875rem;
1127         font-weight: normal;
1128 }
1129 .stab p {
1130         display: inline;
1131         margin: 0;
1132 }
1133
1134 .stab .emoji {
1135         font-size: 1.25rem;
1136 }
1137
1138 /* Black one-pixel outline around emoji shapes */
1139 .emoji {
1140         text-shadow:
1141                 1px 0 0 black,
1142                 -1px 0 0 black,
1143                 0  1px 0 black,
1144                 0 -1px 0 black;
1145 }
1146
1147 .module-item .stab,
1148 .import-item .stab {
1149         border-radius: 3px;
1150         display: inline-block;
1151         font-size: 0.875rem;
1152         line-height: 1.2;
1153         margin-bottom: 0;
1154         margin-left: 0.3125em;
1155         padding: 2px;
1156         vertical-align: text-bottom;
1157 }
1158
1159 .module-item.unstable,
1160 .import-item.unstable {
1161         opacity: 0.65;
1162 }
1163
1164 .since {
1165         font-weight: normal;
1166         font-size: initial;
1167 }
1168
1169 .rightside {
1170         padding-left: 12px;
1171         padding-right: 2px;
1172         position: initial;
1173 }
1174
1175 .impl-items .srclink, .impl .srclink, .methods .srclink {
1176         /* Override header settings otherwise it's too bold */
1177         font-weight: normal;
1178         font-size: 1rem;
1179 }
1180
1181 .rightside {
1182         float: right;
1183 }
1184
1185 .variants_table {
1186         width: 100%;
1187 }
1188
1189 .variants_table tbody tr td:first-child {
1190         width: 1%; /* make the variant name as small as possible */
1191 }
1192
1193 td.summary-column {
1194         width: 100%;
1195 }
1196
1197 .summary {
1198         padding-right: 0px;
1199 }
1200
1201 pre.rust .question-mark {
1202         font-weight: bold;
1203 }
1204
1205 a.test-arrow {
1206         display: inline-block;
1207         visibility: hidden;
1208         position: absolute;
1209         padding: 5px 10px 5px 10px;
1210         border-radius: 5px;
1211         font-size: 1.375rem;
1212         top: 5px;
1213         right: 5px;
1214         z-index: 1;
1215 }
1216 .example-wrap:hover .test-arrow {
1217         visibility: visible;
1218 }
1219 a.test-arrow:hover{
1220         text-decoration: none;
1221 }
1222
1223 .code-attribute {
1224         font-weight: 300;
1225 }
1226
1227 .item-spacer {
1228         width: 100%;
1229         height: 12px;
1230 }
1231
1232 .out-of-band > span.since {
1233         position: initial;
1234         font-size: 1.25rem;
1235 }
1236
1237 h3.variant {
1238         font-weight: 600;
1239         font-size: 1.125rem;
1240         margin-bottom: 10px;
1241         border-bottom: none;
1242 }
1243
1244 .sub-variant h4 {
1245         font-size: 1rem;
1246         font-weight: 400;
1247         border-bottom: none;
1248         margin-top: 0;
1249         margin-bottom: 0;
1250 }
1251
1252 .sub-variant {
1253         margin-left: 24px;
1254         margin-bottom: 40px;
1255 }
1256
1257 .sub-variant > .sub-variant-field {
1258         margin-left: 24px;
1259 }
1260
1261 .toggle-label {
1262         display: inline-block;
1263         margin-left: 4px;
1264         margin-top: 3px;
1265 }
1266
1267 :target > code, :target > .code-header {
1268         opacity: 1;
1269 }
1270
1271 :target {
1272         padding-right: 3px;
1273 }
1274
1275 .information {
1276         position: absolute;
1277         left: -25px;
1278         margin-top: 7px;
1279         z-index: 1;
1280 }
1281
1282 .tooltip {
1283         position: relative;
1284         display: inline-block;
1285         cursor: pointer;
1286 }
1287
1288 .tooltip::after {
1289         display: none;
1290         text-align: center;
1291         padding: 5px 3px 3px 3px;
1292         border-radius: 6px;
1293         margin-left: 5px;
1294         font-size: 1rem;
1295 }
1296
1297 .tooltip.ignore::after {
1298         content: "This example is not tested";
1299 }
1300 .tooltip.compile_fail::after {
1301         content: "This example deliberately fails to compile";
1302 }
1303 .tooltip.should_panic::after {
1304         content: "This example panics";
1305 }
1306 .tooltip.edition::after {
1307         content: "This code runs with edition " attr(data-edition);
1308 }
1309
1310 .tooltip::before {
1311         content: " ";
1312         position: absolute;
1313         top: 50%;
1314         left: 16px;
1315         margin-top: -5px;
1316         border-width: 5px;
1317         border-style: solid;
1318         display: none;
1319 }
1320
1321 .tooltip:hover::before, .tooltip:hover::after {
1322         display: inline;
1323 }
1324
1325 .tooltip.compile_fail, .tooltip.should_panic, .tooltip.ignore {
1326         font-weight: bold;
1327         font-size: 1.25rem;
1328 }
1329
1330 .notable-traits-tooltip {
1331         display: inline-block;
1332         cursor: pointer;
1333 }
1334
1335 .notable-traits:hover .notable-traits-tooltiptext,
1336 .notable-traits .notable-traits-tooltiptext.force-tooltip {
1337         display: inline-block;
1338 }
1339
1340 .notable-traits .notable-traits-tooltiptext {
1341         display: none;
1342         padding: 5px 3px 3px 3px;
1343         border-radius: 6px;
1344         margin-left: 5px;
1345         z-index: 10;
1346         font-size: 1rem;
1347         cursor: default;
1348         position: absolute;
1349         border: 1px solid;
1350 }
1351
1352 .notable-traits-tooltip::after {
1353         /* The margin on the tooltip does not capture hover events,
1354            this extends the area of hover enough so that mouse hover is not
1355            lost when moving the mouse to the tooltip */
1356         content: "\00a0\00a0\00a0";
1357 }
1358
1359 .notable-traits .notable, .notable-traits .docblock {
1360         margin: 0;
1361 }
1362
1363 .notable-traits .notable {
1364         margin: 0;
1365         margin-bottom: 13px;
1366         font-size: 1.1875rem;
1367         font-weight: 600;
1368         display: block;
1369 }
1370
1371 .notable-traits .docblock code.content{
1372         margin: 0;
1373         padding: 0;
1374         font-size: 1.25rem;
1375 }
1376
1377 /* Example code has the "Run" button that needs to be positioned relative to the pre */
1378 pre.rust.rust-example-rendered {
1379         position: relative;
1380 }
1381
1382 pre.rust {
1383         tab-size: 4;
1384         -moz-tab-size: 4;
1385 }
1386
1387 .search-failed {
1388         text-align: center;
1389         margin-top: 20px;
1390         display: none;
1391 }
1392
1393 .search-failed.active {
1394         display: block;
1395 }
1396
1397 .search-failed > ul {
1398         text-align: left;
1399         max-width: 570px;
1400         margin-left: auto;
1401         margin-right: auto;
1402 }
1403
1404 #titles {
1405         height: 35px;
1406 }
1407
1408 #titles > button {
1409         float: left;
1410         width: 33.3%;
1411         text-align: center;
1412         font-size: 1.125rem;
1413         cursor: pointer;
1414         border: 0;
1415         border-top: 2px solid;
1416 }
1417
1418 #titles > button:first-child:last-child {
1419         margin-right: 1px;
1420         width: calc(100% - 1px);
1421 }
1422
1423 #titles > button:not(:last-child) {
1424         margin-right: 1px;
1425         width: calc(33.3% - 1px);
1426 }
1427
1428 #titles > button > div.count {
1429         display: inline-block;
1430         font-size: 1rem;
1431 }
1432
1433 .notable-traits {
1434         cursor: pointer;
1435         z-index: 2;
1436         margin-left: 5px;
1437 }
1438
1439 #sidebar-toggle {
1440         position: sticky;
1441         top: 0;
1442         left: 0;
1443         font-weight: bold;
1444         font-size: 1.25rem;
1445         border-bottom: 1px solid;
1446         display: flex;
1447         height: 40px;
1448         justify-content: center;
1449         align-items: center;
1450         z-index: 10;
1451 }
1452 #source-sidebar {
1453         width: 100%;
1454         z-index: 1;
1455         overflow: auto;
1456 }
1457 #source-sidebar > .title {
1458         font-size: 1.5rem;
1459         text-align: center;
1460         border-bottom: 1px solid;
1461         margin-bottom: 6px;
1462 }
1463 #sidebar-toggle > button {
1464         background: none;
1465         color: inherit;
1466         cursor: pointer;
1467         text-align: center;
1468         border: none;
1469         outline: none;
1470         position: absolute;
1471         top: 0;
1472         bottom: 0;
1473         left: 0;
1474         right: 0;
1475         /* work around button layout strangeness: https://stackoverflow.com/q/7271561 */
1476         width: 100%;
1477         /* iOS button gradient: https://stackoverflow.com/q/5438567 */
1478         -webkit-appearance: none;
1479         opacity: 1;
1480 }
1481 #settings-menu, #help-button {
1482         margin-left: 4px;
1483         outline: none;
1484 }
1485
1486 #copy-path {
1487         height: 34px;
1488 }
1489 #settings-menu > a, #help-button > button, #copy-path {
1490         padding: 5px;
1491         width: 33px;
1492         border: 1px solid;
1493         border-radius: 2px;
1494         cursor: pointer;
1495 }
1496 #settings-menu {
1497         padding: 0;
1498 }
1499 #settings-menu > a, #help-button > button {
1500         padding: 5px;
1501         height: 100%;
1502         display: block;
1503 }
1504
1505 @keyframes rotating {
1506         from {
1507                 transform: rotate(0deg);
1508         }
1509         to {
1510                 transform: rotate(360deg);
1511         }
1512 }
1513 #settings-menu.rotate > a img {
1514         animation: rotating 2s linear infinite;
1515 }
1516
1517 .setting-line .radio-line input:checked {
1518         box-shadow: inset 0 0 0 3px var(--main-background-color);
1519         background-color: var(--settings-input-color);
1520 }
1521 .setting-line .radio-line input:focus {
1522         box-shadow: 0 0 1px 1px var(--settings-input-color);
1523 }
1524 /* In here we combine both `:focus` and `:checked` properties. */
1525 .setting-line .radio-line input:checked:focus {
1526         box-shadow: inset 0 0 0 3px var(--main-background-color),
1527                 0 0 2px 2px var(--settings-input-color);
1528 }
1529 .setting-line .radio-line input:hover {
1530         border-color: var(--settings-input-color) !important;
1531 }
1532 input:checked + .slider {
1533         background-color: var(--settings-input-color);
1534 }
1535
1536 #help-button > button {
1537         text-align: center;
1538         /* Rare exception to specifying font sizes in rem. Since this is acting
1539            as an icon, it's okay to specify their sizes in pixels. */
1540         font-size: 20px;
1541         padding-top: 2px;
1542 }
1543
1544 #copy-path {
1545         background: initial;
1546         margin-left: 10px;
1547         padding: 0;
1548         padding-left: 2px;
1549         border: 0;
1550 }
1551
1552 #theme-choices {
1553         display: none;
1554         position: absolute;
1555         left: 0;
1556         top: 28px;
1557         border: 1px solid;
1558         border-radius: 3px;
1559         z-index: 1;
1560         cursor: pointer;
1561 }
1562
1563 #theme-choices > button {
1564         border: none;
1565         width: 100%;
1566         padding: 4px 8px;
1567         text-align: center;
1568         background: rgba(0,0,0,0);
1569         overflow-wrap: normal;
1570 }
1571
1572 #theme-choices > button:not(:first-child) {
1573         border-top: 1px solid;
1574 }
1575
1576 kbd {
1577         display: inline-block;
1578         padding: 3px 5px;
1579         font: 15px monospace;
1580         line-height: 10px;
1581         vertical-align: middle;
1582         border: solid 1px;
1583         border-radius: 3px;
1584         cursor: default;
1585 }
1586
1587 .hidden-by-impl-hider,
1588 .hidden-by-usual-hider {
1589         /* important because of conflicting rule for small screens */
1590         display: none !important;
1591 }
1592
1593 #implementations-list > h3 > span.in-band {
1594         width: 100%;
1595 }
1596
1597 .table-display {
1598         width: 100%;
1599         border: 0;
1600         border-collapse: collapse;
1601         border-spacing: 0;
1602         font-size: 1rem;
1603 }
1604
1605 .table-display tr td:first-child {
1606         padding-right: 0;
1607 }
1608
1609 .table-display tr td:last-child {
1610         float: right;
1611 }
1612 .table-display .out-of-band {
1613         position: relative;
1614         font-size: 1.125rem;
1615         display: block;
1616 }
1617
1618 .table-display td:hover .anchor {
1619         display: block;
1620         top: 2px;
1621         left: -5px;
1622 }
1623
1624 #main-content > ul {
1625         padding-left: 10px;
1626 }
1627 #main-content > ul > li {
1628         list-style: none;
1629 }
1630
1631 .non-exhaustive {
1632         margin-bottom: 1em;
1633 }
1634
1635 details.dir-entry {
1636         padding-left: 4px;
1637 }
1638
1639 details.dir-entry > summary {
1640         margin: 0 0 0 13px;
1641         list-style-position: outside;
1642         cursor: pointer;
1643 }
1644
1645 details.dir-entry div.folders, details.dir-entry div.files {
1646         padding-left: 23px;
1647 }
1648
1649 details.dir-entry a {
1650         display: block;
1651 }
1652
1653 /* The hideme class is used on summary tags that contain a span with
1654         placeholder text shown only when the toggle is closed. For instance,
1655         "Expand description" or "Show methods". */
1656 details.rustdoc-toggle > summary.hideme {
1657         cursor: pointer;
1658 }
1659
1660 details.rustdoc-toggle > summary {
1661         list-style: none;
1662 }
1663 details.rustdoc-toggle > summary::-webkit-details-marker,
1664 details.rustdoc-toggle > summary::marker {
1665         display: none;
1666 }
1667
1668 details.rustdoc-toggle > summary.hideme > span {
1669         margin-left: 9px;
1670 }
1671
1672 details.rustdoc-toggle > summary::before {
1673         content: "";
1674         cursor: pointer;
1675         width: 16px;
1676         height: 16px;
1677         background-repeat: no-repeat;
1678         background-position: top left;
1679         display: inline-block;
1680         vertical-align: middle;
1681         opacity: .5;
1682 }
1683
1684 /* Screen readers see the text version at the end the line.
1685         Visual readers see the icon at the start of the line, but small and transparent. */
1686 details.rustdoc-toggle > summary::after {
1687         content: "Expand";
1688         overflow: hidden;
1689         width: 0;
1690         height: 0;
1691         position: absolute;
1692 }
1693
1694 details.rustdoc-toggle > summary.hideme::after {
1695         /* "hideme" toggles already have a description when they're contracted */
1696         content: "";
1697 }
1698
1699 details.rustdoc-toggle > summary:focus::before,
1700 details.rustdoc-toggle > summary:hover::before {
1701         opacity: 1;
1702 }
1703
1704 details.rustdoc-toggle.top-doc > summary,
1705 details.rustdoc-toggle.top-doc > summary::before,
1706 details.rustdoc-toggle.non-exhaustive > summary,
1707 details.rustdoc-toggle.non-exhaustive > summary::before {
1708         font-size: 1rem;
1709 }
1710
1711 details.non-exhaustive {
1712         margin-bottom: 8px;
1713 }
1714
1715 details.rustdoc-toggle > summary.hideme::before {
1716         position: relative;
1717 }
1718
1719 details.rustdoc-toggle > summary:not(.hideme)::before {
1720         position: absolute;
1721         left: -24px;
1722         top: 4px;
1723 }
1724
1725 .impl-items > details.rustdoc-toggle > summary:not(.hideme)::before {
1726         position: absolute;
1727         left: -24px;
1728 }
1729
1730 /* When a "hideme" summary is open and the "Expand description" or "Show
1731         methods" text is hidden, we want the [-] toggle that remains to not
1732         affect the layout of the items to its right. To do that, we use
1733         absolute positioning. Note that we also set position: relative
1734         on the parent <details> to make this work properly. */
1735 details.rustdoc-toggle[open] > summary.hideme {
1736         position: absolute;
1737 }
1738
1739 details.rustdoc-toggle {
1740         position: relative;
1741 }
1742
1743 details.rustdoc-toggle[open] > summary.hideme > span {
1744         display: none;
1745 }
1746
1747 details.rustdoc-toggle[open] > summary::before,
1748 details.rustdoc-toggle[open] > summary.hideme::before {
1749         background-image: /* AUTOREPLACE: */url("toggle-minus.svg");
1750 }
1751
1752 details.rustdoc-toggle > summary::before {
1753         background-image: /* AUTOREPLACE: */url("toggle-plus.svg");
1754 }
1755
1756 details.rustdoc-toggle[open] > summary::before,
1757 details.rustdoc-toggle[open] > summary.hideme::before {
1758         width: 16px;
1759         height: 16px;
1760         background-repeat: no-repeat;
1761         background-position: top left;
1762         display: inline-block;
1763         content: "";
1764 }
1765
1766 details.rustdoc-toggle[open] > summary::after,
1767 details.rustdoc-toggle[open] > summary.hideme::after {
1768         content: "Collapse";
1769 }
1770
1771 /* This is needed in docblocks to have the "â–¶" element to be on the same line. */
1772 .docblock summary > * {
1773         display: inline-block;
1774 }
1775
1776 /* Media Queries */
1777
1778 /*
1779 WARNING: RUSTDOC_MOBILE_BREAKPOINT MEDIA QUERY;
1780 If you update this line, then you also need to update the line with the same warning
1781 in storage.js plus the media query with (max-width: 700px)
1782 */
1783 @media (min-width: 701px) {
1784         /* In case there is no documentation before a code block, we need to add some margin at the top
1785         to prevent an overlay between the "collapse toggle" and the information tooltip.
1786         However, it's not needed with smaller screen width because the doc/code block is always put
1787         "one line" below. */
1788         .docblock > .information:first-child > .tooltip {
1789                 margin-top: 16px;
1790         }
1791
1792         /* When we expand the sidebar on the source code page, we hide the logo on the left of the
1793         search bar to have more space. */
1794         .source-sidebar-expanded .source .sidebar + main .width-limiter .sub-logo-container.rust-logo {
1795                 display: none;
1796         }
1797
1798         .source-sidebar-expanded .source .sidebar {
1799                 width: 300px;
1800         }
1801 }
1802
1803 /*
1804 WARNING: RUSTDOC_MOBILE_BREAKPOINT MEDIA QUERY
1805 If you update this line, then you also need to update the line with the same warning
1806 in storage.js plus the media query with (min-width: 701px)
1807 */
1808 @media (max-width: 700px) {
1809         /* When linking to an item with an `id` (for instance, by clicking a link in the sidebar,
1810            or visiting a URL with a fragment like `#method.new`, we don't want the item to be obscured
1811            by the topbar. Anything with an `id` gets scroll-margin-top equal to .mobile-topbar's size.
1812         */
1813         *[id] {
1814                 scroll-margin-top: 45px;
1815         }
1816
1817         .rustdoc {
1818                 padding-top: 0px;
1819                 /* Sidebar should overlay main content, rather than pushing main content to the right.
1820                    Turn off `display: flex` on the body element. */
1821                 display: block;
1822         }
1823
1824         main {
1825                 padding-left: 15px;
1826                 padding-top: 0px;
1827         }
1828
1829         .rustdoc,
1830         .main-heading {
1831                 flex-direction: column;
1832         }
1833
1834         .content .out-of-band {
1835                 text-align: left;
1836                 margin-left: initial;
1837                 padding: initial;
1838         }
1839
1840         .content .out-of-band .since::before {
1841                 content: "Since ";
1842         }
1843
1844         #copy-path {
1845                 display: none;
1846         }
1847
1848         /* Hide the logo and item name from the sidebar. Those are displayed
1849            in the mobile-topbar instead. */
1850         .sidebar .sidebar-logo,
1851         .sidebar .location {
1852                 display: none;
1853         }
1854
1855         .sidebar-elems {
1856                 margin-top: 1em;
1857         }
1858
1859         .sidebar {
1860                 position: fixed;
1861                 top: 45px;
1862                 /* Hide the sidebar offscreen while not in use. Doing this instead of display: none means
1863                    the sidebar stays visible for screen readers, which is useful for navigation. */
1864                 left: -1000px;
1865                 margin-left: 0;
1866                 margin: 0;
1867                 padding: 0;
1868                 z-index: 11;
1869                 /* Reduce height slightly to account for mobile topbar. */
1870                 height: calc(100vh - 45px);
1871         }
1872
1873         /* The source view uses a different design for the sidebar toggle, and doesn't have a topbar,
1874            so don't bump down the main content or the sidebar. */
1875         .source main,
1876         .rustdoc.source .sidebar {
1877                 top: 0;
1878                 padding: 0;
1879                 height: 100vh;
1880                 border: 0;
1881         }
1882
1883         .sidebar.shown,
1884         .source-sidebar-expanded .source .sidebar,
1885         .sidebar:focus-within {
1886                 left: 0;
1887         }
1888
1889         .rustdoc.source > .sidebar {
1890                 position: fixed;
1891                 margin: 0;
1892                 z-index: 11;
1893                 width: 0;
1894         }
1895
1896         .mobile-topbar .location a {
1897                 padding: 0;
1898                 margin: 0;
1899         }
1900
1901         .mobile-topbar .location {
1902                 border: none;
1903                 padding: 0;
1904                 margin: auto 0.5em auto auto;
1905                 text-overflow: ellipsis;
1906                 overflow: hidden;
1907                 white-space: nowrap;
1908                 /* Rare exception to specifying font sizes in rem. Since the topbar
1909                    height is specified in pixels, this also has to be specified in
1910                    pixels to avoid overflowing the topbar when the user sets a bigger
1911                    font size. */
1912                 font-size: 24px;
1913         }
1914
1915         .mobile-topbar .logo-container {
1916                 max-height: 45px;
1917         }
1918
1919         .mobile-topbar .logo-container > img {
1920                 max-width: 35px;
1921                 max-height: 35px;
1922                 margin-left: 20px;
1923                 margin-top: 5px;
1924                 margin-bottom: 5px;
1925         }
1926
1927         .mobile-topbar {
1928                 display: flex;
1929                 flex-direction: row;
1930                 position: sticky;
1931                 z-index: 10;
1932                 font-size: 2rem;
1933                 height: 45px;
1934                 width: 100%;
1935                 left: 0;
1936                 top: 0;
1937         }
1938
1939         .source .mobile-topbar {
1940                 display: none;
1941         }
1942
1943         .sidebar-menu-toggle {
1944                 width: 45px;
1945                 /* Rare exception to specifying font sizes in rem. Since this is acting
1946                    as an icon, it's okay to specify its sizes in pixels. */
1947                 font-size: 32px;
1948                 border: none;
1949         }
1950
1951         .sidebar-elems {
1952                 background-color: var(--sidebar-background-color);
1953         }
1954
1955         .source nav:not(.sidebar).sub {
1956                 margin-left: 32px;
1957         }
1958
1959         .content {
1960                 margin-left: 0px;
1961         }
1962
1963         .source .content {
1964                 margin-top: 10px;
1965         }
1966
1967         #search {
1968                 margin-left: 0;
1969                 padding: 0;
1970         }
1971
1972         .anchor {
1973                 display: none !important;
1974         }
1975
1976         .notable-traits {
1977                 position: absolute;
1978                 left: -22px;
1979                 top: 24px;
1980         }
1981
1982         #titles > button > div.count {
1983                 float: left;
1984                 width: 100%;
1985         }
1986
1987         #titles {
1988                 height: 50px;
1989         }
1990
1991         /* Because of ios, we need to actually have a full height sidebar title so the
1992          * actual sidebar can show up. But then we need to make it transparent so we don't
1993          * hide content. The filler just allows to create the background for the sidebar
1994          * title. But because of the absolute position, I had to lower the z-index.
1995          */
1996         #sidebar-filler {
1997                 position: fixed;
1998                 left: 45px;
1999                 width: calc(100% - 45px);
2000                 top: 0;
2001                 height: 45px;
2002                 z-index: -1;
2003                 border-bottom: 1px solid;
2004         }
2005
2006         #main-content > details.rustdoc-toggle > summary::before,
2007         #main-content > div > details.rustdoc-toggle > summary::before {
2008                 left: -11px;
2009         }
2010
2011         #sidebar-toggle {
2012                 position: fixed;
2013                 left: 1px;
2014                 top: 100px;
2015                 width: 30px;
2016                 font-size: 1.5rem;
2017                 text-align: center;
2018                 padding: 0;
2019                 z-index: 10;
2020                 border-top-right-radius: 3px;
2021                 border-bottom-right-radius: 3px;
2022                 cursor: pointer;
2023                 font-weight: bold;
2024                 border: 1px solid;
2025                 border-left: 0;
2026         }
2027
2028         .source-sidebar-expanded #sidebar-toggle {
2029                 left: unset;
2030                 top: unset;
2031                 width: unset;
2032                 border-top-right-radius: unset;
2033                 border-bottom-right-radius: unset;
2034                 position: sticky;
2035                 border: 0;
2036                 border-bottom: 1px solid;
2037         }
2038
2039         #source-sidebar {
2040                 z-index: 11;
2041         }
2042
2043         #main-content > .line-numbers {
2044                 margin-top: 0;
2045         }
2046
2047         .notable-traits .notable-traits-tooltiptext {
2048                 left: 0;
2049                 top: 100%;
2050         }
2051
2052         /* We don't display the help button on mobile devices. */
2053         #help-button {
2054                 display: none;
2055         }
2056
2057         /* Display an alternating layout on tablets and phones */
2058         .item-table {
2059                 display: block;
2060         }
2061         .item-row {
2062                 display: flex;
2063                 flex-flow: column wrap;
2064         }
2065         .item-left, .item-right {
2066                 width: 100%;
2067         }
2068
2069         /* Display an alternating layout on tablets and phones */
2070         .search-results > a {
2071                 border-bottom: 1px solid #aaa9;
2072                 padding: 5px 0px;
2073         }
2074         .search-results .result-name, .search-results div.desc, .search-results .result-description {
2075                 width: 100%;
2076         }
2077         .search-results div.desc, .search-results .result-description, .item-right {
2078                 padding-left: 2em;
2079         }
2080
2081         .source-sidebar-expanded .source .sidebar {
2082                 max-width: 100vw;
2083                 width: 100vw;
2084         }
2085
2086         /* Position of the "[-]" element. */
2087         details.rustdoc-toggle:not(.top-doc) > summary {
2088                 margin-left: 10px;
2089         }
2090         .impl-items > details.rustdoc-toggle > summary:not(.hideme)::before,
2091         #main-content > details.rustdoc-toggle:not(.top-doc) > summary::before,
2092         #main-content > div > details.rustdoc-toggle > summary::before {
2093                 left: -11px;
2094         }
2095 }
2096
2097 @media print {
2098         nav.sidebar, nav.sub, .content .out-of-band, a.srclink, #copy-path,
2099         details.rustdoc-toggle[open] > summary::before, details.rustdoc-toggle > summary::before,
2100         details.rustdoc-toggle.top-doc > summary {
2101                 display: none;
2102         }
2103
2104         .docblock {
2105                 margin-left: 0;
2106         }
2107
2108         main {
2109                 padding: 10px;
2110         }
2111 }
2112
2113 @media (max-width: 464px) {
2114         #titles, #titles > button {
2115                 height: 73px;
2116         }
2117
2118         #main-content > table:not(.table-display) td {
2119                 word-break: break-word;
2120                 width: 50%;
2121         }
2122
2123         #crate-search {
2124                 border-radius: 4px;
2125         }
2126
2127         .docblock {
2128                 margin-left: 12px;
2129         }
2130
2131         .docblock code {
2132                 overflow-wrap: break-word;
2133                 overflow-wrap: anywhere;
2134         }
2135
2136         .sub-container {
2137                 flex-direction: column;
2138         }
2139
2140         .sub-logo-container {
2141                 align-self: center;
2142         }
2143
2144         .source .sub-logo-container > img {
2145                 height: 35px;
2146                 width: 35px;
2147         }
2148
2149         #sidebar-toggle {
2150                 top: 10px;
2151         }
2152         .source-sidebar-expanded #sidebar-toggle {
2153                 top: unset;
2154         }
2155 }
2156
2157 .method-toggle summary,
2158 .implementors-toggle summary,
2159 .impl {
2160         margin-bottom: 0.75em;
2161 }
2162
2163 .method-toggle[open] {
2164         margin-bottom: 2em;
2165 }
2166
2167 .implementors-toggle[open]  {
2168         margin-bottom: 2em;
2169 }
2170
2171 #trait-implementations-list .method-toggle,
2172 #synthetic-implementations-list .method-toggle,
2173 #blanket-implementations-list .method-toggle {
2174         margin-bottom: 1em;
2175 }
2176
2177 /* Begin: styles for --scrape-examples feature */
2178
2179 .scraped-example-list .scrape-help {
2180         margin-left: 10px;
2181         padding: 0 4px;
2182         font-weight: normal;
2183         font-size: 12px;
2184         position: relative;
2185         bottom: 1px;
2186         background: transparent;
2187         border-width: 1px;
2188         border-style: solid;
2189         border-radius: 50px;
2190 }
2191
2192 .scraped-example .code-wrapper {
2193         position: relative;
2194         display: flex;
2195         flex-direction: row;
2196         flex-wrap: wrap;
2197         width: 100%;
2198 }
2199
2200 .scraped-example:not(.expanded) .code-wrapper {
2201         max-height: 240px;
2202 }
2203
2204 .scraped-example:not(.expanded) .code-wrapper pre {
2205         overflow-y: hidden;
2206         max-height: 240px;
2207         padding-bottom: 0;
2208 }
2209
2210 .scraped-example:not(.expanded) .code-wrapper pre.line-numbers {
2211         overflow-x: hidden;
2212 }
2213
2214 .scraped-example .code-wrapper .prev {
2215         position: absolute;
2216         top: 0.25em;
2217         right: 2.25em;
2218         z-index: 100;
2219         cursor: pointer;
2220 }
2221
2222 .scraped-example .code-wrapper .next {
2223         position: absolute;
2224         top: 0.25em;
2225         right: 1.25em;
2226         z-index: 100;
2227         cursor: pointer;
2228 }
2229
2230 .scraped-example .code-wrapper .expand {
2231         position: absolute;
2232         top: 0.25em;
2233         right: 0.25em;
2234         z-index: 100;
2235         cursor: pointer;
2236 }
2237
2238 .scraped-example:not(.expanded) .code-wrapper:before {
2239         content: " ";
2240         width: 100%;
2241         height: 5px;
2242         position: absolute;
2243         z-index: 100;
2244         top: 0;
2245 }
2246
2247 .scraped-example:not(.expanded) .code-wrapper:after {
2248         content: " ";
2249         width: 100%;
2250         height: 5px;
2251         position: absolute;
2252         z-index: 100;
2253         bottom: 0;
2254 }
2255
2256 .scraped-example .code-wrapper .line-numbers {
2257         margin: 0;
2258         padding: 14px 0;
2259 }
2260
2261 .scraped-example .code-wrapper .line-numbers span {
2262         padding: 0 14px;
2263 }
2264
2265 .scraped-example .code-wrapper .example-wrap {
2266         flex: 1;
2267         overflow-x: auto;
2268         overflow-y: hidden;
2269         margin-bottom: 0;
2270 }
2271
2272 .scraped-example:not(.expanded) .code-wrapper .example-wrap {
2273         overflow-x: hidden;
2274 }
2275
2276 .scraped-example .code-wrapper .example-wrap pre.rust {
2277         overflow-x: inherit;
2278         width: inherit;
2279         overflow-y: hidden;
2280 }
2281
2282
2283 .more-examples-toggle {
2284         max-width: calc(100% + 25px);
2285         margin-top: 10px;
2286         margin-left: -25px;
2287 }
2288
2289 .more-examples-toggle .hide-more {
2290         margin-left: 25px;
2291         margin-bottom: 5px;
2292         cursor: pointer;
2293 }
2294
2295 .more-scraped-examples {
2296         margin-left: 5px;
2297         display: flex;
2298         flex-direction: row;
2299 }
2300
2301 .more-scraped-examples-inner {
2302         /* 20px is width of toggle-line + toggle-line-inner */
2303         width: calc(100% - 20px);
2304 }
2305
2306 .toggle-line {
2307         align-self: stretch;
2308         margin-right: 10px;
2309         margin-top: 5px;
2310         padding: 0 4px;
2311         cursor: pointer;
2312 }
2313
2314 .toggle-line-inner {
2315         min-width: 2px;
2316         height: 100%;
2317 }
2318
2319 .more-scraped-examples .scraped-example {
2320         margin-bottom: 20px;
2321 }
2322
2323 .more-scraped-examples .scraped-example:last-child {
2324         margin-bottom: 0;
2325 }
2326
2327 .example-links a {
2328         margin-top: 20px;
2329 }
2330
2331 .example-links ul {
2332         margin-bottom: 0;
2333 }
2334
2335 /* End: styles for --scrape-examples feature */