]> git.lizzy.rs Git - rust.git/blob - src/librustdoc/html/static/rustdoc.css
Auto merge of #43609 - dsprenkels:issue-40510, r=Mark-Simulacrum
[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 code, pre {
130         font-family: "Source Code Pro", Menlo, Monaco, Consolas, "DejaVu Sans Mono", Inconsolata, monospace;
131         white-space: pre-wrap;
132 }
133 .docblock code, .docblock-short code {
134         border-radius: 3px;
135         padding: 0 0.2em;
136 }
137 .docblock pre code, .docblock-short pre code {
138         padding: 0;
139 }
140 pre {
141         padding: 14px;
142 }
143
144 .source .content pre {
145         padding: 20px;
146 }
147
148 img {
149         max-width: 100%;
150 }
151
152 .source .content {
153         margin-top: 50px;
154         max-width: none;
155         overflow: visible;
156         margin-left: 0px;
157         min-width: 70em;
158 }
159
160 nav.sub {
161         font-size: 16px;
162         text-transform: uppercase;
163 }
164
165 .sidebar {
166         width: 200px;
167         position: absolute;
168         left: 0;
169         top: 0;
170         min-height: 100%;
171 }
172
173 .sidebar .current {
174         margin-right: -20px;
175 }
176
177 .content, nav { max-width: 960px; }
178
179 /* Everything else */
180
181 .js-only, .hidden { display: none !important; }
182
183 .sidebar {
184         padding: 10px;
185 }
186 .sidebar img {
187         margin: 20px auto;
188         display: block;
189 }
190
191 .sidebar .location {
192         border: 1px solid;
193         font-size: 17px;
194         margin: 30px 0 20px 0;
195         text-align: center;
196         word-wrap: break-word;
197 }
198
199 .location:empty {
200         border: none;
201 }
202
203 .location a:first-child { font-weight: 500; }
204
205 .block {
206         padding: 0 10px;
207         margin-bottom: 14px;
208 }
209 .block h2, .block h3 {
210         margin-top: 0;
211         margin-bottom: 8px;
212         text-align: center;
213 }
214 .block ul, .block li {
215         margin: 0;
216         padding: 0;
217         list-style: none;
218 }
219
220 .block a {
221         display: block;
222         text-overflow: ellipsis;
223         overflow: hidden;
224         line-height: 15px;
225         padding: 7px 5px;
226         font-size: 14px;
227         font-weight: 300;
228         transition: border 500ms ease-out;
229 }
230
231 .content {
232         padding: 15px 0;
233 }
234
235 .source .content pre.rust {
236         white-space: pre;
237         overflow: auto;
238         padding-left: 0;
239 }
240 #search {
241         margin-left: 230px;
242 }
243 .content pre.line-numbers {
244         float: left;
245         border: none;
246         position: relative;
247
248         -webkit-user-select: none;
249         -moz-user-select: none;
250         -ms-user-select: none;
251         user-select: none;
252 }
253 .line-numbers span { cursor: pointer; }
254
255 .docblock-short p {
256         display: inline;
257 }
258
259 .docblock-short.nowrap {
260         display: block;
261         overflow: hidden;
262         white-space: nowrap;
263         text-overflow: ellipsis;
264 }
265
266 .docblock-short p {
267         overflow: hidden;
268         text-overflow: ellipsis;
269         margin: 0;
270 }
271 .docblock-short code { white-space: nowrap; }
272
273 .docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5 {
274         border-bottom: 1px solid;
275 }
276
277 #main > .docblock h1 { font-size: 1.3em; }
278 #main > .docblock h2 { font-size: 1.15em; }
279 #main > .docblock h3, #main > .docblock h4, #main > .docblock h5 { font-size: 1em; }
280
281 .docblock h1 { font-size: 1em; }
282 .docblock h2 { font-size: 0.95em; }
283 .docblock h3, .docblock h4, .docblock h5 { font-size: 0.9em; }
284
285 .docblock {
286         margin-left: 24px;
287 }
288
289 .content .out-of-band {
290         font-size: 23px;
291         margin: 0px;
292         padding: 0px;
293         text-align: right;
294         display: inline-block;
295         font-weight: normal;
296         position: absolute;
297         right: 0;
298 }
299
300 h3.impl > .out-of-band {
301         font-size: 21px;
302 }
303
304 h4.method > .out-of-band {
305         font-size: 19px;
306 }
307
308 h4 > code, h3 > code, .invisible > code {
309         position: inherit;
310 }
311
312 .in-band, code {
313         z-index: 5;
314 }
315
316 .invisible {
317         background: rgba(0, 0, 0, 0);
318         width: 100%;
319         display: inline-block;
320 }
321
322 .content .in-band {
323         margin: 0px;
324         padding: 0px;
325         display: inline-block;
326 }
327
328 #main { position: relative; }
329 #main > .since {
330         top: inherit;
331         font-family: "Fira Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
332 }
333
334 .content table {
335         border-spacing: 0 5px;
336         border-collapse: separate;
337 }
338 .content td { vertical-align: top; }
339 .content td:first-child { padding-right: 20px; }
340 .content td p:first-child { margin-top: 0; }
341 .content td h1, .content td h2 { margin-left: 0; font-size: 1.1em; }
342
343 .docblock table {
344         border: 1px solid;
345         margin: .5em 0;
346         border-collapse: collapse;
347         width: 100%;
348 }
349
350 .docblock table td {
351         padding: .5em;
352         border-top: 1px dashed;
353         border-bottom: 1px dashed;
354 }
355
356 .docblock table th {
357         padding: .5em;
358         text-align: left;
359         border-top: 1px solid;
360         border-bottom: 1px solid;
361 }
362
363 .fields + table {
364         margin-bottom: 1em;
365 }
366
367 .content .item-list {
368         list-style-type: none;
369         padding: 0;
370 }
371
372 .content .item-list li { margin-bottom: 3px; }
373
374 .content .multi-column {
375         -moz-column-count: 5;
376         -moz-column-gap: 2.5em;
377         -webkit-column-count: 5;
378         -webkit-column-gap: 2.5em;
379         column-count: 5;
380         column-gap: 2.5em;
381 }
382 .content .multi-column li { width: 100%; display: inline-block; }
383
384 .content .method {
385         font-size: 1em;
386         position: relative;
387 }
388 /* Shift "where ..." part of method or fn definition down a line */
389 .content .method .where,
390 .content .fn .where,
391 .content .where.fmt-newline {
392         display: block;
393         color: #4E4C4C;
394         font-size: 0.8em;
395 }
396
397 .content .methods > div { margin-left: 40px; }
398
399 .content .impl-items .docblock, .content .impl-items .stability {
400         margin-left: 40px;
401 }
402 .content .impl-items .method, .content .impl-items > .type, .impl-items > .associatedconstant {
403         margin-left: 20px;
404 }
405
406 .content .stability code {
407         font-size: 90%;
408 }
409
410 nav {
411         border-bottom: 1px solid;
412         padding-bottom: 10px;
413         margin-bottom: 10px;
414 }
415 nav.main {
416         padding: 20px 0;
417         text-align: center;
418 }
419 nav.main .current {
420         border-top: 1px solid;
421         border-bottom: 1px solid;
422 }
423 nav.main .separator {
424         border: 1px solid;
425         display: inline-block;
426         height: 23px;
427         margin: 0 20px;
428 }
429 nav.sum { text-align: right; }
430 nav.sub form { display: inline; }
431
432 nav.sub, .content {
433         margin-left: 230px;
434 }
435
436 a {
437         text-decoration: none;
438         background: transparent;
439 }
440
441 .docblock a:hover, .docblock-short a:hover, .stability a {
442         text-decoration: underline;
443 }
444
445 .content span.enum, .content a.enum, .block a.current.enum { color: #5e9766; }
446 .content span.struct, .content a.struct, .block a.current.struct { color: #df3600; }
447 .content span.type, .content a.type, .block a.current.type { color: #e57300; }
448 .content span.macro, .content a.macro, .block a.current.macro { color: #068000; }
449 .block a.current.crate { font-weight: 500; }
450
451 .search-input {
452         width: 100%;
453         /* Override Normalize.css: we have margins and do
454          not want to overflow - the `moz` attribute is necessary
455          until Firefox 29, too early to drop at this point */
456         -moz-box-sizing: border-box !important;
457         box-sizing: border-box !important;
458         outline: none;
459         border: none;
460         border-radius: 1px;
461         margin-top: 5px;
462         padding: 10px 16px;
463         font-size: 17px;
464         transition: border-color 300ms ease;
465         transition: border-radius 300ms ease-in-out;
466         transition: box-shadow 300ms ease-in-out;
467 }
468
469 .search-input:focus {
470         border-color: #66afe9;
471         border-radius: 2px;
472         border: 0;
473         outline: 0;
474         box-shadow: 0 0 8px #078dd8;
475 }
476
477 .search-results .desc {
478         white-space: nowrap;
479         text-overflow: ellipsis;
480         overflow: hidden;
481         display: block;
482 }
483
484 .search-results a {
485         display: block;
486 }
487
488 .content .search-results td:first-child { padding-right: 0; }
489 .content .search-results td:first-child a { padding-right: 10px; }
490
491 tr.result span.primitive::after { content: ' (primitive type)'; font-style: italic; color: black;
492 }
493
494 body.blur > :not(#help) {
495         filter: blur(8px);
496         -webkit-filter: blur(8px);
497         opacity: .7;
498 }
499
500 #help {
501         width: 100%;
502         height: 100vh;
503         position: fixed;
504         top: 0;
505         left: 0;
506         display: flex;
507         justify-content: center;
508         align-items: center;
509 }
510 #help > div {
511         flex: 0 0 auto;
512         box-shadow: 0 0 6px rgba(0,0,0,.2);
513         width: 550px;
514         height: 330px;
515         border: 1px solid;
516 }
517 #help dt {
518         float: left;
519         border-radius: 4px;
520         border: 1px solid;
521         width: 23px;
522         text-align: center;
523         clear: left;
524         display: block;
525         margin-top: -1px;
526 }
527 #help dd { margin: 5px 33px; }
528 #help .infos { padding-left: 0; }
529 #help h1, #help h2 { margin-top: 0; }
530 #help > div div {
531         width: 50%;
532         float: left;
533         padding: 20px;
534 }
535
536 .stab {
537         display: table;
538         border-width: 1px;
539         border-style: solid;
540         padding: 3px;
541         margin-bottom: 5px;
542         font-size: 90%;
543 }
544 .stab p {
545         display: inline;
546 }
547
548 .stab summary {
549         display: list-item;
550 }
551
552 .stab .microscope {
553         font-size: 1.5em;
554 }
555
556 .module-item .stab {
557         display: inline;
558         border-width: 0;
559         padding: 0;
560         margin: 0;
561         background: inherit !important;
562 }
563
564 .module-item.unstable {
565         opacity: 0.65;
566 }
567
568 .since {
569         font-weight: normal;
570         font-size: initial;
571         position: absolute;
572         right: 0;
573         top: 0;
574 }
575
576 .variants_table {
577         width: 100%;
578 }
579
580 .variants_table tbody tr td:first-child {
581         width: 1%; /* make the variant name as small as possible */
582 }
583
584 td.summary-column {
585         width: 100%;
586 }
587
588 .summary {
589         padding-right: 0px;
590 }
591
592 pre.rust .question-mark {
593         font-weight: bold;
594 }
595
596 pre.rust { position: relative; }
597 a.test-arrow {
598         display: inline-block;
599         position: absolute;
600         padding: 5px 10px 5px 10px;
601         border-radius: 5px;
602         font-size: 130%;
603         top: 5px;
604         right: 5px;
605 }
606 a.test-arrow:hover{
607         text-decoration: none;
608 }
609
610 .section-header:hover a:after {
611         content: '\2002\00a7\2002';
612 }
613
614 .section-header:hover a {
615         text-decoration: none;
616 }
617
618 .section-header a {
619         color: inherit;
620 }
621
622 .collapse-toggle {
623         font-weight: 300;
624         position: absolute;
625         left: -23px;
626         color: #999;
627         top: 0;
628 }
629
630 h3 > .collapse-toggle, h4 > .collapse-toggle {
631         font-size: 0.8em;
632         top: 5px;
633 }
634
635 .toggle-wrapper > .collapse-toggle {
636         left: -24px;
637         margin-top: 0px;
638 }
639
640 .toggle-wrapper {
641         position: relative;
642 }
643
644 .toggle-wrapper.collapsed {
645         height: 1em;
646         transition: height .2s;
647 }
648
649 .collapse-toggle > .inner {
650         display: inline-block;
651         width: 1.2ch;
652         text-align: center;
653 }
654
655 .ghost {
656         display: none;
657 }
658
659 .ghost + .since {
660         position: initial;
661         display: table-cell;
662 }
663
664 .since + .srclink {
665         display: table-cell;
666         padding-left: 10px;
667 }
668
669 .item-spacer {
670         width: 100%;
671         height: 12px;
672 }
673
674 span.since {
675         position: initial;
676         font-size: 20px;
677         margin-right: 5px;
678 }
679
680 .toggle-wrapper > .collapse-toggle {
681         left: 0;
682 }
683
684 .variant + .toggle-wrapper > a {
685         margin-top: 5px;
686 }
687
688 .sub-variant, .sub-variant > h3 {
689         margin-top: 0 !important;
690 }
691
692 .enum > .toggle-wrapper + .docblock, .struct > .toggle-wrapper + .docblock {
693         margin-left: 30px;
694         margin-bottom: 20px;
695         margin-top: 5px;
696 }
697
698 .enum > .collapsed, .struct > .collapsed {
699         margin-bottom: 25px;
700 }
701
702 .enum .variant, .struct .structfield, .union .structfield {
703         display: block;
704 }
705
706 .attributes {
707         display: block;
708         margin: 0px 0px 0px 30px !important;
709 }
710 .toggle-attributes.collapsed {
711         margin-bottom: 5px;
712 }
713
714 :target > code {
715         opacity: 1;
716 }
717
718 /* Media Queries */
719
720 @media (max-width: 700px) {
721         body {
722                 padding-top: 0px;
723         }
724
725         .sidebar {
726                 height: 40px;
727                 min-height: 40px;
728                 width: 100%;
729                 margin: 0px;
730                 padding: 0px;
731                 position: static;
732         }
733
734         .sidebar .location {
735                 float: right;
736                 margin: 0px;
737                 padding: 3px 10px 1px 10px;
738                 min-height: 39px;
739                 background: inherit;
740                 text-align: left;
741                 font-size: 24px;
742         }
743
744         .sidebar .location:empty {
745                 padding: 0;
746         }
747
748         .sidebar img {
749                 width: 35px;
750                 margin-top: 5px;
751                 margin-bottom: 0px;
752                 float: left;
753         }
754
755         nav.sub {
756                 margin: 0 auto;
757         }
758
759         .sidebar .block {
760                 display: none;
761         }
762
763         .content {
764                 margin-left: 0px;
765         }
766
767         .content .in-band {
768                 width: 100%;
769         }
770
771         .content .out-of-band {
772                 display: none;
773         }
774
775         .toggle-wrapper > .collapse-toggle {
776                 left: 0px;
777         }
778
779         .toggle-wrapper {
780                 height: 1.5em;
781         }
782 }
783
784 @media print {
785         nav.sub, .content .out-of-band, .collapse-toggle {
786                 display: none;
787         }
788 }