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