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