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