]> git.lizzy.rs Git - rust.git/blob - src/librustdoc/html/static/rustdoc.css
Rollup merge of #85174 - GuillaumeGomez:doc-code-block-border-radius, r=jsha
[rust.git] / src / librustdoc / html / static / rustdoc.css
1 /* See FiraSans-LICENSE.txt for the Fira Sans license. */
2 @font-face {
3         font-family: 'Fira Sans';
4         font-style: normal;
5         font-weight: 400;
6         src: local('Fira Sans'),
7                 url("FiraSans-Regular.woff2") format("woff2"),
8                 url("FiraSans-Regular.woff") format('woff');
9         font-display: swap;
10 }
11 @font-face {
12         font-family: 'Fira Sans';
13         font-style: normal;
14         font-weight: 500;
15         src: local('Fira Sans Medium'),
16                 url("FiraSans-Medium.woff2") format("woff2"),
17                 url("FiraSans-Medium.woff") format('woff');
18         font-display: swap;
19 }
20
21 /* See SourceSerif4-LICENSE.md for the Source Serif 4 license. */
22 @font-face {
23         font-family: 'Source Serif 4';
24         font-style: normal;
25         font-weight: 400;
26         src: local('Source Serif 4'), url("SourceSerif4-Regular.ttf.woff") format('woff');
27         font-display: swap;
28 }
29 @font-face {
30         font-family: 'Source Serif 4';
31         font-style: italic;
32         font-weight: 400;
33         src: local('Source Serif 4 Italic'), url("SourceSerif4-It.ttf.woff") format('woff');
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'), url("SourceSerif4-Bold.ttf.woff") format('woff');
41         font-display: swap;
42 }
43
44 /* See SourceCodePro-LICENSE.txt for the Source Code Pro license. */
45 @font-face {
46         font-family: 'Source Code Pro';
47         font-style: normal;
48         font-weight: 400;
49         /* Avoid using locally installed font because bad versions are in circulation:
50          * see https://github.com/rust-lang/rust/issues/24355 */
51         src: url("SourceCodePro-Regular.ttf.woff") format('woff');
52         font-display: swap;
53 }
54 @font-face {
55         font-family: 'Source Code Pro';
56         font-style: italic;
57         font-weight: 400;
58         src: url("SourceCodePro-It.ttf.woff") format('woff');
59         font-display: swap;
60 }
61 @font-face {
62         font-family: 'Source Code Pro';
63         font-style: normal;
64         font-weight: 600;
65         src: url("SourceCodePro-Semibold.ttf.woff") format('woff');
66         font-display: swap;
67 }
68
69 * {
70         -webkit-box-sizing: border-box;
71         -moz-box-sizing: border-box;
72         box-sizing: border-box;
73 }
74
75 /* This part handles the "default" theme being used depending on the system one. */
76 html {
77         content: "";
78 }
79 @media (prefers-color-scheme: light) {
80         html {
81                 content: "light";
82         }
83 }
84 @media (prefers-color-scheme: dark) {
85         html {
86                 content: "dark";
87         }
88 }
89
90 /* General structure and fonts */
91
92 body {
93         font: 16px/1.4 "Source Serif 4", serif;
94         margin: 0;
95         position: relative;
96         padding: 10px 15px 20px 15px;
97
98         -webkit-font-feature-settings: "kern", "liga";
99         -moz-font-feature-settings: "kern", "liga";
100         font-feature-settings: "kern", "liga";
101 }
102
103 h1 {
104         font-size: 1.5em;
105 }
106 h2 {
107         font-size: 1.4em;
108 }
109 h3 {
110         font-size: 1.3em;
111 }
112 h1, h2, h3:not(.impl):not(.method):not(.type):not(.tymethod):not(.notable),
113 h4:not(.method):not(.type):not(.tymethod):not(.associatedconstant):not(.associatedtype) {
114         font-weight: 500;
115         margin: 20px 0 15px 0;
116         padding-bottom: 6px;
117 }
118 h1.fqn {
119         display: flex;
120         border-bottom: 1px dashed;
121         margin-top: 0;
122
123         /* workaround to keep flex from breaking below 700 px width due to the float: right on the nav
124            above the h1 */
125         padding-left: 1px;
126 }
127 h1.fqn > .in-band > a:hover {
128         text-decoration: underline;
129 }
130 h2, h3:not(.impl):not(.method):not(.type):not(.tymethod),
131 h4:not(.method):not(.type):not(.tymethod):not(.associatedconstant):not(.associatedtype) {
132         border-bottom: 1px solid;
133 }
134 h3.impl, h3.method, h4.method, h3.type, h4.type, h4.associatedconstant, h4.associatedtype {
135         flex-basis: 100%;
136         font-weight: 600;
137         margin-top: 16px;
138         margin-bottom: 10px;
139         position: relative;
140 }
141 h3.impl, h3.method, h4.method.trait-impl, h3.type,
142 h4.type.trait-impl, h4.associatedconstant.trait-impl, h4.associatedtype.trait-impl {
143         padding-left: 15px;
144 }
145
146 h1, h2, h3, h4,
147 .sidebar, a.source, .search-input, .content table td:first-child > a,
148 .collapse-toggle, div.item-list .out-of-band,
149 #source-sidebar, #sidebar-toggle,
150 details.rustdoc-toggle > summary::before,
151 details.undocumented > summary::before,
152 .content ul.crate a.crate,
153 /* This selector is for the items listed in the "all items" page. */
154 #main > ul.docblock > li > a {
155         font-family: "Fira Sans", Arial, sans-serif;
156 }
157
158 .content ul.crate a.crate {
159         font-size: 16px/1.6;
160 }
161
162 ol, ul {
163         padding-left: 25px;
164 }
165 ul ul, ol ul, ul ol, ol ol {
166         margin-bottom: .6em;
167 }
168
169 p {
170         margin: 0 0 .6em 0;
171 }
172
173 summary {
174         outline: none;
175 }
176
177 code, pre, a.test-arrow {
178         font-family: "Source Code Pro", monospace;
179 }
180 .docblock code, .docblock-short code {
181         border-radius: 3px;
182         padding: 0 0.1em;
183 }
184 .docblock pre code, .docblock-short pre code {
185         padding: 0;
186         padding-right: 1ex;
187 }
188 pre {
189         padding: 14px;
190 }
191
192 .source .content pre {
193         padding: 20px;
194 }
195
196 img {
197         max-width: 100%;
198 }
199
200 li {
201         position: relative;
202 }
203
204 .source .content {
205         margin-top: 50px;
206         max-width: none;
207         overflow: visible;
208         margin-left: 0px;
209 }
210
211 nav.sub {
212         font-size: 16px;
213         text-transform: uppercase;
214 }
215
216 .sidebar {
217         width: 200px;
218         position: fixed;
219         left: 0;
220         top: 0;
221         bottom: 0;
222         overflow: auto;
223 }
224
225 /* Improve the scrollbar display on firefox */
226 * {
227         scrollbar-width: initial;
228 }
229 .sidebar {
230         scrollbar-width: thin;
231 }
232
233 /* Improve the scrollbar display on webkit-based browsers */
234 ::-webkit-scrollbar {
235         width: 12px;
236 }
237 .sidebar::-webkit-scrollbar {
238         width: 8px;
239 }
240 ::-webkit-scrollbar-track {
241         -webkit-box-shadow: inset 0;
242 }
243
244 .sidebar .block > ul > li {
245         margin-right: -10px;
246 }
247
248 .content, nav {
249         max-width: 960px;
250 }
251
252 /* Everything else */
253
254 .hidden {
255         display: none !important;
256 }
257
258 .logo-container {
259         height: 100px;
260         width: 100px;
261         position: relative;
262         margin: 20px auto;
263         display: block;
264         margin-top: 10px;
265 }
266
267 .logo-container > img {
268         max-width: 100px;
269         max-height: 100px;
270         position: absolute;
271         left: 50%;
272         top: 50%;
273         transform: translate(-50%, -50%);
274         display: block;
275 }
276
277 .sidebar .location {
278         border: 1px solid;
279         font-size: 17px;
280         margin: 30px 10px 20px 10px;
281         text-align: center;
282         word-wrap: break-word;
283 }
284
285 .sidebar .version {
286         font-size: 15px;
287         text-align: center;
288         border-bottom: 1px solid;
289         overflow-wrap: break-word;
290         word-wrap: break-word; /* deprecated */
291         word-break: break-word; /* Chrome, non-standard */
292 }
293
294 .location:empty {
295         border: none;
296 }
297
298 .location a:first-child {
299         font-weight: 500;
300 }
301
302 .block {
303         padding: 0;
304         margin-bottom: 14px;
305 }
306 .block h2, .block h3 {
307         margin-top: 0;
308         margin-bottom: 8px;
309         text-align: center;
310 }
311 .block ul, .block li {
312         margin: 0 10px;
313         padding: 0;
314         list-style: none;
315 }
316
317 .block a {
318         display: block;
319         text-overflow: ellipsis;
320         overflow: hidden;
321         line-height: 15px;
322         padding: 7px 5px;
323         font-size: 14px;
324         font-weight: 300;
325         transition: border 500ms ease-out;
326 }
327
328 .sidebar-title {
329         border-top: 1px solid;
330         border-bottom: 1px solid;
331         text-align: center;
332         font-size: 17px;
333         margin-bottom: 5px;
334 }
335
336 .sidebar-links {
337         margin-bottom: 15px;
338 }
339
340 .sidebar-links > a {
341         padding-left: 10px;
342         width: 100%;
343 }
344
345 .sidebar-menu {
346         display: none;
347 }
348
349 .content {
350         padding: 15px 0;
351 }
352
353 .source .content pre.rust {
354         white-space: pre;
355         overflow: auto;
356         padding-left: 0;
357 }
358
359 .rustdoc .example-wrap {
360         display: inline-flex;
361         margin-bottom: 10px;
362 }
363
364 .example-wrap {
365         position: relative;
366         width: 100%;
367 }
368
369 .example-wrap > pre.line-number {
370         overflow: initial;
371         border: 1px solid;
372         padding: 13px 8px;
373         text-align: right;
374         border-top-left-radius: 5px;
375         border-bottom-left-radius: 5px;
376 }
377
378 .rustdoc:not(.source) .example-wrap > pre.rust {
379         width: 100%;
380         overflow-x: auto;
381 }
382
383 .rustdoc .example-wrap > pre {
384         margin: 0;
385 }
386
387 #search {
388         margin-left: 230px;
389         position: relative;
390 }
391
392 #results > table {
393         width: 100%;
394         table-layout: fixed;
395 }
396
397 .content > .example-wrap pre.line-numbers {
398         position: relative;
399         -webkit-user-select: none;
400         -moz-user-select: none;
401         -ms-user-select: none;
402         user-select: none;
403 }
404 .line-numbers span {
405         cursor: pointer;
406 }
407
408 .docblock-short {
409         overflow-wrap: anywhere;
410 }
411 .docblock-short p {
412         display: inline;
413 }
414
415 .docblock-short p {
416         overflow: hidden;
417         text-overflow: ellipsis;
418         margin: 0;
419 }
420 /* Wrap non-pre code blocks (`text`) but not (```text```). */
421 .docblock > :not(pre) > code,
422 .docblock-short > :not(pre) > code {
423         white-space: pre-wrap;
424 }
425
426 .docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5 {
427         border-bottom: 1px solid;
428 }
429
430 #main > .docblock h1 { font-size: 1.3em; }
431 #main > .docblock h2 { font-size: 1.15em; }
432 #main > .docblock h3, #main > .docblock h4, #main > .docblock h5 { font-size: 1em; }
433
434 #main > h2 + div, #main > h2 + h3, #main > h3 + div {
435         display: none; /* Changed to flex or block via js once the page is loaded */
436         flex-wrap: wrap;
437 }
438
439 .docblock h1 { font-size: 1em; }
440 .docblock h2 { font-size: 0.95em; }
441 .docblock h3, .docblock h4, .docblock h5 { font-size: 0.9em; }
442
443 .docblock {
444         margin-left: 24px;
445         position: relative;
446 }
447
448 .content .out-of-band {
449         flex-grow: 0;
450         text-align: right;
451         font-size: 23px;
452         margin: 0px;
453         padding: 0 0 0 12px;
454         font-weight: normal;
455 }
456
457 h3.impl > .out-of-band {
458         font-size: 21px;
459 }
460
461 h4.method > .out-of-band {
462         font-size: 19px;
463 }
464
465 h4 > code, h3 > code, .invisible > code {
466         max-width: calc(100% - 41px);
467         display: block;
468 }
469
470 .invisible {
471         width: 100%;
472         display: inline-block;
473 }
474
475 .content .in-band {
476         flex-grow: 1;
477         margin: 0px;
478         padding: 0px;
479 }
480
481 .in-band > code {
482         display: inline-block;
483 }
484
485 #main {
486         position: relative;
487 }
488 #main > .since {
489         top: inherit;
490         font-family: "Fira Sans", Arial, sans-serif;
491 }
492
493 .content table:not(.table-display) {
494         border-spacing: 0 5px;
495 }
496 .content td { vertical-align: top; }
497 .content td:first-child { padding-right: 20px; }
498 .content td p:first-child { margin-top: 0; }
499 .content td h1, .content td h2 { margin-left: 0; font-size: 1.1em; }
500 .content tr:first-child td { border-top: 0; }
501
502 .docblock table {
503         margin: .5em 0;
504         width: calc(100% - 2px);
505         border: 1px dashed;
506 }
507
508 .docblock table td {
509         padding: .5em;
510         border: 1px dashed;
511 }
512
513 .docblock table th {
514         padding: .5em;
515         text-align: left;
516         border: 1px solid;
517 }
518
519 .fields + table {
520         margin-bottom: 1em;
521 }
522
523 .content .item-list {
524         list-style-type: none;
525         padding: 0;
526 }
527
528 .content .multi-column {
529         -moz-column-count: 5;
530         -moz-column-gap: 2.5em;
531         -webkit-column-count: 5;
532         -webkit-column-gap: 2.5em;
533         column-count: 5;
534         column-gap: 2.5em;
535 }
536 .content .multi-column li { width: 100%; display: inline-block; }
537
538 .content .method {
539         font-size: 1em;
540         position: relative;
541 }
542 /* Shift "where ..." part of method or fn definition down a line */
543 .content .method .where,
544 .content .fn .where,
545 .content .where.fmt-newline {
546         display: block;
547         font-size: 0.8em;
548 }
549
550 .content .methods > div:not(.notable-traits) {
551         margin-left: 40px;
552         margin-bottom: 15px;
553 }
554
555 .content .docblock > .impl-items {
556         margin-left: 20px;
557         margin-top: -34px;
558 }
559 .content .docblock > .impl-items > h4 {
560         border-bottom: 0;
561 }
562 .content .docblock >.impl-items .table-display {
563         margin: 0;
564 }
565 .content .docblock >.impl-items table td {
566         padding: 0;
567 }
568 .toggle-wrapper.marg-left > .collapse-toggle {
569         left: -24px;
570 }
571 .content .docblock > .impl-items .table-display, .impl-items table td {
572         border: none;
573 }
574
575 .content .item-info code {
576         font-size: 90%;
577 }
578
579 .content .item-info {
580         position: relative;
581         margin-left: 33px;
582         margin-top: -13px;
583 }
584
585 .sub-variant > div > .item-info {
586         margin-top: initial;
587 }
588
589 .content .item-info::before {
590         content: '⬑';
591         font-size: 25px;
592         position: absolute;
593         top: -6px;
594         left: -19px;
595 }
596
597 .content .impl-items .method, .content .impl-items > .type, .impl-items > .associatedconstant,
598 .impl-items > .associatedtype, .content .impl-items details > summary > .type,
599 .impl-items details > summary > .associatedconstant,
600 .impl-items details > summary > .associatedtype {
601         margin-left: 20px;
602 }
603
604 .content .impl-items .docblock, .content .impl-items .item-info {
605         margin-bottom: .6em;
606 }
607
608 .content .impl-items > .item-info {
609         margin-left: 40px;
610 }
611
612 .methods > .item-info, .content .impl-items > .item-info {
613         margin-top: -8px;
614 }
615
616 .impl-items {
617         flex-basis: 100%;
618 }
619
620 #main > .item-info {
621         margin-top: 0;
622 }
623
624 nav:not(.sidebar) {
625         border-bottom: 1px solid;
626         padding-bottom: 10px;
627         margin-bottom: 10px;
628 }
629 nav.main {
630         padding: 20px 0;
631         text-align: center;
632 }
633 nav.main .current {
634         border-top: 1px solid;
635         border-bottom: 1px solid;
636 }
637 nav.main .separator {
638         border: 1px solid;
639         display: inline-block;
640         height: 23px;
641         margin: 0 20px;
642 }
643 nav.sum { text-align: right; }
644 nav.sub form { display: inline; }
645
646 nav.sub, .content {
647         margin-left: 230px;
648 }
649
650 a {
651         text-decoration: none;
652         background: transparent;
653 }
654
655 .small-section-header:hover > .anchor {
656         display: initial;
657 }
658
659 .in-band:hover > .anchor, .impl:hover > .anchor, .method.trait-impl:hover > .anchor,
660 .type.trait-impl:hover > .anchor, .associatedconstant.trait-impl:hover > .anchor,
661 .associatedtype.trait-impl:hover > .anchor {
662         display: inline-block;
663         position: absolute;
664 }
665 .anchor {
666         display: none;
667         position: absolute;
668         left: -7px;
669 }
670 .anchor.field {
671         left: -5px;
672 }
673 .small-section-header > .anchor {
674         left: -28px;
675         padding-right: 10px; /* avoid gap that causes hover to disappear */
676 }
677 .anchor:before {
678         content: '\2002\00a7\2002';
679 }
680
681 .docblock a:not(.srclink):not(.test-arrow):hover,
682 .docblock-short a:not(.srclink):not(.test-arrow):hover, .item-info a {
683         text-decoration: underline;
684 }
685
686 .invisible > .srclink, h4 > code + .srclink, h3 > code + .srclink {
687         position: absolute;
688         top: 0;
689         right: 0;
690         font-size: 17px;
691         font-weight: normal;
692 }
693
694 .block a.current.crate { font-weight: 500; }
695
696 .search-container {
697         position: relative;
698 }
699 .search-container > div {
700         display: inline-flex;
701         width: calc(100% - 63px);
702 }
703 #crate-search {
704         min-width: 115px;
705         margin-top: 5px;
706         padding: 6px;
707         padding-right: 19px;
708         flex: none;
709         border: 0;
710         border-right: 0;
711         border-radius: 4px 0 0 4px;
712         outline: none;
713         cursor: pointer;
714         border-right: 1px solid;
715         -moz-appearance: none;
716         -webkit-appearance: none;
717         /* Removes default arrow from firefox */
718         text-indent: 0.01px;
719         text-overflow: "";
720         background-repeat: no-repeat;
721         background-color: transparent;
722         background-size: 20px;
723         background-position: calc(100% - 1px) 56%;
724 }
725 .search-container > .top-button {
726         position: absolute;
727         right: 0;
728         top: 10px;
729 }
730 .search-input {
731         /* Override Normalize.css: we have margins and do
732          not want to overflow - the `moz` attribute is necessary
733          until Firefox 29, too early to drop at this point */
734         -moz-box-sizing: border-box !important;
735         box-sizing: border-box !important;
736         outline: none;
737         border: none;
738         border-radius: 1px;
739         margin-top: 5px;
740         padding: 10px 16px;
741         font-size: 17px;
742         transition: border-color 300ms ease;
743         transition: border-radius 300ms ease-in-out;
744         transition: box-shadow 300ms ease-in-out;
745         width: 100%;
746 }
747
748 #crate-search + .search-input {
749         border-radius: 0 1px 1px 0;
750         width: calc(100% - 32px);
751 }
752
753 .search-input:focus {
754         border-radius: 2px;
755         border: 0;
756         outline: 0;
757 }
758
759 .search-results .desc {
760         white-space: nowrap;
761         text-overflow: ellipsis;
762         overflow: hidden;
763         display: block;
764 }
765
766 .search-results a {
767         display: block;
768 }
769
770 .content .search-results td:first-child {
771         padding-right: 0;
772         width: 50%;
773 }
774 .content .search-results td:first-child a {
775         padding-right: 10px;
776 }
777 .content .search-results td:first-child a:after {
778         clear: both;
779         content: "";
780         display: block;
781 }
782 .content .search-results td:first-child a span {
783         float: left;
784 }
785
786 tr.result span.primitive::after {
787         content: ' (primitive type)';
788         font-style: italic;
789 }
790
791 tr.result span.keyword::after {
792         content: ' (keyword)';
793         font-style: italic;
794 }
795
796 body.blur > :not(#help) {
797         filter: blur(8px);
798         -webkit-filter: blur(8px);
799         opacity: .7;
800 }
801
802 #help {
803         width: 100%;
804         height: 100vh;
805         position: fixed;
806         top: 0;
807         left: 0;
808         display: flex;
809         justify-content: center;
810         align-items: center;
811 }
812 #help > div {
813         flex: 0 0 auto;
814         box-shadow: 0 0 6px rgba(0,0,0,.2);
815         width: 550px;
816         height: auto;
817         border: 1px solid;
818 }
819 #help dt {
820         float: left;
821         clear: left;
822         display: block;
823         margin-right: 0.5rem;
824 }
825 #help > div > span {
826         text-align: center;
827         display: block;
828         margin: 10px 0;
829         font-size: 18px;
830         border-bottom: 1px solid #ccc;
831         padding-bottom: 4px;
832         margin-bottom: 6px;
833 }
834 #help dd { margin: 5px 35px; }
835 #help .infos { padding-left: 0; }
836 #help h1, #help h2 { margin-top: 0; }
837 #help > div div {
838         width: 50%;
839         float: left;
840         padding: 0 20px 20px 17px;;
841 }
842
843 .stab {
844         display: table;
845         border-width: 1px;
846         border-style: solid;
847         padding: 3px;
848         margin-bottom: 5px;
849         font-size: 90%;
850 }
851 .stab p {
852         display: inline;
853 }
854
855 .stab summary {
856         display: list-item;
857 }
858
859 .stab .emoji {
860         font-size: 1.5em;
861 }
862
863 /* Black one-pixel outline around emoji shapes */
864 .emoji {
865         text-shadow:
866                 1px 0 0 black,
867                 -1px 0 0 black,
868                 0  1px 0 black,
869                 0 -1px 0 black;
870 }
871
872 .module-item .stab,
873 .import-item .stab {
874         border-radius: 3px;
875         display: inline-block;
876         font-size: 80%;
877         line-height: 1.2;
878         margin-bottom: 0;
879         margin-right: .3em;
880         padding: 2px;
881         vertical-align: text-bottom;
882 }
883
884 .module-item.unstable,
885 .import-item.unstable {
886         opacity: 0.65;
887 }
888
889 .since {
890         font-weight: normal;
891         font-size: initial;
892         position: absolute;
893         right: 0;
894         top: 0;
895 }
896
897 .impl-items .since, .impl .since, .methods .since {
898         flex-grow: 0;
899         padding-left: 12px;
900         padding-right: 2px;
901         position: initial;
902 }
903
904 .impl-items .srclink, .impl .srclink, .methods .srclink {
905         flex-grow: 0;
906         /* Override header settings otherwise it's too bold */
907         font-size: 17px;
908         font-weight: normal;
909 }
910
911 .impl-items code, .impl code, .methods code {
912         flex-grow: 1;
913 }
914
915 .impl-items h4, h4.impl, h3.impl, .methods h3 {
916         display: flex;
917         flex-basis: 100%;
918         font-size: 16px;
919         margin-bottom: 12px;
920         /* Push the src link out to the right edge consistently */
921         justify-content: space-between;
922 }
923
924 .variants_table {
925         width: 100%;
926 }
927
928 .variants_table tbody tr td:first-child {
929         width: 1%; /* make the variant name as small as possible */
930 }
931
932 td.summary-column {
933         width: 100%;
934 }
935
936 .summary {
937         padding-right: 0px;
938 }
939
940 pre.rust .question-mark {
941         font-weight: bold;
942 }
943
944 a.test-arrow {
945         display: inline-block;
946         position: absolute;
947         padding: 5px 10px 5px 10px;
948         border-radius: 5px;
949         font-size: 130%;
950         top: 5px;
951         right: 5px;
952         z-index: 1;
953 }
954 a.test-arrow:hover{
955         text-decoration: none;
956 }
957
958 .section-header:hover a:before {
959         position: absolute;
960         left: -25px;
961         padding-right: 10px; /* avoid gap that causes hover to disappear */
962         content: '\2002\00a7\2002';
963 }
964
965 .section-header:hover a {
966         text-decoration: none;
967 }
968
969 .section-header a {
970         color: inherit;
971 }
972
973 .code-attribute {
974         font-weight: 300;
975 }
976
977 .collapse-toggle {
978         font-weight: 300;
979         position: absolute;
980         left: -23px;
981         top: 0;
982 }
983
984 h3 > .collapse-toggle, h4 > .collapse-toggle {
985         font-size: 0.8em;
986         top: 5px;
987 }
988
989 .toggle-wrapper > .collapse-toggle {
990         left: -24px;
991         margin-top: 0px;
992 }
993
994 .toggle-wrapper {
995         position: relative;
996         margin-top: 0;
997 }
998
999 .toggle-wrapper.collapsed {
1000         height: 25px;
1001         transition: height .2s;
1002         margin-bottom: .6em;
1003 }
1004
1005 .collapse-toggle > .inner {
1006         display: inline-block;
1007         width: 1.2ch;
1008         text-align: center;
1009 }
1010
1011 .collapse-toggle.hidden-default {
1012         position: relative;
1013         margin-left: 20px;
1014 }
1015
1016 .since + .srclink {
1017         display: table-cell;
1018         padding-left: 10px;
1019 }
1020
1021 .item-spacer {
1022         width: 100%;
1023         height: 12px;
1024 }
1025
1026 .out-of-band > span.since {
1027         position: initial;
1028         font-size: 20px;
1029         margin-right: 5px;
1030 }
1031
1032 .toggle-wrapper > .collapse-toggle {
1033         left: 0;
1034 }
1035
1036 .variant + .toggle-wrapper + .docblock > p {
1037         margin-top: 5px;
1038 }
1039
1040 .sub-variant, .sub-variant > h3 {
1041         margin-top: 0px !important;
1042         padding-top: 1px;
1043 }
1044
1045 #main > details > .sub-variant > h3 {
1046         font-size: 15px;
1047         margin-left: 25px;
1048         margin-bottom: 5px;
1049 }
1050
1051 .sub-variant > div {
1052         margin-left: 20px;
1053         margin-bottom: 10px;
1054 }
1055
1056 .sub-variant > div > span {
1057         display: block;
1058         position: relative;
1059 }
1060
1061 .toggle-label {
1062         display: inline-block;
1063         margin-left: 4px;
1064         margin-top: 3px;
1065 }
1066
1067 .docblock > .section-header:first-child {
1068         margin-left: 15px;
1069         margin-top: 0;
1070 }
1071
1072 .docblock > .section-header:first-child:hover > a:before {
1073         left: -10px;
1074 }
1075
1076 #main > .variant, #main > .structfield {
1077         display: block;
1078 }
1079
1080
1081 :target > code {
1082         opacity: 1;
1083 }
1084
1085 .information {
1086         position: absolute;
1087         left: -25px;
1088         margin-top: 7px;
1089         z-index: 1;
1090 }
1091
1092 .tooltip {
1093         position: relative;
1094         display: inline-block;
1095         cursor: pointer;
1096 }
1097
1098 .tooltip::after {
1099         display: none;
1100         text-align: center;
1101         padding: 5px 3px 3px 3px;
1102         border-radius: 6px;
1103         margin-left: 5px;
1104         font-size: 16px;
1105 }
1106
1107 .tooltip.ignore::after {
1108         content: "This example is not tested";
1109 }
1110 .tooltip.compile_fail::after {
1111         content: "This example deliberately fails to compile";
1112 }
1113 .tooltip.should_panic::after {
1114         content: "This example panics";
1115 }
1116 .tooltip.edition::after {
1117         content: "This code runs with edition " attr(data-edition);
1118 }
1119
1120 .tooltip::before {
1121         content: " ";
1122         position: absolute;
1123         top: 50%;
1124         left: 16px;
1125         margin-top: -5px;
1126         border-width: 5px;
1127         border-style: solid;
1128         display: none;
1129 }
1130
1131 .tooltip:hover::before, .tooltip:hover::after {
1132         display: inline;
1133 }
1134
1135 .tooltip.compile_fail, .tooltip.should_panic, .tooltip.ignore {
1136         font-weight: bold;
1137         font-size: 20px;
1138 }
1139
1140 .notable-traits-tooltip {
1141         display: inline-block;
1142         cursor: pointer;
1143 }
1144
1145 .notable-traits:hover .notable-traits-tooltiptext,
1146 .notable-traits .notable-traits-tooltiptext.force-tooltip {
1147         display: inline-block;
1148 }
1149
1150 .notable-traits .notable-traits-tooltiptext {
1151         display: none;
1152         padding: 5px 3px 3px 3px;
1153         border-radius: 6px;
1154         margin-left: 5px;
1155         z-index: 10;
1156         font-size: 16px;
1157         cursor: default;
1158         position: absolute;
1159         border: 1px solid;
1160 }
1161
1162 .notable-traits-tooltip::after {
1163         /* The margin on the tooltip does not capture hover events,
1164            this extends the area of hover enough so that mouse hover is not
1165            lost when moving the mouse to the tooltip */
1166         content: "\00a0\00a0\00a0";
1167 }
1168
1169 .notable-traits .notable, .notable-traits .docblock {
1170         margin: 0;
1171 }
1172
1173 .notable-traits .docblock code.content{
1174         margin: 0;
1175         padding: 0;
1176         font-size: 20px;
1177 }
1178
1179 /* Example code has the "Run" button that needs to be positioned relative to the pre */
1180 pre.rust.rust-example-rendered {
1181         position: relative;
1182 }
1183
1184 pre.rust {
1185         tab-size: 4;
1186         -moz-tab-size: 4;
1187 }
1188
1189 .search-failed {
1190         text-align: center;
1191         margin-top: 20px;
1192 }
1193
1194 .search-failed > ul {
1195         text-align: left;
1196         max-width: 570px;
1197         margin-left: auto;
1198         margin-right: auto;
1199 }
1200
1201 #titles {
1202         height: 35px;
1203 }
1204
1205 #titles > button {
1206         float: left;
1207         width: 33.3%;
1208         text-align: center;
1209         font-size: 18px;
1210         cursor: pointer;
1211         border: 0;
1212         border-top: 2px solid;
1213 }
1214
1215 #titles > button:not(:last-child) {
1216         margin-right: 1px;
1217         width: calc(33.3% - 1px);
1218 }
1219
1220 #titles > button > div.count {
1221         display: inline-block;
1222         font-size: 16px;
1223 }
1224
1225 .notable-traits {
1226         cursor: pointer;
1227         z-index: 2;
1228         margin-left: 5px;
1229 }
1230
1231 h4 > .notable-traits {
1232         position: absolute;
1233         left: -44px;
1234         top: 2px;
1235 }
1236
1237 #all-types {
1238         text-align: center;
1239         border: 1px solid;
1240         margin: 0 10px;
1241         margin-bottom: 10px;
1242         display: block;
1243         border-radius: 7px;
1244 }
1245 #all-types > p {
1246         margin: 5px 0;
1247 }
1248
1249 #sidebar-toggle {
1250         position: fixed;
1251         top: 30px;
1252         left: 300px;
1253         z-index: 10;
1254         padding: 3px;
1255         border-top-right-radius: 3px;
1256         border-bottom-right-radius: 3px;
1257         cursor: pointer;
1258         font-weight: bold;
1259         transition: left .5s;
1260         font-size: 1.2em;
1261         border: 1px solid;
1262         border-left: 0;
1263 }
1264 #source-sidebar {
1265         position: fixed;
1266         top: 0;
1267         bottom: 0;
1268         left: 0;
1269         width: 300px;
1270         z-index: 1;
1271         overflow: auto;
1272         transition: left .5s;
1273         border-right: 1px solid;
1274 }
1275 #source-sidebar > .title {
1276         font-size: 1.5em;
1277         text-align: center;
1278         border-bottom: 1px solid;
1279         margin-bottom: 6px;
1280 }
1281
1282 .theme-picker {
1283         position: absolute;
1284         left: 211px;
1285         top: 19px;
1286 }
1287
1288 .theme-picker button {
1289         outline: none;
1290 }
1291
1292 #settings-menu, #help-button {
1293         position: absolute;
1294         top: 10px;
1295 }
1296
1297 #settings-menu {
1298         right: 0;
1299         outline: none;
1300 }
1301
1302 #theme-picker, #settings-menu, #help-button, #copy-path {
1303         padding: 4px;
1304         width: 27px;
1305         height: 29px;
1306         border: 1px solid;
1307         border-radius: 3px;
1308         cursor: pointer;
1309 }
1310
1311 #help-button {
1312         right: 30px;
1313         font-family: "Fira Sans", Arial, sans-serif;
1314         text-align: center;
1315         font-size: 17px;
1316         padding-top: 2px;
1317 }
1318
1319 #copy-path {
1320         margin-left: 10px;
1321         padding: 0;
1322         padding-left: 2px;
1323 }
1324 #copy-path> img {
1325         margin-bottom: 2px;
1326 }
1327
1328 #theme-choices {
1329         display: none;
1330         position: absolute;
1331         left: 0;
1332         top: 28px;
1333         border: 1px solid;
1334         border-radius: 3px;
1335         z-index: 1;
1336         cursor: pointer;
1337 }
1338
1339 #theme-choices > button {
1340         border: none;
1341         width: 100%;
1342         padding: 4px 8px;
1343         text-align: center;
1344         background: rgba(0,0,0,0);
1345 }
1346
1347 #theme-choices > button:not(:first-child) {
1348         border-top: 1px solid;
1349 }
1350
1351 /* Media Queries */
1352
1353 @media (min-width: 701px) {
1354         /* In case there is no documentation before a code block, we need to add some margin at the top
1355         to prevent an overlay between the "collapse toggle" and the information tooltip.
1356         However, it's not needed with smaller screen width because the doc/code block is always put
1357         "one line" below. */
1358         .docblock > .information:first-child > .tooltip {
1359                 margin-top: 16px;
1360         }
1361 }
1362
1363 @media (max-width: 700px) {
1364         body {
1365                 padding-top: 0px;
1366         }
1367
1368         .rustdoc > .sidebar {
1369                 height: 45px;
1370                 min-height: 40px;
1371                 margin: 0;
1372                 margin-left: -15px;
1373                 padding: 0 15px;
1374                 position: static;
1375                 z-index: 11;
1376         }
1377
1378         .sidebar > .location {
1379                 float: right;
1380                 margin: 0px;
1381                 margin-top: 2px;
1382                 padding: 3px 10px 1px 10px;
1383                 min-height: 39px;
1384                 background: inherit;
1385                 text-align: left;
1386                 font-size: 24px;
1387         }
1388
1389         .sidebar .location:empty {
1390                 padding: 0;
1391         }
1392
1393         .sidebar .logo-container {
1394                 width: 35px;
1395                 height: 35px;
1396                 margin-top: 5px;
1397                 margin-bottom: 5px;
1398                 float: left;
1399                 margin-left: 50px;
1400         }
1401
1402         .sidebar .logo-container > img {
1403                 max-width: 35px;
1404                 max-height: 35px;
1405         }
1406
1407         .sidebar-menu {
1408                 position: fixed;
1409                 z-index: 10;
1410                 font-size: 2rem;
1411                 cursor: pointer;
1412                 width: 45px;
1413                 left: 0;
1414                 text-align: center;
1415                 display: block;
1416                 border-bottom: 1px solid;
1417                 border-right: 1px solid;
1418                 height: 45px;
1419         }
1420
1421         .rustdoc.source > .sidebar > .sidebar-menu {
1422                 display: none;
1423         }
1424
1425         .sidebar-elems {
1426                 position: fixed;
1427                 z-index: 1;
1428                 left: 0;
1429                 top: 45px;
1430                 bottom: 0;
1431                 overflow-y: auto;
1432                 border-right: 1px solid;
1433                 display: none;
1434         }
1435
1436         .sidebar > .block.version {
1437                 border-bottom: none;
1438                 margin-top: 12px;
1439                 margin-bottom: 0;
1440         }
1441
1442         nav.sub {
1443                 width: calc(100% - 32px);
1444                 float: right;
1445         }
1446
1447         .content {
1448                 margin-left: 0px;
1449         }
1450
1451         #main, #search {
1452                 margin-top: 45px;
1453                 padding: 0;
1454         }
1455
1456         .content h4 > .out-of-band {
1457                 position: inherit;
1458         }
1459
1460         .toggle-wrapper > .collapse-toggle {
1461                 left: 0px;
1462         }
1463
1464         .toggle-wrapper {
1465                 height: 1.5em;
1466         }
1467
1468         #search {
1469                 margin-left: 0;
1470         }
1471
1472         .content .impl-items .method, .content .impl-items > .type, .impl-items > .associatedconstant,
1473         .impl-items > .associatedtype {
1474                 display: flex;
1475         }
1476
1477         .anchor {
1478                 display: none !important;
1479         }
1480
1481         .theme-picker {
1482                 left: 10px;
1483                 top: 54px;
1484                 z-index: 1;
1485         }
1486
1487         h4 > .notable-traits {
1488                 position: absolute;
1489                 left: -22px;
1490                 top: 24px;
1491         }
1492
1493         #titles > button > div.count {
1494                 float: left;
1495                 width: 100%;
1496         }
1497
1498         #titles {
1499                 height: 50px;
1500         }
1501
1502         .sidebar.mobile {
1503                 position: fixed;
1504                 width: 100%;
1505                 margin-left: 0;
1506                 background-color: rgba(0,0,0,0);
1507                 height: 100%;
1508         }
1509         /*
1510         This allows to prevent the version text to overflow the sidebar title on mobile mode when the
1511         sidebar is displayed (after clicking on the "hamburger" button).
1512         */
1513         .sidebar.mobile > div.version {
1514                 overflow: hidden;
1515                 max-height: 33px;
1516         }
1517         .sidebar {
1518                 width: calc(100% + 30px);
1519         }
1520
1521         .show-it {
1522                 display: block;
1523                 width: 246px;
1524         }
1525
1526         .show-it > .block.items {
1527                 margin: 8px 0;
1528         }
1529
1530         .show-it > .block.items > ul {
1531                 margin: 0;
1532         }
1533
1534         .show-it > .block.items > ul > li {
1535                 text-align: center;
1536                 margin: 2px 0;
1537         }
1538
1539         .show-it > .block.items > ul > li > a {
1540                 font-size: 21px;
1541         }
1542
1543         /* Because of ios, we need to actually have a full height sidebar title so the
1544          * actual sidebar can show up. But then we need to make it transparent so we don't
1545          * hide content. The filler just allows to create the background for the sidebar
1546          * title. But because of the absolute position, I had to lower the z-index.
1547          */
1548         #sidebar-filler {
1549                 position: fixed;
1550                 left: 45px;
1551                 width: calc(100% - 45px);
1552                 top: 0;
1553                 height: 45px;
1554                 z-index: -1;
1555                 border-bottom: 1px solid;
1556         }
1557
1558         .collapse-toggle {
1559                 left: -20px;
1560         }
1561
1562         .impl > .collapse-toggle {
1563                 left: -10px;
1564         }
1565
1566         .item-list > details.rustdoc-toggle > summary:not(.hideme)::before {
1567                 left: -10px;
1568         }
1569
1570         #all-types {
1571                 margin: 10px;
1572         }
1573
1574         #sidebar-toggle {
1575                 top: 100px;
1576                 width: 30px;
1577                 font-size: 1.5rem;
1578                 text-align: center;
1579                 padding: 0;
1580         }
1581
1582         #source-sidebar {
1583                 z-index: 11;
1584         }
1585
1586         #main > .line-numbers {
1587                 margin-top: 0;
1588         }
1589
1590         .notable-traits .notable-traits-tooltiptext {
1591                 left: 0;
1592                 top: 100%;
1593         }
1594
1595         /* We don't display the help button on mobile devices. */
1596         #help-button {
1597                 display: none;
1598         }
1599         .search-container > div {
1600                 width: calc(100% - 32px);
1601         }
1602 }
1603
1604 @media print {
1605         nav.sub, .content .out-of-band, .collapse-toggle {
1606                 display: none;
1607         }
1608 }
1609
1610 @media (max-width: 464px) {
1611         #titles, #titles > button {
1612                 height: 73px;
1613         }
1614
1615         /* This is to prevent the search bar from being underneath the <section>
1616          * element following it.
1617          */
1618         #main, #search {
1619                 margin-top: 100px;
1620         }
1621
1622         #main > table:not(.table-display) td {
1623                 word-break: break-word;
1624                 width: 50%;
1625         }
1626
1627         .search-container > div {
1628                 display: block;
1629                 width: calc(100% - 37px);
1630         }
1631
1632         #crate-search {
1633                 width: 100%;
1634                 border-radius: 4px;
1635                 border: 0;
1636         }
1637
1638         #crate-search + .search-input {
1639                 width: calc(100% + 71px);
1640                 margin-left: -36px;
1641         }
1642
1643         #theme-picker, #settings-menu {
1644                 padding: 5px;
1645                 width: 31px;
1646                 height: 31px;
1647         }
1648
1649         #theme-picker {
1650                 margin-top: -2px;
1651         }
1652
1653         #settings-menu {
1654                 top: 7px;
1655         }
1656
1657         .docblock {
1658                 margin-left: 12px;
1659         }
1660 }
1661
1662 h3.notable {
1663         margin: 0;
1664         margin-bottom: 13px;
1665         font-size: 19px;
1666 }
1667
1668 kbd {
1669         display: inline-block;
1670         padding: 3px 5px;
1671         font: 15px monospace;
1672         line-height: 10px;
1673         vertical-align: middle;
1674         border: solid 1px;
1675         border-radius: 3px;
1676         box-shadow: inset 0 -1px 0;
1677         cursor: default;
1678 }
1679
1680 .hidden-by-impl-hider,
1681 .hidden-by-usual-hider {
1682         /* important because of conflicting rule for small screens */
1683         display: none !important;
1684 }
1685
1686 #implementations-list > h3 > span.in-band {
1687         width: 100%;
1688 }
1689
1690 .table-display {
1691         width: 100%;
1692         border: 0;
1693         border-collapse: collapse;
1694         border-spacing: 0;
1695         font-size: 16px;
1696 }
1697
1698 .table-display tr td:first-child {
1699         padding-right: 0;
1700 }
1701
1702 .table-display tr td:last-child {
1703         float: right;
1704 }
1705 .table-display .out-of-band {
1706         position: relative;
1707         font-size: 19px;
1708         display: block;
1709 }
1710 #implementors-list > .impl-items .table-display .out-of-band {
1711         font-size: 17px;
1712 }
1713
1714 .table-display td:hover .anchor {
1715         display: block;
1716         top: 2px;
1717         left: -5px;
1718 }
1719
1720 #main > ul {
1721         padding-left: 10px;
1722 }
1723 #main > ul > li {
1724         list-style: none;
1725 }
1726
1727 .non-exhaustive {
1728         margin-bottom: 1em;
1729 }
1730
1731 div.children {
1732         padding-left: 27px;
1733         display: none;
1734 }
1735 div.name {
1736         cursor: pointer;
1737         position: relative;
1738         margin-left: 16px;
1739 }
1740 div.files > a {
1741         display: block;
1742         padding: 0 3px;
1743 }
1744 div.files > a:hover, div.name:hover {
1745         background-color: #a14b4b;
1746 }
1747 div.name.expand + .children {
1748         display: block;
1749 }
1750 div.name::before {
1751         content: "\25B6";
1752         padding-left: 4px;
1753         font-size: 0.7em;
1754         position: absolute;
1755         left: -16px;
1756         top: 4px;
1757 }
1758 div.name.expand::before {
1759         transform: rotate(90deg);
1760         left: -15px;
1761         top: 2px;
1762 }
1763
1764 /* The hideme class is used on summary tags that contain a span with
1765         placeholder text shown only when the toggle is closed. For instance,
1766         "Expand description" or "Show methods". */
1767 details.rustdoc-toggle > summary.hideme {
1768         cursor: pointer;
1769 }
1770
1771 details.rustdoc-toggle > summary::-webkit-details-marker,
1772 details.rustdoc-toggle > summary::marker,
1773 details.undocumented > summary::-webkit-details-marker,
1774 details.undocumented > summary::marker {
1775         display: none;
1776 }
1777
1778 details.rustdoc-toggle > summary.hideme > span {
1779         margin-left: 9px;
1780 }
1781
1782 details.rustdoc-toggle > summary::before {
1783         content: "[+]";
1784         font-weight: 300;
1785         font-size: 0.8em;
1786         letter-spacing: 1px;
1787         cursor: pointer;
1788 }
1789
1790 details.rustdoc-toggle.top-doc > summary,
1791 details.rustdoc-toggle.top-doc > summary::before,
1792 details.rustdoc-toggle.non-exhaustive > summary,
1793 details.rustdoc-toggle.non-exhaustive > summary::before {
1794         font-family: 'Fira Sans';
1795         font-size: 16px;
1796 }
1797
1798 details.non-exhaustive {
1799         margin-bottom: 8px;
1800 }
1801
1802 details.rustdoc-toggle > summary.hideme::before {
1803         position: relative;
1804 }
1805
1806 details.rustdoc-toggle > summary:not(.hideme)::before {
1807         position: absolute;
1808         left: -23px;
1809         top: initial;
1810 }
1811
1812 .impl-items > details.rustdoc-toggle > summary:not(.hideme)::before,
1813 .undocumented > details.rustdoc-toggle > summary:not(.hideme)::before {
1814         position: absolute;
1815         top: 3px;
1816         left: -2px;
1817 }
1818
1819 /* When a "hideme" summary is open and the "Expand description" or "Show
1820         methods" text is hidden, we want the [-] toggle that remains to not
1821         affect the layout of the items to its right. To do that, we use
1822         absolute positioning. Note that we also set position: relative
1823         on the parent <details> to make this work properly. */
1824 details.rustdoc-toggle[open] > summary.hideme {
1825         position: absolute;
1826 }
1827
1828 details.rustdoc-toggle, details.undocumented {
1829         position: relative;
1830 }
1831
1832 details.rustdoc-toggle[open] > summary.hideme > span {
1833         display: none;
1834 }
1835
1836 details.rustdoc-toggle[open] > summary::before {
1837         content: "[−]";
1838         display: inline;
1839 }
1840
1841 details.undocumented > summary::before {
1842         content: "[+] Show hidden undocumented items";
1843         cursor: pointer;
1844         font-size: 16px;
1845         font-weight: 300;
1846 }
1847
1848 details.undocumented[open] > summary::before {
1849         content: "[-] Hide undocumented items";
1850 }