]> git.lizzy.rs Git - rust.git/blob - src/librustdoc/html/static/rustdoc.css
Improve color theme for color blind issues
[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 code, pre {
130         font-family: "Source Code Pro", Menlo, Monaco, Consolas, "DejaVu Sans Mono", Inconsolata, monospace;
131         white-space: pre-wrap;
132 }
133 .docblock code, .docblock-short code {
134         border-radius: 3px;
135         padding: 0 0.2em;
136 }
137 .docblock pre code, .docblock-short pre code {
138         padding: 0;
139 }
140 pre {
141         padding: 14px;
142 }
143
144 .source .content pre {
145         padding: 20px;
146 }
147
148 img {
149         max-width: 100%;
150 }
151
152 .source .content {
153         margin-top: 50px;
154         max-width: none;
155         overflow: visible;
156         margin-left: 0px;
157         min-width: 70em;
158 }
159
160 nav.sub {
161         font-size: 16px;
162         text-transform: uppercase;
163 }
164
165 .sidebar {
166         width: 200px;
167         position: absolute;
168         left: 0;
169         top: 0;
170         min-height: 100%;
171 }
172
173 .sidebar .current {
174         margin-right: -20px;
175 }
176
177 .content, nav { max-width: 960px; }
178
179 /* Everything else */
180
181 .js-only, .hidden { display: none !important; }
182
183 .sidebar {
184         padding: 10px;
185 }
186 .sidebar img {
187         margin: 20px auto;
188         display: block;
189 }
190
191 .sidebar .location {
192         border: 1px solid;
193         font-size: 17px;
194         margin: 30px 0 20px 0;
195         text-align: center;
196         word-wrap: break-word;
197 }
198
199 .location:empty {
200         border: none;
201 }
202
203 .location a:first-child { font-weight: 500; }
204
205 .block {
206         padding: 0 10px;
207         margin-bottom: 14px;
208 }
209 .block h2, .block h3 {
210         margin-top: 0;
211         margin-bottom: 8px;
212         text-align: center;
213 }
214 .block ul, .block li {
215         margin: 0;
216         padding: 0;
217         list-style: none;
218 }
219
220 .block a {
221         display: block;
222         text-overflow: ellipsis;
223         overflow: hidden;
224         line-height: 15px;
225         padding: 7px 5px;
226         font-size: 14px;
227         font-weight: 300;
228         transition: border 500ms ease-out;
229 }
230
231 .content {
232         padding: 15px 0;
233 }
234
235 .source .content pre.rust {
236         white-space: pre;
237         overflow: auto;
238         padding-left: 0;
239 }
240 #search {
241         margin-left: 230px;
242 }
243 .content pre.line-numbers {
244         float: left;
245         border: none;
246         position: relative;
247
248         -webkit-user-select: none;
249         -moz-user-select: none;
250         -ms-user-select: none;
251         user-select: none;
252 }
253 .line-numbers span { cursor: pointer; }
254
255 .docblock-short p {
256         display: inline;
257 }
258
259 .docblock-short.nowrap {
260         display: block;
261         overflow: hidden;
262         white-space: nowrap;
263         text-overflow: ellipsis;
264 }
265
266 .docblock-short p {
267         overflow: hidden;
268         text-overflow: ellipsis;
269         margin: 0;
270 }
271 .docblock-short code { white-space: nowrap; }
272
273 .docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5 {
274         border-bottom: 1px solid;
275 }
276
277 .docblock h1 { font-size: 1.3em; }
278 .docblock h2 { font-size: 1.15em; }
279 .docblock h3, .docblock h4, .docblock h5 { font-size: 1em; }
280
281 .docblock {
282         margin-left: 24px;
283 }
284
285 .content .out-of-band {
286         font-size: 23px;
287         margin: 0px;
288         padding: 0px;
289         text-align: right;
290         display: inline-block;
291         font-weight: normal;
292         position: absolute;
293         right: 0;
294 }
295
296 h3.impl > .out-of-band {
297         font-size: 21px;
298 }
299
300 h4 > code, h3 > code, .invisible > code {
301         position: inherit;
302 }
303
304 .in-band, code {
305         z-index: 5;
306 }
307
308 .invisible {
309         background: rgba(0, 0, 0, 0);
310         width: 100%;
311         display: inline-block;
312 }
313
314 .content .in-band {
315         margin: 0px;
316         padding: 0px;
317         display: inline-block;
318 }
319
320 #main { position: relative; }
321 #main > .since {
322         top: inherit;
323         font-family: "Fira Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
324 }
325
326 .content table {
327         border-spacing: 0 5px;
328         border-collapse: separate;
329 }
330 .content td { vertical-align: top; }
331 .content td:first-child { padding-right: 20px; }
332 .content td p:first-child { margin-top: 0; }
333 .content td h1, .content td h2 { margin-left: 0; font-size: 1.1em; }
334
335 .docblock table {
336         border: 1px solid;
337         margin: .5em 0;
338         border-collapse: collapse;
339         width: 100%;
340 }
341
342 .docblock table td {
343         padding: .5em;
344         border-top: 1px dashed;
345         border-bottom: 1px dashed;
346 }
347
348 .docblock table th {
349         padding: .5em;
350         text-align: left;
351         border-top: 1px solid;
352         border-bottom: 1px solid;
353 }
354
355 .fields + table {
356         margin-bottom: 1em;
357 }
358
359 .content .item-list {
360         list-style-type: none;
361         padding: 0;
362 }
363
364 .content .item-list li { margin-bottom: 3px; }
365
366 .content .multi-column {
367         -moz-column-count: 5;
368         -moz-column-gap: 2.5em;
369         -webkit-column-count: 5;
370         -webkit-column-gap: 2.5em;
371         column-count: 5;
372         column-gap: 2.5em;
373 }
374 .content .multi-column li { width: 100%; display: inline-block; }
375
376 .content .method {
377         font-size: 1em;
378         position: relative;
379 }
380 /* Shift "where ..." part of method or fn definition down a line */
381 .content .method .where,
382 .content .fn .where,
383 .content .where.fmt-newline {
384         display: block;
385         color: #4E4C4C;
386         font-size: 0.8em;
387 }
388
389 .content .methods > div { margin-left: 40px; }
390
391 .content .impl-items .docblock, .content .impl-items .stability {
392         margin-left: 40px;
393 }
394 .content .impl-items .method, .content .impl-items > .type, .impl-items > .associatedconstant {
395         margin-left: 20px;
396 }
397
398 .content .stability code {
399         font-size: 90%;
400 }
401
402 nav {
403         border-bottom: 1px solid;
404         padding-bottom: 10px;
405         margin-bottom: 10px;
406 }
407 nav.main {
408         padding: 20px 0;
409         text-align: center;
410 }
411 nav.main .current {
412         border-top: 1px solid;
413         border-bottom: 1px solid;
414 }
415 nav.main .separator {
416         border: 1px solid;
417         display: inline-block;
418         height: 23px;
419         margin: 0 20px;
420 }
421 nav.sum { text-align: right; }
422 nav.sub form { display: inline; }
423
424 nav.sub, .content {
425         margin-left: 230px;
426 }
427
428 a {
429         text-decoration: none;
430         background: transparent;
431 }
432
433 .docblock a:hover, .docblock-short a:hover, .stability a {
434         text-decoration: underline;
435 }
436
437 .block a.current.crate { font-weight: 500; }
438
439 .search-input {
440         width: 100%;
441         /* Override Normalize.css: we have margins and do
442          not want to overflow - the `moz` attribute is necessary
443          until Firefox 29, too early to drop at this point */
444         -moz-box-sizing: border-box !important;
445         box-sizing: border-box !important;
446         outline: none;
447         border: none;
448         border-radius: 1px;
449         margin-top: 5px;
450         padding: 10px 16px;
451         font-size: 17px;
452         transition: border-color 300ms ease;
453         transition: border-radius 300ms ease-in-out;
454         transition: box-shadow 300ms ease-in-out;
455 }
456
457 .search-input:focus {
458         border-color: #66afe9;
459         border-radius: 2px;
460         border: 0;
461         outline: 0;
462         box-shadow: 0 0 8px #078dd8;
463 }
464
465 .search-results .desc {
466         white-space: nowrap;
467         text-overflow: ellipsis;
468         overflow: hidden;
469         display: block;
470 }
471
472 .search-results a {
473         display: block;
474 }
475
476 .content .search-results td:first-child { padding-right: 0; }
477 .content .search-results td:first-child a { padding-right: 10px; }
478
479 tr.result span.primitive::after { content: ' (primitive type)'; font-style: italic; color: black;
480 }
481
482 body.blur > :not(#help) {
483         filter: blur(8px);
484         -webkit-filter: blur(8px);
485         opacity: .7;
486 }
487
488 #help {
489         width: 100%;
490         height: 100vh;
491         position: fixed;
492         top: 0;
493         left: 0;
494         display: flex;
495         justify-content: center;
496         align-items: center;
497 }
498 #help > div {
499         flex: 0 0 auto;
500         box-shadow: 0 0 6px rgba(0,0,0,.2);
501         width: 550px;
502         height: 330px;
503         border: 1px solid;
504 }
505 #help dt {
506         float: left;
507         border-radius: 4px;
508         border: 1px solid;
509         width: 23px;
510         text-align: center;
511         clear: left;
512         display: block;
513         margin-top: -1px;
514 }
515 #help dd { margin: 5px 33px; }
516 #help .infos { padding-left: 0; }
517 #help h1, #help h2 { margin-top: 0; }
518 #help > div div {
519         width: 50%;
520         float: left;
521         padding: 20px;
522 }
523
524 .stab {
525         display: table;
526         border-width: 1px;
527         border-style: solid;
528         padding: 3px;
529         margin-bottom: 5px;
530         font-size: 90%;
531 }
532 .stab p {
533         display: inline;
534 }
535
536 .stab summary {
537         display: list-item;
538 }
539
540 .stab .microscope {
541         font-size: 1.5em;
542 }
543
544 .module-item .stab {
545         display: inline;
546         border-width: 0;
547         padding: 0;
548         margin: 0;
549         background: inherit !important;
550 }
551
552 .module-item.unstable {
553         opacity: 0.65;
554 }
555
556 .since {
557         font-weight: normal;
558         font-size: initial;
559         position: absolute;
560         right: 0;
561         top: 0;
562 }
563
564 .variants_table {
565         width: 100%;
566 }
567
568 .variants_table tbody tr td:first-child {
569         width: 1%; /* make the variant name as small as possible */
570 }
571
572 td.summary-column {
573         width: 100%;
574 }
575
576 .summary {
577         padding-right: 0px;
578 }
579
580 pre.rust .question-mark {
581         font-weight: bold;
582 }
583
584 pre.rust { position: relative; }
585 a.test-arrow {
586         display: inline-block;
587         position: absolute;
588         padding: 5px 10px 5px 10px;
589         border-radius: 5px;
590         font-size: 130%;
591         top: 5px;
592         right: 5px;
593 }
594 a.test-arrow:hover{
595         text-decoration: none;
596 }
597
598 .section-header:hover a:after {
599         content: '\2002\00a7\2002';
600 }
601
602 .section-header:hover a {
603         text-decoration: none;
604 }
605
606 .section-header a {
607         color: inherit;
608 }
609
610 .collapse-toggle {
611         font-weight: 300;
612         position: absolute;
613         left: -23px;
614         color: #999;
615         top: 0;
616 }
617
618 h3 > .collapse-toggle, h4 > .collapse-toggle {
619         font-size: 0.8em;
620         top: 5px;
621 }
622
623 .toggle-wrapper > .collapse-toggle {
624         left: -24px;
625         margin-top: 0px;
626 }
627
628 .toggle-wrapper {
629         position: relative;
630 }
631
632 .toggle-wrapper.collapsed {
633         height: 1em;
634         transition: height .2s;
635 }
636
637 .collapse-toggle > .inner {
638         display: inline-block;
639         width: 1.2ch;
640         text-align: center;
641 }
642
643 .ghost {
644         display: none;
645 }
646
647 .ghost + .since {
648         position: initial;
649         display: table-cell;
650 }
651
652 .since + .srclink {
653         display: table-cell;
654         padding-left: 10px;
655 }
656
657 .item-spacer {
658         width: 100%;
659         height: 12px;
660 }
661
662 span.since {
663         position: initial;
664         font-size: 20px;
665         margin-right: 5px;
666 }
667
668 .toggle-wrapper > .collapse-toggle {
669         left: 0;
670 }
671
672 .variant + .toggle-wrapper > a {
673         margin-top: 5px;
674 }
675
676 .sub-variant, .sub-variant > h3 {
677         margin-top: 0 !important;
678 }
679
680 .enum > .toggle-wrapper + .docblock, .struct > .toggle-wrapper + .docblock {
681         margin-left: 30px;
682         margin-bottom: 20px;
683         margin-top: 5px;
684 }
685
686 .enum > .collapsed, .struct > .collapsed {
687         margin-bottom: 25px;
688 }
689
690 .enum .variant, .struct .structfield {
691         display: block;
692 }
693
694 .attributes {
695         display: block;
696         margin: 0px 0px 0px 30px !important;
697 }
698 .toggle-attributes.collapsed {
699         margin-bottom: 5px;
700 }
701
702 :target > code {
703         opacity: 1;
704 }
705
706 /* Media Queries */
707
708 @media (max-width: 700px) {
709         body {
710                 padding-top: 0px;
711         }
712
713         .sidebar {
714                 height: 40px;
715                 min-height: 40px;
716                 width: 100%;
717                 margin: 0px;
718                 padding: 0px;
719                 position: static;
720         }
721
722         .sidebar .location {
723                 float: right;
724                 margin: 0px;
725                 padding: 3px 10px 1px 10px;
726                 min-height: 39px;
727                 background: inherit;
728                 text-align: left;
729                 font-size: 24px;
730         }
731
732         .sidebar .location:empty {
733                 padding: 0;
734         }
735
736         .sidebar img {
737                 width: 35px;
738                 margin-top: 5px;
739                 margin-bottom: 0px;
740                 float: left;
741         }
742
743         nav.sub {
744                 margin: 0 auto;
745         }
746
747         .sidebar .block {
748                 display: none;
749         }
750
751         .content {
752                 margin-left: 0px;
753         }
754
755         .content .in-band {
756                 width: 100%;
757         }
758
759         .content .out-of-band {
760                 display: none;
761         }
762
763         .toggle-wrapper > .collapse-toggle {
764                 left: 0px;
765         }
766
767         .toggle-wrapper {
768                 height: 1.5em;
769         }
770 }
771
772 @media print {
773         nav.sub, .content .out-of-band, .collapse-toggle {
774                 display: none;
775         }
776 }