]> git.lizzy.rs Git - rust.git/blob - src/librustdoc/html/static/css/rustdoc.css
Fix item info display
[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 .item-info .stab {
925         display: table;
926 }
927 .stab {
928         border-width: 1px;
929         border-style: solid;
930         padding: 3px;
931         margin-bottom: 5px;
932         font-size: 90%;
933         font-weight: normal;
934 }
935 .stab p {
936         display: inline;
937 }
938
939 .stab .emoji {
940         font-size: 1.5em;
941 }
942
943 /* Black one-pixel outline around emoji shapes */
944 .emoji {
945         text-shadow:
946                 1px 0 0 black,
947                 -1px 0 0 black,
948                 0  1px 0 black,
949                 0 -1px 0 black;
950 }
951
952 .module-item .stab,
953 .import-item .stab {
954         border-radius: 3px;
955         display: inline-block;
956         font-size: 80%;
957         line-height: 1.2;
958         margin-bottom: 0;
959         margin-left: .3em;
960         padding: 2px;
961         vertical-align: text-bottom;
962 }
963
964 .module-item.unstable,
965 .import-item.unstable {
966         opacity: 0.65;
967 }
968
969 .since {
970         font-weight: normal;
971         font-size: initial;
972 }
973
974 .impl-items .since, .impl .since, .methods .since {
975         padding-left: 12px;
976         padding-right: 2px;
977         position: initial;
978 }
979
980 .impl-items .srclink, .impl .srclink, .methods .srclink {
981         /* Override header settings otherwise it's too bold */
982         font-size: 17px;
983         font-weight: normal;
984 }
985
986 .rightside {
987         float: right;
988 }
989
990 .has-srclink {
991         font-size: 16px;
992         margin-bottom: 12px;
993         /* Push the src link out to the right edge consistently */
994         justify-content: space-between;
995 }
996
997 .variants_table {
998         width: 100%;
999 }
1000
1001 .variants_table tbody tr td:first-child {
1002         width: 1%; /* make the variant name as small as possible */
1003 }
1004
1005 td.summary-column {
1006         width: 100%;
1007 }
1008
1009 .summary {
1010         padding-right: 0px;
1011 }
1012
1013 pre.rust .question-mark {
1014         font-weight: bold;
1015 }
1016
1017 a.test-arrow {
1018         display: inline-block;
1019         position: absolute;
1020         padding: 5px 10px 5px 10px;
1021         border-radius: 5px;
1022         font-size: 130%;
1023         top: 5px;
1024         right: 5px;
1025         z-index: 1;
1026 }
1027 a.test-arrow:hover{
1028         text-decoration: none;
1029 }
1030
1031 .section-header:hover a:before {
1032         position: absolute;
1033         left: -25px;
1034         padding-right: 10px; /* avoid gap that causes hover to disappear */
1035         content: '\2002\00a7\2002';
1036 }
1037
1038 .section-header:hover a {
1039         text-decoration: none;
1040 }
1041
1042 .section-header a {
1043         color: inherit;
1044 }
1045
1046 .code-attribute {
1047         font-weight: 300;
1048 }
1049
1050 .since + .srclink {
1051         padding-left: 10px;
1052 }
1053
1054 .item-spacer {
1055         width: 100%;
1056         height: 12px;
1057 }
1058
1059 .out-of-band > span.since {
1060         position: initial;
1061         font-size: 20px;
1062         margin-right: 5px;
1063 }
1064
1065 .sub-variant, .sub-variant > h3 {
1066         margin-top: 0px !important;
1067         padding-top: 1px;
1068 }
1069
1070 #main > details > .sub-variant > h3 {
1071         font-size: 15px;
1072         margin-left: 25px;
1073         margin-bottom: 5px;
1074 }
1075
1076 .sub-variant > div {
1077         margin-left: 20px;
1078         margin-bottom: 10px;
1079 }
1080
1081 .sub-variant > div > span {
1082         display: block;
1083         position: relative;
1084 }
1085
1086 .toggle-label {
1087         display: inline-block;
1088         margin-left: 4px;
1089         margin-top: 3px;
1090 }
1091
1092 .docblock > .section-header:first-child {
1093         margin-left: 15px;
1094         margin-top: 0;
1095 }
1096
1097 .docblock > .section-header:first-child:hover > a:before {
1098         left: -10px;
1099 }
1100
1101 :target > code {
1102         opacity: 1;
1103 }
1104
1105 :target {
1106         padding-right: 3px;
1107 }
1108
1109 .information {
1110         position: absolute;
1111         left: -25px;
1112         margin-top: 7px;
1113         z-index: 1;
1114 }
1115
1116 .tooltip {
1117         position: relative;
1118         display: inline-block;
1119         cursor: pointer;
1120 }
1121
1122 .tooltip::after {
1123         display: none;
1124         text-align: center;
1125         padding: 5px 3px 3px 3px;
1126         border-radius: 6px;
1127         margin-left: 5px;
1128         font-size: 16px;
1129 }
1130
1131 .tooltip.ignore::after {
1132         content: "This example is not tested";
1133 }
1134 .tooltip.compile_fail::after {
1135         content: "This example deliberately fails to compile";
1136 }
1137 .tooltip.should_panic::after {
1138         content: "This example panics";
1139 }
1140 .tooltip.edition::after {
1141         content: "This code runs with edition " attr(data-edition);
1142 }
1143
1144 .tooltip::before {
1145         content: " ";
1146         position: absolute;
1147         top: 50%;
1148         left: 16px;
1149         margin-top: -5px;
1150         border-width: 5px;
1151         border-style: solid;
1152         display: none;
1153 }
1154
1155 .tooltip:hover::before, .tooltip:hover::after {
1156         display: inline;
1157 }
1158
1159 .tooltip.compile_fail, .tooltip.should_panic, .tooltip.ignore {
1160         font-weight: bold;
1161         font-size: 20px;
1162 }
1163
1164 .notable-traits-tooltip {
1165         display: inline-block;
1166         cursor: pointer;
1167 }
1168
1169 .notable-traits:hover .notable-traits-tooltiptext,
1170 .notable-traits .notable-traits-tooltiptext.force-tooltip {
1171         display: inline-block;
1172 }
1173
1174 .notable-traits .notable-traits-tooltiptext {
1175         display: none;
1176         padding: 5px 3px 3px 3px;
1177         border-radius: 6px;
1178         margin-left: 5px;
1179         z-index: 10;
1180         font-size: 16px;
1181         cursor: default;
1182         position: absolute;
1183         border: 1px solid;
1184 }
1185
1186 .notable-traits-tooltip::after {
1187         /* The margin on the tooltip does not capture hover events,
1188            this extends the area of hover enough so that mouse hover is not
1189            lost when moving the mouse to the tooltip */
1190         content: "\00a0\00a0\00a0";
1191 }
1192
1193 .notable-traits .notable, .notable-traits .docblock {
1194         margin: 0;
1195 }
1196
1197 .notable-traits .notable {
1198         margin: 0;
1199         margin-bottom: 13px;
1200         font-size: 19px;
1201         font-weight: 600;
1202 }
1203
1204 .notable-traits .docblock code.content{
1205         margin: 0;
1206         padding: 0;
1207         font-size: 20px;
1208 }
1209
1210 /* Example code has the "Run" button that needs to be positioned relative to the pre */
1211 pre.rust.rust-example-rendered {
1212         position: relative;
1213 }
1214
1215 pre.rust {
1216         tab-size: 4;
1217         -moz-tab-size: 4;
1218 }
1219
1220 .search-failed {
1221         text-align: center;
1222         margin-top: 20px;
1223         display: none;
1224 }
1225
1226 .search-failed.active {
1227         display: block;
1228 }
1229
1230 .search-failed > ul {
1231         text-align: left;
1232         max-width: 570px;
1233         margin-left: auto;
1234         margin-right: auto;
1235 }
1236
1237 #titles {
1238         height: 35px;
1239 }
1240
1241 #titles > button {
1242         float: left;
1243         width: 33.3%;
1244         text-align: center;
1245         font-size: 18px;
1246         cursor: pointer;
1247         border: 0;
1248         border-top: 2px solid;
1249 }
1250
1251 #titles > button:not(:last-child) {
1252         margin-right: 1px;
1253         width: calc(33.3% - 1px);
1254 }
1255
1256 #titles > button > div.count {
1257         display: inline-block;
1258         font-size: 16px;
1259 }
1260
1261 .notable-traits {
1262         cursor: pointer;
1263         z-index: 2;
1264         margin-left: 5px;
1265 }
1266
1267 #all-types {
1268         text-align: center;
1269         border: 1px solid;
1270         margin: 0 10px;
1271         margin-bottom: 10px;
1272         display: block;
1273         border-radius: 7px;
1274 }
1275 #all-types > p {
1276         margin: 5px 0;
1277 }
1278
1279 #sidebar-toggle {
1280         position: fixed;
1281         top: 30px;
1282         left: 300px;
1283         z-index: 10;
1284         padding: 3px;
1285         border-top-right-radius: 3px;
1286         border-bottom-right-radius: 3px;
1287         cursor: pointer;
1288         font-weight: bold;
1289         transition: left .5s;
1290         font-size: 1.2em;
1291         border: 1px solid;
1292         border-left: 0;
1293 }
1294 #source-sidebar {
1295         position: fixed;
1296         top: 0;
1297         bottom: 0;
1298         left: 0;
1299         width: 300px;
1300         z-index: 1;
1301         overflow: auto;
1302         transition: left .5s;
1303         border-right: 1px solid;
1304 }
1305 #source-sidebar > .title {
1306         font-size: 1.5em;
1307         text-align: center;
1308         border-bottom: 1px solid;
1309         margin-bottom: 6px;
1310 }
1311
1312 .theme-picker {
1313         position: absolute;
1314         left: 211px;
1315         top: 19px;
1316 }
1317
1318 .theme-picker button {
1319         outline: none;
1320 }
1321
1322 #settings-menu, #help-button {
1323         position: absolute;
1324         top: 10px;
1325 }
1326
1327 #settings-menu {
1328         right: 0;
1329         outline: none;
1330 }
1331
1332 #theme-picker, #settings-menu, #help-button, #copy-path {
1333         padding: 4px;
1334         width: 27px;
1335         height: 29px;
1336         border: 1px solid;
1337         border-radius: 3px;
1338         cursor: pointer;
1339 }
1340
1341 #help-button {
1342         right: 30px;
1343         font-family: "Fira Sans", Arial, sans-serif;
1344         text-align: center;
1345         font-size: 17px;
1346         padding-top: 2px;
1347 }
1348
1349 #copy-path {
1350         background: initial;
1351         margin-left: 10px;
1352         padding: 0;
1353         padding-left: 2px;
1354         border: 0;
1355 }
1356
1357 #theme-choices {
1358         display: none;
1359         position: absolute;
1360         left: 0;
1361         top: 28px;
1362         border: 1px solid;
1363         border-radius: 3px;
1364         z-index: 1;
1365         cursor: pointer;
1366 }
1367
1368 #theme-choices > button {
1369         border: none;
1370         width: 100%;
1371         padding: 4px 8px;
1372         text-align: center;
1373         background: rgba(0,0,0,0);
1374 }
1375
1376 #theme-choices > button:not(:first-child) {
1377         border-top: 1px solid;
1378 }
1379
1380 kbd {
1381         display: inline-block;
1382         padding: 3px 5px;
1383         font: 15px monospace;
1384         line-height: 10px;
1385         vertical-align: middle;
1386         border: solid 1px;
1387         border-radius: 3px;
1388         box-shadow: inset 0 -1px 0;
1389         cursor: default;
1390 }
1391
1392 .hidden-by-impl-hider,
1393 .hidden-by-usual-hider {
1394         /* important because of conflicting rule for small screens */
1395         display: none !important;
1396 }
1397
1398 #implementations-list > h3 > span.in-band {
1399         width: 100%;
1400 }
1401
1402 .table-display {
1403         width: 100%;
1404         border: 0;
1405         border-collapse: collapse;
1406         border-spacing: 0;
1407         font-size: 16px;
1408 }
1409
1410 .table-display tr td:first-child {
1411         padding-right: 0;
1412 }
1413
1414 .table-display tr td:last-child {
1415         float: right;
1416 }
1417 .table-display .out-of-band {
1418         position: relative;
1419         font-size: 19px;
1420         display: block;
1421 }
1422 #implementors-list > .impl-items .table-display .out-of-band {
1423         font-size: 17px;
1424 }
1425
1426 .table-display td:hover .anchor {
1427         display: block;
1428         top: 2px;
1429         left: -5px;
1430 }
1431
1432 #main > ul {
1433         padding-left: 10px;
1434 }
1435 #main > ul > li {
1436         list-style: none;
1437 }
1438
1439 .non-exhaustive {
1440         margin-bottom: 1em;
1441 }
1442
1443 div.children {
1444         padding-left: 27px;
1445         display: none;
1446 }
1447 div.name {
1448         cursor: pointer;
1449         position: relative;
1450         margin-left: 16px;
1451 }
1452 div.files > a {
1453         display: block;
1454         padding: 0 3px;
1455 }
1456 div.files > a:hover, div.name:hover {
1457         background-color: #a14b4b;
1458 }
1459 div.name.expand + .children {
1460         display: block;
1461 }
1462 div.name::before {
1463         content: "\25B6";
1464         padding-left: 4px;
1465         font-size: 0.7em;
1466         position: absolute;
1467         left: -16px;
1468         top: 4px;
1469 }
1470 div.name.expand::before {
1471         transform: rotate(90deg);
1472         left: -15px;
1473         top: 2px;
1474 }
1475
1476 /* The hideme class is used on summary tags that contain a span with
1477         placeholder text shown only when the toggle is closed. For instance,
1478         "Expand description" or "Show methods". */
1479 details.rustdoc-toggle > summary.hideme {
1480         cursor: pointer;
1481 }
1482
1483 details.rustdoc-toggle > summary, details.undocumented > summary {
1484         list-style: none;
1485 }
1486 details.rustdoc-toggle > summary::-webkit-details-marker,
1487 details.rustdoc-toggle > summary::marker,
1488 details.undocumented > summary::-webkit-details-marker,
1489 details.undocumented > summary::marker {
1490         display: none;
1491 }
1492
1493 details.rustdoc-toggle > summary.hideme > span {
1494         margin-left: 9px;
1495 }
1496
1497 details.rustdoc-toggle > summary::before {
1498         content: "[+]";
1499         font-weight: 300;
1500         font-size: 0.8em;
1501         letter-spacing: 1px;
1502         cursor: pointer;
1503 }
1504
1505 details.rustdoc-toggle.top-doc > summary,
1506 details.rustdoc-toggle.top-doc > summary::before,
1507 details.rustdoc-toggle.non-exhaustive > summary,
1508 details.rustdoc-toggle.non-exhaustive > summary::before {
1509         font-family: 'Fira Sans';
1510         font-size: 16px;
1511 }
1512
1513 details.non-exhaustive {
1514         margin-bottom: 8px;
1515 }
1516
1517 details.rustdoc-toggle > summary.hideme::before {
1518         position: relative;
1519 }
1520
1521 details.rustdoc-toggle > summary:not(.hideme)::before {
1522         position: absolute;
1523         left: -23px;
1524         top: 3px;
1525 }
1526
1527 .impl-items > details.rustdoc-toggle > summary:not(.hideme)::before,
1528 .undocumented > details.rustdoc-toggle > summary:not(.hideme)::before {
1529         position: absolute;
1530         left: -2px;
1531 }
1532
1533 /* When a "hideme" summary is open and the "Expand description" or "Show
1534         methods" text is hidden, we want the [-] toggle that remains to not
1535         affect the layout of the items to its right. To do that, we use
1536         absolute positioning. Note that we also set position: relative
1537         on the parent <details> to make this work properly. */
1538 details.rustdoc-toggle[open] > summary.hideme {
1539         position: absolute;
1540 }
1541
1542 details.rustdoc-toggle, details.undocumented {
1543         position: relative;
1544 }
1545
1546 details.rustdoc-toggle[open] > summary.hideme > span {
1547         display: none;
1548 }
1549
1550 details.rustdoc-toggle[open] > summary::before {
1551         content: "[−]";
1552         display: inline;
1553 }
1554
1555 details.undocumented > summary::before {
1556         content: "[+] Show hidden undocumented items";
1557         cursor: pointer;
1558         font-size: 16px;
1559         font-weight: 300;
1560 }
1561
1562 details.undocumented[open] > summary::before {
1563         content: "[−] Hide undocumented items";
1564 }
1565
1566 /* Media Queries */
1567
1568 @media (min-width: 701px) {
1569         /* In case there is no documentation before a code block, we need to add some margin at the top
1570         to prevent an overlay between the "collapse toggle" and the information tooltip.
1571         However, it's not needed with smaller screen width because the doc/code block is always put
1572         "one line" below. */
1573         .docblock > .information:first-child > .tooltip {
1574                 margin-top: 16px;
1575         }
1576 }
1577
1578 @media (max-width: 700px) {
1579         body {
1580                 padding-top: 0px;
1581         }
1582
1583         .rustdoc > .sidebar {
1584                 height: 45px;
1585                 min-height: 40px;
1586                 margin: 0;
1587                 margin-left: -15px;
1588                 padding: 0 15px;
1589                 position: static;
1590                 z-index: 11;
1591         }
1592
1593         .sidebar > .location {
1594                 float: right;
1595                 margin: 0px;
1596                 margin-top: 2px;
1597                 padding: 3px 10px 1px 10px;
1598                 min-height: 39px;
1599                 background: inherit;
1600                 text-align: left;
1601                 font-size: 24px;
1602         }
1603
1604         .sidebar .location:empty {
1605                 padding: 0;
1606         }
1607
1608         .sidebar .logo-container {
1609                 width: 35px;
1610                 height: 35px;
1611                 margin-top: 5px;
1612                 margin-bottom: 5px;
1613                 float: left;
1614                 margin-left: 50px;
1615         }
1616
1617         .sidebar .logo-container > img {
1618                 max-width: 35px;
1619                 max-height: 35px;
1620         }
1621
1622         .sidebar-menu {
1623                 position: fixed;
1624                 z-index: 10;
1625                 font-size: 2rem;
1626                 cursor: pointer;
1627                 width: 45px;
1628                 left: 0;
1629                 text-align: center;
1630                 display: block;
1631                 border-bottom: 1px solid;
1632                 border-right: 1px solid;
1633                 height: 45px;
1634         }
1635
1636         .rustdoc.source > .sidebar > .sidebar-menu {
1637                 display: none;
1638         }
1639
1640         /* We do NOT hide this element so that alternative device readers still have this information
1641            available. */
1642         .sidebar-elems {
1643                 position: fixed;
1644                 z-index: 1;
1645                 top: 45px;
1646                 bottom: 0;
1647                 width: 246px;
1648                 /* We move the sidebar to the left by its own width so it doesn't appear. */
1649                 left: -246px;
1650                 overflow-y: auto;
1651                 border-right: 1px solid;
1652         }
1653
1654         .sidebar > .block.version {
1655                 overflow: hidden;
1656                 border-bottom: none;
1657                 margin-bottom: 0;
1658                 height: 100%;
1659                 padding-left: 12px;
1660         }
1661         .sidebar > .block.version > div.narrow-helper {
1662                 float: left;
1663                 width: 1px;
1664                 height: 100%;
1665         }
1666         .sidebar > .block.version > p {
1667                 /* hide Version text if too narrow */
1668                 margin: 0;
1669                 min-width: 55px;
1670                 /* vertically center */
1671                 display: flex;
1672                 align-items: center;
1673                 height: 100%;
1674         }
1675
1676         nav.sub {
1677                 width: calc(100% - 32px);
1678                 float: right;
1679         }
1680
1681         .content {
1682                 margin-left: 0px;
1683         }
1684
1685         #main, #search {
1686                 margin-top: 45px;
1687                 padding: 0;
1688         }
1689
1690         #search {
1691                 margin-left: 0;
1692         }
1693
1694         .anchor {
1695                 display: none !important;
1696         }
1697
1698         .theme-picker {
1699                 left: 10px;
1700                 top: 54px;
1701                 z-index: 1;
1702         }
1703
1704         .notable-traits {
1705                 position: absolute;
1706                 left: -22px;
1707                 top: 24px;
1708         }
1709
1710         #titles > button > div.count {
1711                 float: left;
1712                 width: 100%;
1713         }
1714
1715         #titles {
1716                 height: 50px;
1717         }
1718
1719         .sidebar.mobile {
1720                 position: fixed;
1721                 width: 100%;
1722                 margin-left: 0;
1723                 background-color: rgba(0,0,0,0);
1724                 height: 100%;
1725         }
1726         /*
1727         This allows to prevent the version text to overflow the sidebar title on mobile mode when the
1728         sidebar is displayed (after clicking on the "hamburger" button).
1729         */
1730         .sidebar.mobile > div.version {
1731                 overflow: hidden;
1732                 max-height: 33px;
1733         }
1734         .sidebar {
1735                 width: calc(100% + 30px);
1736         }
1737
1738         .show-it, .sidebar-elems:focus-within {
1739                 z-index:  2;
1740                 left: 0;
1741         }
1742
1743         .show-it > .block.items {
1744                 margin: 8px 0;
1745         }
1746
1747         .show-it > .block.items > ul {
1748                 margin: 0;
1749         }
1750
1751         .show-it > .block.items > ul > li {
1752                 text-align: center;
1753                 margin: 2px 0;
1754         }
1755
1756         .show-it > .block.items > ul > li > a {
1757                 font-size: 21px;
1758         }
1759
1760         /* Because of ios, we need to actually have a full height sidebar title so the
1761          * actual sidebar can show up. But then we need to make it transparent so we don't
1762          * hide content. The filler just allows to create the background for the sidebar
1763          * title. But because of the absolute position, I had to lower the z-index.
1764          */
1765         #sidebar-filler {
1766                 position: fixed;
1767                 left: 45px;
1768                 width: calc(100% - 45px);
1769                 top: 0;
1770                 height: 45px;
1771                 z-index: -1;
1772                 border-bottom: 1px solid;
1773         }
1774
1775         #main > details.rustdoc-toggle > summary::before,
1776         #main > div > details.rustdoc-toggle > summary::before {
1777                 left: -11px;
1778         }
1779
1780         #all-types {
1781                 margin: 10px;
1782         }
1783
1784         #sidebar-toggle {
1785                 top: 100px;
1786                 width: 30px;
1787                 font-size: 1.5rem;
1788                 text-align: center;
1789                 padding: 0;
1790         }
1791
1792         #source-sidebar {
1793                 z-index: 11;
1794         }
1795
1796         #main > .line-numbers {
1797                 margin-top: 0;
1798         }
1799
1800         .notable-traits .notable-traits-tooltiptext {
1801                 left: 0;
1802                 top: 100%;
1803         }
1804
1805         /* We don't display the help button on mobile devices. */
1806         #help-button {
1807                 display: none;
1808         }
1809
1810         /* Display an alternating layout on tablets and phones */
1811         .item-table {
1812                 display: flex;
1813                 flex-flow: column wrap;
1814         }
1815         .item-left, .item-right {
1816                 width: 100%;
1817         }
1818
1819         .search-container > div {
1820                 width: calc(100% - 32px);
1821         }
1822
1823         /* Display an alternating layout on tablets and phones */
1824         .search-results > a {
1825                 border-bottom: 1px solid #aaa9;
1826                 padding: 5px 0px;
1827         }
1828         .search-results .result-name, .search-results div.desc, .search-results .result-description {
1829                 width: 100%;
1830         }
1831         .search-results div.desc, .search-results .result-description, .item-right {
1832                 padding-left: 2em;
1833         }
1834 }
1835
1836 @media print {
1837         nav.sub, .content .out-of-band {
1838                 display: none;
1839         }
1840 }
1841
1842 @media (max-width: 464px) {
1843         #titles, #titles > button {
1844                 height: 73px;
1845         }
1846
1847         /* This is to prevent the search bar from being underneath the <section>
1848          * element following it.
1849          */
1850         #main, #search {
1851                 margin-top: 100px;
1852         }
1853
1854         #main > table:not(.table-display) td {
1855                 word-break: break-word;
1856                 width: 50%;
1857         }
1858
1859         .search-container > div {
1860                 display: block;
1861                 width: calc(100% - 37px);
1862         }
1863
1864         #crate-search {
1865                 width: 100%;
1866                 border-radius: 4px;
1867                 border: 0;
1868         }
1869
1870         #crate-search + .search-input {
1871                 width: calc(100% + 71px);
1872                 margin-left: -36px;
1873         }
1874
1875         #theme-picker, #settings-menu {
1876                 padding: 5px;
1877                 width: 31px;
1878                 height: 31px;
1879         }
1880
1881         #theme-picker {
1882                 margin-top: -2px;
1883         }
1884
1885         #settings-menu {
1886                 top: 7px;
1887         }
1888
1889         .docblock {
1890                 margin-left: 12px;
1891         }
1892 }