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