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