]> git.lizzy.rs Git - rust.git/blob - src/librustdoc/html/static/main.css
Rollup merge of #25614 - parir:patch-2, r=alexcrichton
[rust.git] / src / librustdoc / html / static / main.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 @font-face {
13     font-family: 'Fira Sans';
14     font-style: normal;
15     font-weight: 400;
16     src: local('Fira Sans'), url("FiraSans-Regular.woff") format('woff');
17 }
18 @font-face {
19     font-family: 'Fira Sans';
20     font-style: normal;
21     font-weight: 500;
22     src: local('Fira Sans Medium'), url("FiraSans-Medium.woff") format('woff');
23 }
24 @font-face {
25     font-family: 'Source Serif Pro';
26     font-style: normal;
27     font-weight: 400;
28     src: local('Source Serif Pro'), url("SourceSerifPro-Regular.woff") format('woff');
29 }
30 @font-face {
31     font-family: 'Source Serif Pro';
32     font-style: italic;
33     font-weight: 400;
34     src: url("Heuristica-Italic.woff") format('woff');
35 }
36 @font-face {
37     font-family: 'Source Serif Pro';
38     font-style: normal;
39     font-weight: 700;
40     src: local('Source Serif Pro Bold'), url("SourceSerifPro-Bold.woff") format('woff');
41 }
42 @font-face {
43     font-family: 'Source Code Pro';
44     font-style: normal;
45     font-weight: 400;
46     src: local('Source Code Pro'), url("SourceCodePro-Regular.woff") format('woff');
47 }
48 @font-face {
49     font-family: 'Source Code Pro';
50     font-style: normal;
51     font-weight: 600;
52     src: local('Source Code Pro Semibold'), url("SourceCodePro-Semibold.woff") format('woff');
53 }
54
55 @import "normalize.css";
56
57 * {
58   -webkit-box-sizing: border-box;
59      -moz-box-sizing: border-box;
60           box-sizing: border-box;
61 }
62
63 /* General structure and fonts */
64
65 body {
66     color: #333;
67     font: 16px/1.4 "Source Serif Pro", Georgia, Times, "Times New Roman", serif;
68     margin: 0;
69     position: relative;
70     padding: 10px 15px 20px 15px;
71
72     -webkit-font-feature-settings: "kern", "liga";
73     -moz-font-feature-settings: "kern", "liga";
74     font-feature-settings: "kern", "liga";
75 }
76
77 h1 {
78     font-size: 1.5em;
79 }
80 h2 {
81     font-size: 1.4em;
82 }
83 h3 {
84     font-size: 1.3em;
85 }
86 h1, h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod) {
87     color: black;
88     font-weight: 500;
89     margin: 20px 0 15px 0;
90     padding-bottom: 6px;
91 }
92 h1.fqn {
93     border-bottom: 1px dashed #D5D5D5;
94     margin-top: 0;
95 }
96 h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod) {
97     border-bottom: 1px solid #DDDDDD;
98 }
99 h3.impl, h3.method, h4.method, h3.type, h4.type {
100     font-weight: 600;
101     margin-top: 10px;
102     margin-bottom: 10px;
103 }
104 h3.impl, h3.method, h3.type {
105     margin-top: 15px;
106 }
107 h1, h2, h3, h4, section.sidebar, a.source, .search-input, .content table :not(code)>a, .collapse-toggle {
108     font-family: "Fira Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
109 }
110
111 ol, ul {
112     padding-left: 25px;
113 }
114 ul ul, ol ul, ul ol, ol ol {
115     margin-bottom: 0;
116 }
117
118 p {
119     margin: 0 0 .6em 0;
120 }
121
122 code, pre {
123     font-family: "Source Code Pro", Menlo, Monaco, Consolas, "DejaVu Sans Mono", Inconsolata, monospace;
124     white-space: pre-wrap;
125 }
126 .docblock code {
127     background-color: #F5F5F5;
128     border-radius: 3px;
129     padding: 0 0.2em;
130 }
131 pre {
132     background-color: #F5F5F5;
133     padding: 14px;
134 }
135
136 .source pre {
137     padding: 20px;
138 }
139
140 .content.source {
141     margin-top: 50px;
142     max-width: none;
143     overflow: visible;
144     margin-left: 0px;
145     min-width: 70em;
146 }
147
148 nav.sub {
149     font-size: 16px;
150     text-transform: uppercase;
151 }
152
153 .sidebar {
154     width: 200px;
155     position: absolute;
156     left: 0;
157     top: 0;
158     min-height: 100%;
159 }
160
161 .content, nav { max-width: 960px; }
162
163 /* Everything else */
164
165 .js-only, .hidden { display: none; }
166
167 .sidebar {
168     padding: 10px;
169 }
170 .sidebar img {
171     margin: 20px auto;
172     display: block;
173 }
174
175 .sidebar .location {
176     font-size: 17px;
177     margin: 30px 0 20px 0;
178     background: #e1e1e1;
179     text-align: center;
180     color: #333;
181 }
182
183 .location a:first-child { font-weight: 500; }
184
185 .block {
186     padding: 0 10px;
187     margin-bottom: 14px;
188 }
189 .block h2 {
190     margin-top: 0;
191     margin-bottom: 8px;
192     text-align: center;
193 }
194
195 .block a {
196     display: block;
197     text-overflow: ellipsis;
198     overflow: hidden;
199     line-height: 15px;
200     padding: 7px 5px;
201     font-size: 14px;
202     font-weight: 300;
203     transition: border 500ms ease-out;
204 }
205
206 .block a:hover {
207     background: #F5F5F5;
208 }
209
210 .content {
211     padding: 15px 0;
212 }
213
214 .content.source pre.rust {
215     white-space: pre;
216     overflow: auto;
217     padding-left: 0;
218 }
219 .content pre.line-numbers {
220     float: left;
221     border: none;
222     position: relative;
223
224     -webkit-user-select: none;
225     -moz-user-select: none;
226     -ms-user-select: none;
227     user-select: none;
228 }
229 .line-numbers span { color: #c67e2d; cursor: pointer; }
230 .line-numbers .line-highlighted {
231     background-color: #f6fdb0 !important;
232 }
233
234 .content .highlighted {
235     color: #000 !important;
236     background-color: #ccc;
237 }
238 .content .highlighted a, .content .highlighted span { color: #000 !important; }
239 .content .highlighted.trait { background-color: #fece7e; }
240 .content .highlighted.mod { background-color: #afc6e4; }
241 .content .highlighted.enum { background-color: #b4d1b9; }
242 .content .highlighted.struct { background-color: #e7b1a0; }
243 .content .highlighted.fn { background-color: #c6afb3; }
244 .content .highlighted.method { background-color: #c6afb3; }
245 .content .highlighted.tymethod { background-color: #c6afb3; }
246 .content .highlighted.type { background-color: #c6afb3; }
247
248 .docblock.short p {
249     display: inline;
250 }
251
252 .docblock.short.nowrap {
253     display: block;
254     overflow: hidden;
255     white-space: nowrap;
256     text-overflow: ellipsis;
257 }
258
259 .docblock.short p {
260     overflow: hidden;
261     text-overflow: ellipsis;
262     margin: 0;
263 }
264 .docblock.short code { white-space: nowrap; }
265
266 .docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5 {
267     border-bottom: 1px solid #DDD;
268 }
269
270 .docblock h1 { font-size: 1.3em; }
271 .docblock h2 { font-size: 1.15em; }
272 .docblock h3, .docblock h4, .docblock h5 { font-size: 1em; }
273
274 .content .out-of-band {
275     font-size: 23px;
276     width: 40%;
277     margin: 0px;
278     padding: 0px;
279     text-align: right;
280     display: inline-block;
281 }
282
283 .content .in-band {
284     width: 60%;
285     margin: 0px;
286     padding: 0px;
287     display: inline-block;
288 }
289
290 .content table {
291     border-spacing: 0 5px;
292     border-collapse: separate;
293 }
294 .content td { vertical-align: top; }
295 .content td:first-child { padding-right: 20px; }
296 .content td p:first-child { margin-top: 0; }
297 .content td h1, .content td h2 { margin-left: 0; font-size: 1.1em; }
298
299 .docblock table {
300     border: 1px solid #ddd;
301     margin: .5em 0;
302     border-collapse: collapse;
303     width: 100%;
304 }
305
306 .docblock table td {
307     padding: .5em;
308     border-top: 1px dashed #ddd;
309     border-bottom: 1px dashed #ddd;
310
311 }
312
313 .docblock table th {
314     padding: .5em;
315     text-align: left;
316     border-top: 1px solid #ddd;
317     border-bottom: 1px solid #ddd;
318 }
319
320 .content .item-list {
321     list-style-type: none;
322     padding: 0;
323 }
324
325 .content .item-list li { margin-bottom: 3px; }
326
327 .content .multi-column {
328     -moz-column-count: 5;
329     -moz-column-gap: 2.5em;
330     -webkit-column-count: 5;
331     -webkit-column-gap: 2.5em;
332     column-count: 5;
333     column-gap: 2.5em;
334 }
335 .content .multi-column li { width: 100%; display: inline-block; }
336
337 .content .method {
338     font-size: 1em;
339     position: relative;
340 }
341 /* Shift "where ..." part of method definition down a line */
342 .content .method .where { display: block; }
343 /* Bit of whitespace to indent it */
344 .content .method .where::before { content: '  '; }
345
346 .content .methods > div { margin-left: 40px; }
347
348 .content .impl-items .docblock, .content .impl-items .stability {
349     margin-left: 40px;
350 }
351 .content .impl-items .method, .content .impl-items > .type {
352     margin-left: 20px;
353 }
354
355 nav {
356     border-bottom: 1px solid #e0e0e0;
357     padding-bottom: 10px;
358     margin-bottom: 10px;
359 }
360 nav.main {
361     padding: 20px 0;
362     text-align: center;
363 }
364 nav.main .current {
365     border-top: 1px solid #000;
366     border-bottom: 1px solid #000;
367 }
368 nav.main .separator {
369     border: 1px solid #000;
370     display: inline-block;
371     height: 23px;
372     margin: 0 20px;
373 }
374 nav.sum { text-align: right; }
375 nav.sub form { display: inline; }
376
377 nav, .content {
378     margin-left: 230px;
379 }
380
381 a {
382     text-decoration: none;
383     color: #000;
384     background: transparent;
385 }
386
387 .docblock a {
388     color: #4e8bca;
389 }
390
391 .docblock a:hover {
392     text-decoration: underline;
393 }
394
395 .content span.trait, .content a.trait, .block a.current.trait { color: #8866ff; }
396 .content span.mod, .content a.mod, block a.current.mod { color: #4d76ae; }
397 .content span.enum, .content a.enum, .block a.current.enum { color: #5e9766; }
398 .content span.struct, .content a.struct, .block a.current.struct { color: #e53700; }
399 .content span.fn, .content a.fn, .block a.current.fn { color: #8c6067; }
400 .content span.method, .content a.method, .block a.current.method { color: #8c6067; }
401 .content span.tymethod, .content a.tymethod, .block a.current.tymethod { color: #8c6067; }
402 .content .fnname { color: #8c6067; }
403
404 .search-input {
405     width: 100%;
406     /* Override Normalize.css: we have margins and do
407      not want to overflow - the `moz` attribute is necessary
408      until Firefox 29, too early to drop at this point */
409     -moz-box-sizing: border-box !important;
410     box-sizing: border-box !important;
411     outline: none;
412     border: none;
413     border-radius: 1px;
414     color: #555;
415     margin-top: 5px;
416     padding: 10px 16px;
417     font-size: 17px;
418     box-shadow: 0 0 0 1px #e0e0e0, 0 0 0 2px transparent;
419     transition: border-color 300ms ease;
420     transition: border-radius 300ms ease-in-out;
421     transition: box-shadow 300ms ease-in-out;
422 }
423
424 .search-input:focus {
425     border-color: #66afe9;
426     border-radius: 2px;
427     border: 0;
428     outline: 0;
429     box-shadow: 0 0 8px #078dd8;
430 }
431
432 .search-results .desc {
433     white-space: nowrap;
434     text-overflow: ellipsis;
435     overflow: hidden;
436     display: block;
437 }
438
439 .search-results a {
440     display: block;
441 }
442
443 .content .search-results td:first-child { padding-right: 0; }
444 .content .search-results td:first-child a { padding-right: 10px; }
445
446 #help {
447     background: #e9e9e9;
448     border-radius: 4px;
449     box-shadow: 0 0 6px rgba(0,0,0,.2);
450     position: absolute;
451     top: 300px;
452     left: 50%;
453     margin-top: -125px;
454     margin-left: -275px;
455     width: 550px;
456     height: 300px;
457     border: 1px solid #bfbfbf;
458 }
459
460 #help dt {
461     float: left;
462     border-radius: 3px;
463     border: 1px solid #bfbfbf;
464     background: #fff;
465     width: 23px;
466     text-align: center;
467     clear: left;
468     display: block;
469     margin-top: -1px;
470 }
471 #help dd { margin: 5px 33px; }
472 #help .infos { padding-left: 0; }
473 #help h1 { margin-top: 0; }
474 #help div {
475     width: 50%;
476     float: left;
477     padding: 20px;
478 }
479
480 em.stab.unstable { background: #FFF5D6; border-color: #FFC600; }
481 em.stab.deprecated { background: #F3DFFF; border-color: #7F0087; }
482 em.stab {
483     display: inline-block;
484     border-width: 1px;
485     border-style: solid;
486     padding: 3px;
487     margin-bottom: 5px;
488     font-size: 90%;
489     font-style: normal;
490 }
491 em.stab p {
492     display: inline;
493 }
494
495 .module-item .stab {
496     border-width: 0;
497     padding: 0;
498     margin: 0;
499     background: inherit !important;
500 }
501
502 .module-item.unstable {
503     opacity: 0.65;
504 }
505
506 td.summary-column {
507     width: 100%;
508 }
509
510 .summary {
511     padding-right: 0px;
512 }
513
514 :target { background: #FDFFD3; }
515 .line-numbers :target { background-color: transparent; }
516
517 /* Code highlighting */
518 pre.rust .kw { color: #8959A8; }
519 pre.rust .kw-2, pre.rust .prelude-ty { color: #4271AE; }
520 pre.rust .number, pre.rust .string { color: #718C00; }
521 pre.rust .self, pre.rust .boolval, pre.rust .prelude-val,
522 pre.rust .attribute, pre.rust .attribute .ident { color: #C82829; }
523 pre.rust .comment { color: #8E908C; }
524 pre.rust .doccomment { color: #4D4D4C; }
525 pre.rust .macro, pre.rust .macro-nonterminal { color: #3E999F; }
526 pre.rust .lifetime { color: #B76514; }
527
528 .rusttest { display: none; }
529 pre.rust { position: relative; }
530 .test-arrow {
531     display: inline-block;
532     position: absolute;
533     top: 0;
534     right: 10px;
535     font-size: 150%;
536     -webkit-transform: scaleX(-1);
537     transform: scaleX(-1);
538 }
539
540 .methods .section-header {
541     /* Override parent class attributes. */
542     border-bottom: none !important;
543     font-size: 1.1em !important;
544     margin: 0 0 -5px;
545     padding: 0;
546 }
547
548 .section-header:hover a:after {
549     content: '\2002\00a7\2002';
550 }
551
552 .section-header:hover a {
553     text-decoration: none;
554 }
555
556 .section-header a {
557     color: inherit;
558 }
559
560 .collapse-toggle {
561     font-weight: 300;
562     position: absolute;
563     left: -23px;
564     color: #999;
565     top: 0;
566 }
567
568 .toggle-wrapper > .collapse-toggle {
569     left: -24px;
570     margin-top: 0px;
571 }
572
573 .toggle-wrapper {
574     position: relative;
575 }
576
577 .toggle-wrapper.collapsed {
578     height: 1em;
579     transition: height .2s;
580 }
581
582 .collapse-toggle > .inner {
583     display: inline-block;
584     width: 1.2ch;
585     text-align: center;
586 }
587
588 .toggle-label {
589     color: #999;
590 }
591
592
593
594 /* Media Queries */
595
596 @media (max-width: 700px) {
597     body {
598         padding-top: 0px;
599     }
600
601     .sidebar {
602         height: 40px;
603         min-height: 40px;
604         width: 100%;
605         margin: 0px;
606         padding: 0px;
607         position: static;
608     }
609
610     .sidebar .location {
611         float: left;
612         margin: 0px;
613         padding: 5px;
614         width: 60%;
615         background: inherit;
616         text-align: left;
617         font-size: 24px;
618     }
619
620     .sidebar img {
621         width: 35px;
622         margin-top: 5px;
623         margin-bottom: 0px;
624         float: left;
625     }
626
627     nav.sub {
628         margin: 0 auto;
629     }
630
631     .sidebar .block {
632         display: none;
633     }
634
635     .content {
636         margin-left: 0px;
637     }
638
639     .content .in-band {
640         width: 100%;
641     }
642
643     .content .out-of-band {
644         display: none;
645     }
646
647     .toggle-wrapper > .collapse-toggle {
648         left: 0px;
649     }
650
651     .toggle-wrapper {
652         height: 1.5em;
653     }
654 }
655
656 @media print {
657     nav.sub, .content .out-of-band, .collapse-toggle {
658         display: none;
659     }
660 }