]> git.lizzy.rs Git - rust.git/blob - src/librustdoc/html/static/rustdoc.css
Rollup merge of #44562 - eddyb:ugh-rustdoc, r=nikomatsakis
[rust.git] / src / librustdoc / html / static / rustdoc.css
1 /**
2  * Copyright 2013 The Rust Project Developers. See the COPYRIGHT
3  * file at the top-level directory of this distribution and at
4  * http://rust-lang.org/COPYRIGHT.
5  *
6  * Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
7  * http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
8  * <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
9  * option. This file may not be copied, modified, or distributed
10  * except according to those terms.
11  */
12
13 /* See FiraSans-LICENSE.txt for the Fira Sans license. */
14 @font-face {
15         font-family: 'Fira Sans';
16         font-style: normal;
17         font-weight: 400;
18         src: local('Fira Sans'), url("FiraSans-Regular.woff") format('woff');
19 }
20 @font-face {
21         font-family: 'Fira Sans';
22         font-style: normal;
23         font-weight: 500;
24         src: local('Fira Sans Medium'), url("FiraSans-Medium.woff") format('woff');
25 }
26
27 /* See SourceSerifPro-LICENSE.txt for the Source Serif Pro license and
28  * Heuristica-LICENSE.txt for the Heuristica license. */
29 @font-face {
30         font-family: 'Source Serif Pro';
31         font-style: normal;
32         font-weight: 400;
33         src: local('Source Serif Pro'), url("SourceSerifPro-Regular.woff") format('woff');
34 }
35 @font-face {
36         font-family: 'Source Serif Pro';
37         font-style: italic;
38         font-weight: 400;
39         src: url("Heuristica-Italic.woff") format('woff');
40 }
41 @font-face {
42         font-family: 'Source Serif Pro';
43         font-style: normal;
44         font-weight: 700;
45         src: local('Source Serif Pro Bold'), url("SourceSerifPro-Bold.woff") format('woff');
46 }
47
48 /* See SourceCodePro-LICENSE.txt for the Source Code Pro license. */
49 @font-face {
50         font-family: 'Source Code Pro';
51         font-style: normal;
52         font-weight: 400;
53         /* Avoid using locally installed font because bad versions are in circulation:
54          * see https://github.com/rust-lang/rust/issues/24355 */
55         src: url("SourceCodePro-Regular.woff") format('woff');
56 }
57 @font-face {
58         font-family: 'Source Code Pro';
59         font-style: normal;
60         font-weight: 600;
61         src: url("SourceCodePro-Semibold.woff") format('woff');
62 }
63
64 * {
65   -webkit-box-sizing: border-box;
66          -moz-box-sizing: border-box;
67                   box-sizing: border-box;
68 }
69
70 /* General structure and fonts */
71
72 body {
73         font: 16px/1.4 "Source Serif Pro", Georgia, Times, "Times New Roman", serif;
74         margin: 0;
75         position: relative;
76         padding: 10px 15px 20px 15px;
77
78         -webkit-font-feature-settings: "kern", "liga";
79         -moz-font-feature-settings: "kern", "liga";
80         font-feature-settings: "kern", "liga";
81 }
82
83 h1 {
84         font-size: 1.5em;
85 }
86 h2 {
87         font-size: 1.4em;
88 }
89 h3 {
90         font-size: 1.3em;
91 }
92 h1, h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod):not(.associatedconstant) {
93         font-weight: 500;
94         margin: 20px 0 15px 0;
95         padding-bottom: 6px;
96 }
97 h1.fqn {
98         border-bottom: 1px dashed;
99         margin-top: 0;
100         position: relative;
101 }
102 h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod):not(.associatedconstant) {
103         border-bottom: 1px solid;
104 }
105 h3.impl, h3.method, h4.method, h3.type, h4.type, h4.associatedconstant {
106         font-weight: 600;
107         margin-top: 10px;
108         margin-bottom: 10px;
109         position: relative;
110 }
111 h3.impl, h3.method, h3.type {
112         margin-top: 15px;
113 }
114 h1, h2, h3, h4, .sidebar, a.source, .search-input, .content table :not(code)>a, .collapse-toggle {
115         font-family: "Fira Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
116 }
117
118 ol, ul {
119         padding-left: 25px;
120 }
121 ul ul, ol ul, ul ol, ol ol {
122         margin-bottom: 0;
123 }
124
125 p {
126         margin: 0 0 .6em 0;
127 }
128
129 summary {
130         outline: none;
131 }
132
133 code, pre {
134         font-family: "Source Code Pro", Menlo, Monaco, Consolas, "DejaVu Sans Mono", Inconsolata, monospace;
135         white-space: pre-wrap;
136 }
137 .docblock code, .docblock-short code {
138         border-radius: 3px;
139         padding: 0 0.2em;
140 }
141 .docblock pre code, .docblock-short pre code {
142         padding: 0;
143 }
144 pre {
145         padding: 14px;
146 }
147
148 .source .content pre {
149         padding: 20px;
150 }
151
152 img {
153         max-width: 100%;
154 }
155
156 .source .content {
157         margin-top: 50px;
158         max-width: none;
159         overflow: visible;
160         margin-left: 0px;
161         min-width: 70em;
162 }
163
164 nav.sub {
165         font-size: 16px;
166         text-transform: uppercase;
167 }
168
169 .sidebar {
170         width: 200px;
171         position: absolute;
172         left: 0;
173         top: 0;
174         min-height: 100%;
175 }
176
177 .sidebar .current {
178         margin-right: -20px;
179 }
180
181 .content, nav { max-width: 960px; }
182
183 /* Everything else */
184
185 .js-only, .hidden { display: none !important; }
186
187 .sidebar {
188         padding: 10px;
189 }
190 .sidebar img {
191         margin: 20px auto;
192         display: block;
193 }
194
195 .sidebar .location {
196         border: 1px solid;
197         font-size: 17px;
198         margin: 30px 0 20px 0;
199         text-align: center;
200         word-wrap: break-word;
201 }
202
203 .location:empty {
204         border: none;
205 }
206
207 .location a:first-child { font-weight: 500; }
208
209 .block {
210         padding: 0 10px;
211         margin-bottom: 14px;
212 }
213 .block h2, .block h3 {
214         margin-top: 0;
215         margin-bottom: 8px;
216         text-align: center;
217 }
218 .block ul, .block li {
219         margin: 0;
220         padding: 0;
221         list-style: none;
222 }
223
224 .block a {
225         display: block;
226         text-overflow: ellipsis;
227         overflow: hidden;
228         line-height: 15px;
229         padding: 7px 5px;
230         font-size: 14px;
231         font-weight: 300;
232         transition: border 500ms ease-out;
233 }
234
235 .content {
236         padding: 15px 0;
237 }
238
239 .source .content pre.rust {
240         white-space: pre;
241         overflow: auto;
242         padding-left: 0;
243 }
244 #search {
245         margin-left: 230px;
246 }
247 .content pre.line-numbers {
248         float: left;
249         border: none;
250         position: relative;
251
252         -webkit-user-select: none;
253         -moz-user-select: none;
254         -ms-user-select: none;
255         user-select: none;
256 }
257 .line-numbers span { cursor: pointer; }
258
259 .docblock-short p {
260         display: inline;
261 }
262
263 .docblock-short.nowrap {
264         display: block;
265         overflow: hidden;
266         white-space: nowrap;
267         text-overflow: ellipsis;
268 }
269
270 .docblock-short p {
271         overflow: hidden;
272         text-overflow: ellipsis;
273         margin: 0;
274 }
275 .docblock-short code { white-space: nowrap; }
276
277 .docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5 {
278         border-bottom: 1px solid;
279 }
280
281 #main > .docblock h1 { font-size: 1.3em; }
282 #main > .docblock h2 { font-size: 1.15em; }
283 #main > .docblock h3, #main > .docblock h4, #main > .docblock h5 { font-size: 1em; }
284
285 .docblock h1 { font-size: 1em; }
286 .docblock h2 { font-size: 0.95em; }
287 .docblock h3, .docblock h4, .docblock h5 { font-size: 0.9em; }
288
289 .docblock {
290         margin-left: 24px;
291 }
292
293 .content .out-of-band {
294         font-size: 23px;
295         margin: 0px;
296         padding: 0px;
297         text-align: right;
298         display: inline-block;
299         font-weight: normal;
300         position: absolute;
301         right: 0;
302 }
303
304 h3.impl > .out-of-band {
305         font-size: 21px;
306 }
307
308 h4.method > .out-of-band {
309         font-size: 19px;
310 }
311
312 h4 > code, h3 > code, .invisible > code {
313         position: inherit;
314 }
315
316 .in-band, code {
317         z-index: 5;
318 }
319
320 .invisible {
321         background: rgba(0, 0, 0, 0);
322         width: 100%;
323         display: inline-block;
324 }
325
326 .content .in-band {
327         margin: 0px;
328         padding: 0px;
329         display: inline-block;
330 }
331
332 .in-band > code {
333         display: inline-block;
334 }
335
336 #main { position: relative; }
337 #main > .since {
338         top: inherit;
339         font-family: "Fira Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
340 }
341
342 .content table {
343         border-spacing: 0 5px;
344         border-collapse: separate;
345 }
346 .content td { vertical-align: top; }
347 .content td:first-child { padding-right: 20px; }
348 .content td p:first-child { margin-top: 0; }
349 .content td h1, .content td h2 { margin-left: 0; font-size: 1.1em; }
350
351 .docblock table {
352         border: 1px solid;
353         margin: .5em 0;
354         border-collapse: collapse;
355         width: 100%;
356 }
357
358 .docblock table td {
359         padding: .5em;
360         border-top: 1px dashed;
361         border-bottom: 1px dashed;
362 }
363
364 .docblock table th {
365         padding: .5em;
366         text-align: left;
367         border-top: 1px solid;
368         border-bottom: 1px solid;
369 }
370
371 .fields + table {
372         margin-bottom: 1em;
373 }
374
375 .content .item-list {
376         list-style-type: none;
377         padding: 0;
378 }
379
380 .content .item-list li { margin-bottom: 3px; }
381
382 .content .multi-column {
383         -moz-column-count: 5;
384         -moz-column-gap: 2.5em;
385         -webkit-column-count: 5;
386         -webkit-column-gap: 2.5em;
387         column-count: 5;
388         column-gap: 2.5em;
389 }
390 .content .multi-column li { width: 100%; display: inline-block; }
391
392 .content .method {
393         font-size: 1em;
394         position: relative;
395 }
396 /* Shift "where ..." part of method or fn definition down a line */
397 .content .method .where,
398 .content .fn .where,
399 .content .where.fmt-newline {
400         display: block;
401         color: #4E4C4C;
402         font-size: 0.8em;
403 }
404
405 .content .methods > div { margin-left: 40px; }
406
407 .content .impl-items .docblock, .content .impl-items .stability {
408         margin-left: 40px;
409 }
410 .content .impl-items .method, .content .impl-items > .type, .impl-items > .associatedconstant {
411         margin-left: 20px;
412 }
413
414 .content .stability code {
415         font-size: 90%;
416 }
417
418 nav {
419         border-bottom: 1px solid;
420         padding-bottom: 10px;
421         margin-bottom: 10px;
422 }
423 nav.main {
424         padding: 20px 0;
425         text-align: center;
426 }
427 nav.main .current {
428         border-top: 1px solid;
429         border-bottom: 1px solid;
430 }
431 nav.main .separator {
432         border: 1px solid;
433         display: inline-block;
434         height: 23px;
435         margin: 0 20px;
436 }
437 nav.sum { text-align: right; }
438 nav.sub form { display: inline; }
439
440 nav.sub, .content {
441         margin-left: 230px;
442 }
443
444 a {
445         text-decoration: none;
446         background: transparent;
447 }
448
449 .small-section-header:hover > .anchor {
450         display: initial;
451 }
452
453 .in-band:hover > .anchor {
454         display: inline-block;
455         position: absolute;
456 }
457 .anchor {
458         display: none;
459 }
460 .anchor:after {
461         content: '\2002\00a7\2002';
462 }
463
464 .docblock a:hover, .docblock-short a:hover, .stability a {
465         text-decoration: underline;
466 }
467
468 .block a.current.crate { font-weight: 500; }
469
470 .search-input {
471         width: 100%;
472         /* Override Normalize.css: we have margins and do
473          not want to overflow - the `moz` attribute is necessary
474          until Firefox 29, too early to drop at this point */
475         -moz-box-sizing: border-box !important;
476         box-sizing: border-box !important;
477         outline: none;
478         border: none;
479         border-radius: 1px;
480         margin-top: 5px;
481         padding: 10px 16px;
482         font-size: 17px;
483         transition: border-color 300ms ease;
484         transition: border-radius 300ms ease-in-out;
485         transition: box-shadow 300ms ease-in-out;
486 }
487
488 .search-input:focus {
489         border-color: #66afe9;
490         border-radius: 2px;
491         border: 0;
492         outline: 0;
493         box-shadow: 0 0 8px #078dd8;
494 }
495
496 .search-results .desc {
497         white-space: nowrap;
498         text-overflow: ellipsis;
499         overflow: hidden;
500         display: block;
501 }
502
503 .search-results a {
504         display: block;
505 }
506
507 .content .search-results td:first-child { padding-right: 0; }
508 .content .search-results td:first-child a { padding-right: 10px; }
509
510 tr.result span.primitive::after { content: ' (primitive type)'; font-style: italic; color: black;
511 }
512
513 body.blur > :not(#help) {
514         filter: blur(8px);
515         -webkit-filter: blur(8px);
516         opacity: .7;
517 }
518
519 #help {
520         width: 100%;
521         height: 100vh;
522         position: fixed;
523         top: 0;
524         left: 0;
525         display: flex;
526         justify-content: center;
527         align-items: center;
528 }
529 #help > div {
530         flex: 0 0 auto;
531         box-shadow: 0 0 6px rgba(0,0,0,.2);
532         width: 550px;
533         height: 330px;
534         border: 1px solid;
535 }
536 #help dt {
537         float: left;
538         border-radius: 4px;
539         border: 1px solid;
540         width: 23px;
541         text-align: center;
542         clear: left;
543         display: block;
544         margin-top: -1px;
545 }
546 #help dd { margin: 5px 33px; }
547 #help .infos { padding-left: 0; }
548 #help h1, #help h2 { margin-top: 0; }
549 #help > div div {
550         width: 50%;
551         float: left;
552         padding: 20px;
553 }
554
555 .stab {
556         display: table;
557         border-width: 1px;
558         border-style: solid;
559         padding: 3px;
560         margin-bottom: 5px;
561         font-size: 90%;
562 }
563 .stab p {
564         display: inline;
565 }
566
567 .stab summary {
568         display: list-item;
569 }
570
571 .stab .microscope {
572         font-size: 1.5em;
573 }
574
575 .module-item .stab {
576         display: inline;
577         border-width: 0;
578         padding: 0;
579         margin: 0;
580         background: inherit !important;
581 }
582
583 .module-item.unstable {
584         opacity: 0.65;
585 }
586
587 .since {
588         font-weight: normal;
589         font-size: initial;
590         position: absolute;
591         right: 0;
592         top: 0;
593 }
594
595 .variants_table {
596         width: 100%;
597 }
598
599 .variants_table tbody tr td:first-child {
600         width: 1%; /* make the variant name as small as possible */
601 }
602
603 td.summary-column {
604         width: 100%;
605 }
606
607 .summary {
608         padding-right: 0px;
609 }
610
611 pre.rust .question-mark {
612         font-weight: bold;
613 }
614
615 a.test-arrow {
616         display: inline-block;
617         position: absolute;
618         padding: 5px 10px 5px 10px;
619         border-radius: 5px;
620         font-size: 130%;
621         top: 5px;
622         right: 5px;
623 }
624 a.test-arrow:hover{
625         text-decoration: none;
626 }
627
628 .section-header:hover a:after {
629         content: '\2002\00a7\2002';
630 }
631
632 .section-header:hover a {
633         text-decoration: none;
634 }
635
636 .section-header a {
637         color: inherit;
638 }
639
640 .collapse-toggle {
641         font-weight: 300;
642         position: absolute;
643         left: -23px;
644         color: #999;
645         top: 0;
646 }
647
648 h3 > .collapse-toggle, h4 > .collapse-toggle {
649         font-size: 0.8em;
650         top: 5px;
651 }
652
653 .toggle-wrapper > .collapse-toggle {
654         left: -24px;
655         margin-top: 0px;
656 }
657
658 .toggle-wrapper {
659         position: relative;
660         margin-top: 5px;
661 }
662
663 .toggle-wrapper.collapsed {
664         height: 25px;
665         transition: height .2s;
666         margin-bottom: .6em;
667 }
668
669 .collapse-toggle > .inner {
670         display: inline-block;
671         width: 1.2ch;
672         text-align: center;
673 }
674
675 .ghost {
676         display: none;
677 }
678
679 .ghost + .since {
680         position: initial;
681         display: table-cell;
682 }
683
684 .since + .srclink {
685         display: table-cell;
686         padding-left: 10px;
687 }
688
689 .item-spacer {
690         width: 100%;
691         height: 12px;
692 }
693
694 span.since {
695         position: initial;
696         font-size: 20px;
697         margin-right: 5px;
698 }
699
700 .toggle-wrapper > .collapse-toggle {
701         left: 0;
702 }
703
704 .variant + .toggle-wrapper + .docblock > p {
705         margin-top: 5px;
706 }
707
708 .sub-variant, .sub-variant > h3 {
709         margin-top: 0 !important;
710 }
711
712 .toggle-label {
713         display: inline-block;
714         margin-left: 4px;
715         margin-top: 3px;
716 }
717
718 .enum > .toggle-wrapper + .docblock, .struct > .toggle-wrapper + .docblock {
719         margin-left: 30px;
720         margin-bottom: 20px;
721         margin-top: 5px;
722 }
723
724 .enum > .collapsed, .struct > .collapsed {
725         margin-bottom: 25px;
726 }
727
728 #main > .variant, #main > .structfield {
729         display: block;
730 }
731
732 .attributes {
733         display: block;
734         margin: 0px 0px 0px 30px !important;
735 }
736 .toggle-attributes.collapsed {
737         margin-bottom: 5px;
738 }
739
740 :target > code {
741         opacity: 1;
742 }
743
744 /* Media Queries */
745
746 @media (max-width: 700px) {
747         body {
748                 padding-top: 0px;
749         }
750
751         .sidebar {
752                 height: 40px;
753                 min-height: 40px;
754                 width: 100%;
755                 margin: 0px;
756                 padding: 0px;
757                 position: static;
758         }
759
760         .sidebar .location {
761                 float: right;
762                 margin: 0px;
763                 padding: 3px 10px 1px 10px;
764                 min-height: 39px;
765                 background: inherit;
766                 text-align: left;
767                 font-size: 24px;
768         }
769
770         .sidebar .location:empty {
771                 padding: 0;
772         }
773
774         .sidebar img {
775                 width: 35px;
776                 margin-top: 5px;
777                 margin-bottom: 0px;
778                 float: left;
779         }
780
781         nav.sub {
782                 margin: 0 auto;
783         }
784
785         .sidebar .block {
786                 display: none;
787         }
788
789         .content {
790                 margin-left: 0px;
791         }
792
793         .content .in-band {
794                 width: 100%;
795         }
796
797         .content .out-of-band {
798                 display: none;
799         }
800
801         .toggle-wrapper > .collapse-toggle {
802                 left: 0px;
803         }
804
805         .toggle-wrapper {
806                 height: 1.5em;
807         }
808 }
809
810 @media print {
811         nav.sub, .content .out-of-band, .collapse-toggle {
812                 display: none;
813         }
814 }
815
816 .information {
817         position: absolute;
818         left: -1px;
819         margin-top: 7px;
820 }
821
822 .tooltip {
823         position: relative;
824         display: inline-block;
825         cursor: pointer;
826 }
827
828 .tooltip .tooltiptext {
829         width: 120px;
830         display: none;
831         background-color: black;
832         color: #fff;
833         text-align: center;
834         padding: 5px 3px;
835         border-radius: 6px;
836         margin-left: 5px;
837         top: -5px;
838         left: 105%;
839         z-index: 1;
840 }
841
842 .tooltip:hover .tooltiptext {
843         display: inline;
844 }
845
846 .tooltip .tooltiptext::after {
847         content: " ";
848         position: absolute;
849         top: 50%;
850         left: 11px;
851         margin-top: -5px;
852         border-width: 5px;
853         border-style: solid;
854         border-color: transparent black transparent transparent;
855 }