]> git.lizzy.rs Git - rust.git/blob - src/librustdoc/html/static/rustdoc.css
51465bafc42e23f10b4ab947ed366c0163e145df
[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 .block a.current.crate { font-weight: 500; }
446
447 .search-input {
448         width: 100%;
449         /* Override Normalize.css: we have margins and do
450          not want to overflow - the `moz` attribute is necessary
451          until Firefox 29, too early to drop at this point */
452         -moz-box-sizing: border-box !important;
453         box-sizing: border-box !important;
454         outline: none;
455         border: none;
456         border-radius: 1px;
457         margin-top: 5px;
458         padding: 10px 16px;
459         font-size: 17px;
460         transition: border-color 300ms ease;
461         transition: border-radius 300ms ease-in-out;
462         transition: box-shadow 300ms ease-in-out;
463 }
464
465 .search-input:focus {
466         border-color: #66afe9;
467         border-radius: 2px;
468         border: 0;
469         outline: 0;
470         box-shadow: 0 0 8px #078dd8;
471 }
472
473 .search-results .desc {
474         white-space: nowrap;
475         text-overflow: ellipsis;
476         overflow: hidden;
477         display: block;
478 }
479
480 .search-results a {
481         display: block;
482 }
483
484 .content .search-results td:first-child { padding-right: 0; }
485 .content .search-results td:first-child a { padding-right: 10px; }
486
487 tr.result span.primitive::after { content: ' (primitive type)'; font-style: italic; color: black;
488 }
489
490 body.blur > :not(#help) {
491         filter: blur(8px);
492         -webkit-filter: blur(8px);
493         opacity: .7;
494 }
495
496 #help {
497         width: 100%;
498         height: 100vh;
499         position: fixed;
500         top: 0;
501         left: 0;
502         display: flex;
503         justify-content: center;
504         align-items: center;
505 }
506 #help > div {
507         flex: 0 0 auto;
508         box-shadow: 0 0 6px rgba(0,0,0,.2);
509         width: 550px;
510         height: 330px;
511         border: 1px solid;
512 }
513 #help dt {
514         float: left;
515         border-radius: 4px;
516         border: 1px solid;
517         width: 23px;
518         text-align: center;
519         clear: left;
520         display: block;
521         margin-top: -1px;
522 }
523 #help dd { margin: 5px 33px; }
524 #help .infos { padding-left: 0; }
525 #help h1, #help h2 { margin-top: 0; }
526 #help > div div {
527         width: 50%;
528         float: left;
529         padding: 20px;
530 }
531
532 .stab {
533         display: table;
534         border-width: 1px;
535         border-style: solid;
536         padding: 3px;
537         margin-bottom: 5px;
538         font-size: 90%;
539 }
540 .stab p {
541         display: inline;
542 }
543
544 .stab summary {
545         display: list-item;
546 }
547
548 .stab .microscope {
549         font-size: 1.5em;
550 }
551
552 .module-item .stab {
553         display: inline;
554         border-width: 0;
555         padding: 0;
556         margin: 0;
557         background: inherit !important;
558 }
559
560 .module-item.unstable {
561         opacity: 0.65;
562 }
563
564 .since {
565         font-weight: normal;
566         font-size: initial;
567         position: absolute;
568         right: 0;
569         top: 0;
570 }
571
572 .variants_table {
573         width: 100%;
574 }
575
576 .variants_table tbody tr td:first-child {
577         width: 1%; /* make the variant name as small as possible */
578 }
579
580 td.summary-column {
581         width: 100%;
582 }
583
584 .summary {
585         padding-right: 0px;
586 }
587
588 pre.rust .question-mark {
589         font-weight: bold;
590 }
591
592 pre.rust { position: relative; }
593 a.test-arrow {
594         display: inline-block;
595         position: absolute;
596         padding: 5px 10px 5px 10px;
597         border-radius: 5px;
598         font-size: 130%;
599         top: 5px;
600         right: 5px;
601 }
602 a.test-arrow:hover{
603         text-decoration: none;
604 }
605
606 .section-header:hover a:after {
607         content: '\2002\00a7\2002';
608 }
609
610 .section-header:hover a {
611         text-decoration: none;
612 }
613
614 .section-header a {
615         color: inherit;
616 }
617
618 .collapse-toggle {
619         font-weight: 300;
620         position: absolute;
621         left: -23px;
622         color: #999;
623         top: 0;
624 }
625
626 h3 > .collapse-toggle, h4 > .collapse-toggle {
627         font-size: 0.8em;
628         top: 5px;
629 }
630
631 .toggle-wrapper > .collapse-toggle {
632         left: -24px;
633         margin-top: 0px;
634 }
635
636 .toggle-wrapper {
637         position: relative;
638 }
639
640 .toggle-wrapper.collapsed {
641         height: 1em;
642         transition: height .2s;
643 }
644
645 .collapse-toggle > .inner {
646         display: inline-block;
647         width: 1.2ch;
648         text-align: center;
649 }
650
651 .ghost {
652         display: none;
653 }
654
655 .ghost + .since {
656         position: initial;
657         display: table-cell;
658 }
659
660 .since + .srclink {
661         display: table-cell;
662         padding-left: 10px;
663 }
664
665 .item-spacer {
666         width: 100%;
667         height: 12px;
668 }
669
670 span.since {
671         position: initial;
672         font-size: 20px;
673         margin-right: 5px;
674 }
675
676 .toggle-wrapper > .collapse-toggle {
677         left: 0;
678 }
679
680 .variant + .toggle-wrapper > a {
681         margin-top: 5px;
682 }
683
684 .sub-variant, .sub-variant > h3 {
685         margin-top: 0 !important;
686 }
687
688 .enum > .toggle-wrapper + .docblock, .struct > .toggle-wrapper + .docblock {
689         margin-left: 30px;
690         margin-bottom: 20px;
691         margin-top: 5px;
692 }
693
694 .enum > .collapsed, .struct > .collapsed {
695         margin-bottom: 25px;
696 }
697
698 .enum .variant, .struct .structfield, .union .structfield {
699         display: block;
700 }
701
702 .attributes {
703         display: block;
704         margin: 0px 0px 0px 30px !important;
705 }
706 .toggle-attributes.collapsed {
707         margin-bottom: 5px;
708 }
709
710 :target > code {
711         opacity: 1;
712 }
713
714 /* Media Queries */
715
716 @media (max-width: 700px) {
717         body {
718                 padding-top: 0px;
719         }
720
721         .sidebar {
722                 height: 40px;
723                 min-height: 40px;
724                 width: 100%;
725                 margin: 0px;
726                 padding: 0px;
727                 position: static;
728         }
729
730         .sidebar .location {
731                 float: right;
732                 margin: 0px;
733                 padding: 3px 10px 1px 10px;
734                 min-height: 39px;
735                 background: inherit;
736                 text-align: left;
737                 font-size: 24px;
738         }
739
740         .sidebar .location:empty {
741                 padding: 0;
742         }
743
744         .sidebar img {
745                 width: 35px;
746                 margin-top: 5px;
747                 margin-bottom: 0px;
748                 float: left;
749         }
750
751         nav.sub {
752                 margin: 0 auto;
753         }
754
755         .sidebar .block {
756                 display: none;
757         }
758
759         .content {
760                 margin-left: 0px;
761         }
762
763         .content .in-band {
764                 width: 100%;
765         }
766
767         .content .out-of-band {
768                 display: none;
769         }
770
771         .toggle-wrapper > .collapse-toggle {
772                 left: 0px;
773         }
774
775         .toggle-wrapper {
776                 height: 1.5em;
777         }
778 }
779
780 @media print {
781         nav.sub, .content .out-of-band, .collapse-toggle {
782                 display: none;
783         }
784 }