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