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