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