]> git.lizzy.rs Git - rust.git/blob - src/librustdoc/html/static/rustdoc.css
Auto merge of #44059 - oli-obk:ok_suggestion, 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 #main { position: relative; }
333 #main > .since {
334         top: inherit;
335         font-family: "Fira Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
336 }
337
338 .content table {
339         border-spacing: 0 5px;
340         border-collapse: separate;
341 }
342 .content td { vertical-align: top; }
343 .content td:first-child { padding-right: 20px; }
344 .content td p:first-child { margin-top: 0; }
345 .content td h1, .content td h2 { margin-left: 0; font-size: 1.1em; }
346
347 .docblock table {
348         border: 1px solid;
349         margin: .5em 0;
350         border-collapse: collapse;
351         width: 100%;
352 }
353
354 .docblock table td {
355         padding: .5em;
356         border-top: 1px dashed;
357         border-bottom: 1px dashed;
358 }
359
360 .docblock table th {
361         padding: .5em;
362         text-align: left;
363         border-top: 1px solid;
364         border-bottom: 1px solid;
365 }
366
367 .fields + table {
368         margin-bottom: 1em;
369 }
370
371 .content .item-list {
372         list-style-type: none;
373         padding: 0;
374 }
375
376 .content .item-list li { margin-bottom: 3px; }
377
378 .content .multi-column {
379         -moz-column-count: 5;
380         -moz-column-gap: 2.5em;
381         -webkit-column-count: 5;
382         -webkit-column-gap: 2.5em;
383         column-count: 5;
384         column-gap: 2.5em;
385 }
386 .content .multi-column li { width: 100%; display: inline-block; }
387
388 .content .method {
389         font-size: 1em;
390         position: relative;
391 }
392 /* Shift "where ..." part of method or fn definition down a line */
393 .content .method .where,
394 .content .fn .where,
395 .content .where.fmt-newline {
396         display: block;
397         color: #4E4C4C;
398         font-size: 0.8em;
399 }
400
401 .content .methods > div { margin-left: 40px; }
402
403 .content .impl-items .docblock, .content .impl-items .stability {
404         margin-left: 40px;
405 }
406 .content .impl-items .method, .content .impl-items > .type, .impl-items > .associatedconstant {
407         margin-left: 20px;
408 }
409
410 .content .stability code {
411         font-size: 90%;
412 }
413
414 nav {
415         border-bottom: 1px solid;
416         padding-bottom: 10px;
417         margin-bottom: 10px;
418 }
419 nav.main {
420         padding: 20px 0;
421         text-align: center;
422 }
423 nav.main .current {
424         border-top: 1px solid;
425         border-bottom: 1px solid;
426 }
427 nav.main .separator {
428         border: 1px solid;
429         display: inline-block;
430         height: 23px;
431         margin: 0 20px;
432 }
433 nav.sum { text-align: right; }
434 nav.sub form { display: inline; }
435
436 nav.sub, .content {
437         margin-left: 230px;
438 }
439
440 a {
441         text-decoration: none;
442         background: transparent;
443 }
444
445 .small-section-header:hover > .anchor {
446         display: initial;
447 }
448
449 .in-band:hover > .anchor {
450         display: initial;
451 }
452 .anchor {
453         display: none;
454 }
455 .anchor:after {
456         content: '\2002\00a7\2002';
457 }
458
459 .docblock a:hover, .docblock-short a:hover, .stability a {
460         text-decoration: underline;
461 }
462
463 .block a.current.crate { font-weight: 500; }
464
465 .search-input {
466         width: 100%;
467         /* Override Normalize.css: we have margins and do
468          not want to overflow - the `moz` attribute is necessary
469          until Firefox 29, too early to drop at this point */
470         -moz-box-sizing: border-box !important;
471         box-sizing: border-box !important;
472         outline: none;
473         border: none;
474         border-radius: 1px;
475         margin-top: 5px;
476         padding: 10px 16px;
477         font-size: 17px;
478         transition: border-color 300ms ease;
479         transition: border-radius 300ms ease-in-out;
480         transition: box-shadow 300ms ease-in-out;
481 }
482
483 .search-input:focus {
484         border-color: #66afe9;
485         border-radius: 2px;
486         border: 0;
487         outline: 0;
488         box-shadow: 0 0 8px #078dd8;
489 }
490
491 .search-results .desc {
492         white-space: nowrap;
493         text-overflow: ellipsis;
494         overflow: hidden;
495         display: block;
496 }
497
498 .search-results a {
499         display: block;
500 }
501
502 .content .search-results td:first-child { padding-right: 0; }
503 .content .search-results td:first-child a { padding-right: 10px; }
504
505 tr.result span.primitive::after { content: ' (primitive type)'; font-style: italic; color: black;
506 }
507
508 body.blur > :not(#help) {
509         filter: blur(8px);
510         -webkit-filter: blur(8px);
511         opacity: .7;
512 }
513
514 #help {
515         width: 100%;
516         height: 100vh;
517         position: fixed;
518         top: 0;
519         left: 0;
520         display: flex;
521         justify-content: center;
522         align-items: center;
523 }
524 #help > div {
525         flex: 0 0 auto;
526         box-shadow: 0 0 6px rgba(0,0,0,.2);
527         width: 550px;
528         height: 330px;
529         border: 1px solid;
530 }
531 #help dt {
532         float: left;
533         border-radius: 4px;
534         border: 1px solid;
535         width: 23px;
536         text-align: center;
537         clear: left;
538         display: block;
539         margin-top: -1px;
540 }
541 #help dd { margin: 5px 33px; }
542 #help .infos { padding-left: 0; }
543 #help h1, #help h2 { margin-top: 0; }
544 #help > div div {
545         width: 50%;
546         float: left;
547         padding: 20px;
548 }
549
550 .stab {
551         display: table;
552         border-width: 1px;
553         border-style: solid;
554         padding: 3px;
555         margin-bottom: 5px;
556         font-size: 90%;
557 }
558 .stab p {
559         display: inline;
560 }
561
562 .stab summary {
563         display: list-item;
564 }
565
566 .stab .microscope {
567         font-size: 1.5em;
568 }
569
570 .module-item .stab {
571         display: inline;
572         border-width: 0;
573         padding: 0;
574         margin: 0;
575         background: inherit !important;
576 }
577
578 .module-item.unstable {
579         opacity: 0.65;
580 }
581
582 .since {
583         font-weight: normal;
584         font-size: initial;
585         position: absolute;
586         right: 0;
587         top: 0;
588 }
589
590 .variants_table {
591         width: 100%;
592 }
593
594 .variants_table tbody tr td:first-child {
595         width: 1%; /* make the variant name as small as possible */
596 }
597
598 td.summary-column {
599         width: 100%;
600 }
601
602 .summary {
603         padding-right: 0px;
604 }
605
606 pre.rust .question-mark {
607         font-weight: bold;
608 }
609
610 pre.rust { position: relative; }
611 a.test-arrow {
612         display: inline-block;
613         position: absolute;
614         padding: 5px 10px 5px 10px;
615         border-radius: 5px;
616         font-size: 130%;
617         top: 5px;
618         right: 5px;
619 }
620 a.test-arrow:hover{
621         text-decoration: none;
622 }
623
624 .section-header:hover a:after {
625         content: '\2002\00a7\2002';
626 }
627
628 .section-header:hover a {
629         text-decoration: none;
630 }
631
632 .section-header a {
633         color: inherit;
634 }
635
636 .collapse-toggle {
637         font-weight: 300;
638         position: absolute;
639         left: -23px;
640         color: #999;
641         top: 0;
642 }
643
644 h3 > .collapse-toggle, h4 > .collapse-toggle {
645         font-size: 0.8em;
646         top: 5px;
647 }
648
649 .toggle-wrapper > .collapse-toggle {
650         left: -24px;
651         margin-top: 0px;
652 }
653
654 .toggle-wrapper {
655         position: relative;
656 }
657
658 .toggle-wrapper.collapsed {
659         height: 1em;
660         transition: height .2s;
661 }
662
663 .collapse-toggle > .inner {
664         display: inline-block;
665         width: 1.2ch;
666         text-align: center;
667 }
668
669 .ghost {
670         display: none;
671 }
672
673 .ghost + .since {
674         position: initial;
675         display: table-cell;
676 }
677
678 .since + .srclink {
679         display: table-cell;
680         padding-left: 10px;
681 }
682
683 .item-spacer {
684         width: 100%;
685         height: 12px;
686 }
687
688 span.since {
689         position: initial;
690         font-size: 20px;
691         margin-right: 5px;
692 }
693
694 .toggle-wrapper > .collapse-toggle {
695         left: 0;
696 }
697
698 .variant + .toggle-wrapper + .docblock > p {
699         margin-top: 5px;
700 }
701
702 .variant + .toggle-wrapper > a {
703         margin-top: 5px;
704 }
705
706 .sub-variant, .sub-variant > h3 {
707         margin-top: 0 !important;
708 }
709
710 .enum > .toggle-wrapper + .docblock, .struct > .toggle-wrapper + .docblock {
711         margin-left: 30px;
712         margin-bottom: 20px;
713         margin-top: 5px;
714 }
715
716 .enum > .collapsed, .struct > .collapsed {
717         margin-bottom: 25px;
718 }
719
720 #main > .variant, #main > .structfield {
721         display: block;
722 }
723
724 .attributes {
725         display: block;
726         margin: 0px 0px 0px 30px !important;
727 }
728 .toggle-attributes.collapsed {
729         margin-bottom: 5px;
730 }
731
732 :target > code {
733         opacity: 1;
734 }
735
736 /* Media Queries */
737
738 @media (max-width: 700px) {
739         body {
740                 padding-top: 0px;
741         }
742
743         .sidebar {
744                 height: 40px;
745                 min-height: 40px;
746                 width: 100%;
747                 margin: 0px;
748                 padding: 0px;
749                 position: static;
750         }
751
752         .sidebar .location {
753                 float: right;
754                 margin: 0px;
755                 padding: 3px 10px 1px 10px;
756                 min-height: 39px;
757                 background: inherit;
758                 text-align: left;
759                 font-size: 24px;
760         }
761
762         .sidebar .location:empty {
763                 padding: 0;
764         }
765
766         .sidebar img {
767                 width: 35px;
768                 margin-top: 5px;
769                 margin-bottom: 0px;
770                 float: left;
771         }
772
773         nav.sub {
774                 margin: 0 auto;
775         }
776
777         .sidebar .block {
778                 display: none;
779         }
780
781         .content {
782                 margin-left: 0px;
783         }
784
785         .content .in-band {
786                 width: 100%;
787         }
788
789         .content .out-of-band {
790                 display: none;
791         }
792
793         .toggle-wrapper > .collapse-toggle {
794                 left: 0px;
795         }
796
797         .toggle-wrapper {
798                 height: 1.5em;
799         }
800 }
801
802 @media print {
803         nav.sub, .content .out-of-band, .collapse-toggle {
804                 display: none;
805         }
806 }