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