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