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