]> git.lizzy.rs Git - rust.git/blob - src/librustdoc/html/static/rustdoc.css
Auto merge of #43067 - pornel:libdeps, r=nrc
[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 pre.rust { position: relative; }
616 a.test-arrow {
617         display: inline-block;
618         position: absolute;
619         padding: 5px 10px 5px 10px;
620         border-radius: 5px;
621         font-size: 130%;
622         top: 5px;
623         right: 5px;
624 }
625 a.test-arrow:hover{
626         text-decoration: none;
627 }
628
629 .section-header:hover a:after {
630         content: '\2002\00a7\2002';
631 }
632
633 .section-header:hover a {
634         text-decoration: none;
635 }
636
637 .section-header a {
638         color: inherit;
639 }
640
641 .collapse-toggle {
642         font-weight: 300;
643         position: absolute;
644         left: -23px;
645         color: #999;
646         top: 0;
647 }
648
649 h3 > .collapse-toggle, h4 > .collapse-toggle {
650         font-size: 0.8em;
651         top: 5px;
652 }
653
654 .toggle-wrapper > .collapse-toggle {
655         left: -24px;
656         margin-top: 0px;
657 }
658
659 .toggle-wrapper {
660         position: relative;
661         margin-top: 5px;
662 }
663
664 .toggle-wrapper.collapsed {
665         height: 25px;
666         transition: height .2s;
667         margin-bottom: .6em;
668 }
669
670 .collapse-toggle > .inner {
671         display: inline-block;
672         width: 1.2ch;
673         text-align: center;
674 }
675
676 .ghost {
677         display: none;
678 }
679
680 .ghost + .since {
681         position: initial;
682         display: table-cell;
683 }
684
685 .since + .srclink {
686         display: table-cell;
687         padding-left: 10px;
688 }
689
690 .item-spacer {
691         width: 100%;
692         height: 12px;
693 }
694
695 span.since {
696         position: initial;
697         font-size: 20px;
698         margin-right: 5px;
699 }
700
701 .toggle-wrapper > .collapse-toggle {
702         left: 0;
703 }
704
705 .variant + .toggle-wrapper + .docblock > p {
706         margin-top: 5px;
707 }
708
709 .sub-variant, .sub-variant > h3 {
710         margin-top: 0 !important;
711 }
712
713 .toggle-label {
714         display: inline-block;
715         margin-left: 4px;
716         margin-top: 3px;
717 }
718
719 .enum > .toggle-wrapper + .docblock, .struct > .toggle-wrapper + .docblock {
720         margin-left: 30px;
721         margin-bottom: 20px;
722         margin-top: 5px;
723 }
724
725 .enum > .collapsed, .struct > .collapsed {
726         margin-bottom: 25px;
727 }
728
729 #main > .variant, #main > .structfield {
730         display: block;
731 }
732
733 .attributes {
734         display: block;
735         margin: 0px 0px 0px 30px !important;
736 }
737 .toggle-attributes.collapsed {
738         margin-bottom: 5px;
739 }
740
741 :target > code {
742         opacity: 1;
743 }
744
745 /* Media Queries */
746
747 @media (max-width: 700px) {
748         body {
749                 padding-top: 0px;
750         }
751
752         .sidebar {
753                 height: 40px;
754                 min-height: 40px;
755                 width: 100%;
756                 margin: 0px;
757                 padding: 0px;
758                 position: static;
759         }
760
761         .sidebar .location {
762                 float: right;
763                 margin: 0px;
764                 padding: 3px 10px 1px 10px;
765                 min-height: 39px;
766                 background: inherit;
767                 text-align: left;
768                 font-size: 24px;
769         }
770
771         .sidebar .location:empty {
772                 padding: 0;
773         }
774
775         .sidebar img {
776                 width: 35px;
777                 margin-top: 5px;
778                 margin-bottom: 0px;
779                 float: left;
780         }
781
782         nav.sub {
783                 margin: 0 auto;
784         }
785
786         .sidebar .block {
787                 display: none;
788         }
789
790         .content {
791                 margin-left: 0px;
792         }
793
794         .content .in-band {
795                 width: 100%;
796         }
797
798         .content .out-of-band {
799                 display: none;
800         }
801
802         .toggle-wrapper > .collapse-toggle {
803                 left: 0px;
804         }
805
806         .toggle-wrapper {
807                 height: 1.5em;
808         }
809 }
810
811 @media print {
812         nav.sub, .content .out-of-band, .collapse-toggle {
813                 display: none;
814         }
815 }