]> git.lizzy.rs Git - rust.git/blob - src/librustdoc/html/static/main.css
rustdoc: Submit examples to play.rust-lang.org
[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: 'Heuristica';
26     font-style: normal;
27     font-weight: 400;
28     src: local('Heuristica Regular'), url("Heuristica-Regular.woff") format('woff');
29 }
30 @font-face {
31     font-family: 'Heuristica';
32     font-style: italic;
33     font-weight: 400;
34     src: local('Heuristica Italic'), url("Heuristica-Italic.woff") format('woff');
35 }
36 @font-face {
37     font-family: 'Heuristica';
38     font-style: normal;
39     font-weight: 700;
40     src: local('Heuristica Bold'), url("Heuristica-Bold.woff") format('woff');
41 }
42
43 @import "normalize.css";
44
45 * {
46   -webkit-box-sizing: border-box;
47      -moz-box-sizing: border-box;
48           box-sizing: border-box;
49 }
50
51 /* General structure and fonts */
52
53 body {
54     color: #333;
55     min-width: 500px;
56     font: 15.5px/1.4 "Heuristica", "Helvetica Neue", Helvetica, Arial, sans-serif;
57     margin: 0;
58     position: relative;
59     padding: 10px 15px 20px 15px;
60 }
61
62 h1 {
63     font-size: 1.5em;
64 }
65 h2 {
66     font-size: 1.4em;
67 }
68 h3 {
69     font-size: 1.3em;
70 }
71 h1, h2, h3:not(.impl):not(.method), h4:not(.method) {
72     color: black;
73     font-weight: 500;
74     margin: 20px 0 15px 0;
75     padding-bottom: 6px;
76 }
77 h1.fqn {
78     border-bottom: 1px dashed #D5D5D5;
79     margin-top: 0;
80 }
81 h2, h3:not(.impl):not(.method), h4:not(.method) {
82     border-bottom: 1px solid #DDDDDD;
83 }
84 h3.impl, h3.method, h4.method {
85     font-weight: 600;
86     margin-top: 10px;
87     margin-bottom: 10px;
88 }
89 h3.impl, h3.method {
90     margin-top: 15px;
91 }
92 h1, h2, h3, h4, section.sidebar, a.source, .search-input, .content table a {
93     font-family: "Fira Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
94 }
95
96 ol, ul {
97     padding-left: 25px;
98 }
99 ul ul, ol ul, ul ol, ol ol {
100     margin-bottom: 0;
101 }
102
103 p {
104     margin: 0 0 .6em 0;
105 }
106
107 code, pre {
108     font-family: "Source Code Pro", Menlo, Monaco, Consolas, "DejaVu Sans Mono", Inconsolata, monospace;
109     white-space: pre-wrap;
110 }
111 pre {
112     background-color: #F5F5F5;
113     padding: 14px;
114 }
115
116 .source pre {
117     padding: 20px;
118 }
119
120 nav.sub {
121     font-size: 16px;
122     text-transform: uppercase;
123 }
124
125 .sidebar {
126     width: 200px;
127     position: absolute;
128     left: 0;
129     top: 0;
130     min-height: 100%;
131 }
132
133 .content, nav { max-width: 960px; }
134
135 /* Everything else */
136
137 .js-only, .hidden { display: none; }
138
139 .sidebar {
140     padding: 10px;
141 }
142 .sidebar img {
143     margin: 20px auto;
144     display: block;
145 }
146
147 .sidebar .location {
148     font-size: 17px;
149     margin: 30px 0 20px 0;
150     background: #e1e1e1;
151     text-align: center;
152     color: #333;
153 }
154
155 .block {
156     padding: 0 10px;
157     margin-bottom: 10px;
158 }
159 .block h2 {
160     margin-top: 0;
161     text-align: center;
162 }
163
164 .block a {
165     display: inline-block;
166     text-overflow: ellipsis;
167     overflow: hidden;
168     line-height: 15px;
169     padding-left: 5px;
170     padding-bottom: 6px;
171     font-size: 14px;
172     font-weight: 300;
173     transition: border 500ms ease-out;
174 }
175
176 .content {
177     padding: 15px 0;
178 }
179
180 .content.source pre.rust {
181     white-space: pre;
182     overflow: auto;
183     padding-left: 0;
184 }
185 .content pre.line-numbers { float: left; border: none; }
186 .line-numbers span { color: #c67e2d; }
187 .line-numbers .line-highlighted {
188     background-color: #f6fdb0;
189 }
190
191 .content .highlighted {
192     cursor: pointer;
193     color: #000 !important;
194     background-color: #ccc;
195 }
196 .content .highlighted a { color: #000 !important; }
197 .content .highlighted.trait { background-color: #fece7e; }
198 .content .highlighted.mod { background-color: #afc6e4; }
199 .content .highlighted.enum { background-color: #b4d1b9; }
200 .content .highlighted.struct { background-color: #e7b1a0; }
201 .content .highlighted.fn { background-color: #c6afb3; }
202
203 .docblock.short.nowrap {
204     display: block;
205     overflow: hidden;
206     white-space: nowrap;
207     text-overflow: ellipsis;
208 }
209
210 .docblock.short p {
211     overflow: hidden;
212     text-overflow: ellipsis;
213     margin: 0;
214 }
215 .docblock.short code { white-space: nowrap; }
216
217 .docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5 {
218     border-bottom: 1px solid #DDD;
219 }
220
221 .docblock h1 { font-size: 1.3em; }
222 .docblock h2 { font-size: 1.15em; }
223 .docblock h3, .docblock h4, .docblock h5 { font-size: 1em; }
224
225 .content .source {
226     float: right;
227     font-size: 23px;
228 }
229
230 .content table {
231     border-spacing: 0 5px;
232     border-collapse: separate;
233 }
234 .content td { vertical-align: top; }
235 .content td:first-child { padding-right: 20px; }
236 .content td p:first-child { margin-top: 0; }
237 .content td h1, .content td h2 { margin-left: 0; font-size: 1.1em; }
238
239 .content .item-list {
240     list-style-type: none;
241     padding: 0;
242 }
243
244 .content .item-list li { margin-bottom: 3px; }
245
246 .content .multi-column {
247     -moz-column-count: 5;
248     -moz-column-gap: 2.5em;
249     -webkit-column-count: 5;
250     -webkit-column-gap: 2.5em;
251     column-count: 5;
252     column-gap: 2.5em;
253 }
254 .content .multi-column li { width: 100%; display: inline-block; }
255
256 .content .method { font-size: 1em; }
257 .content .methods { margin-left: 20px; }
258 .content .methods .docblock { margin-left: 20px; }
259
260 nav {
261     border-bottom: 1px solid #e0e0e0;
262     padding-bottom: 10px;
263     margin-bottom: 10px;
264 }
265 nav.main {
266     padding: 20px 0;
267     text-align: center;
268 }
269 nav.main .current {
270     border-top: 1px solid #000;
271     border-bottom: 1px solid #000;
272 }
273 nav.main .separator {
274     border: 1px solid #000;
275     display: inline-block;
276     height: 23px;
277     margin: 0 20px;
278 }
279 nav.sum { text-align: right; }
280 nav.sub form { display: inline; }
281
282 nav, .content {
283     margin-left: 230px;
284 }
285
286 a {
287     text-decoration: none;
288     color: #000;
289     background: transparent;
290 }
291 p a { color: #4e8bca; }
292 p a:hover { text-decoration: underline; }
293
294 .content a.trait, .block a.current.trait { color: #ed9603; }
295 .content a.mod, .block a.current.mod { color: #4d76ae; }
296 .content a.enum, .block a.current.enum { color: #5e9766; }
297 .content a.struct, .block a.current.struct { color: #e53700; }
298 .content a.fn, .block a.current.fn { color: #8c6067; }
299 .content .fnname { color: #8c6067; }
300
301 .search-input {
302     width: 100%;
303     /* Override Normalize.css: we have margins and do
304      not want to overflow - the `moz` attribute is necessary
305      until Firefox 29, too early to drop at this point */
306     -moz-box-sizing: border-box !important;
307     box-sizing: border-box !important;
308     outline: none;
309     border: none;
310     border-radius: 1px;
311     color: #555;
312     margin-top: 5px;
313     padding: 10px 16px;
314     font-size: 17px;
315     box-shadow: 0 0 0 1px #e0e0e0, 0 0 0 2px transparent;
316     transition: border-color 300ms ease;
317     transition: border-radius 300ms ease-in-out;
318     transition: box-shadow 300ms ease-in-out;
319 }
320
321 .search-input:focus {
322     border-color: #66afe9;
323     border-radius: 2px;
324     border: 0;
325     outline: 0;
326     box-shadow: 0 0 8px #078dd8;
327 }
328
329 .search-results .desc {
330     white-space: nowrap;
331     text-overflow: ellipsis;
332     overflow: hidden;
333     display: block;
334 }
335
336 #help {
337     background: #e9e9e9;
338     border-radius: 4px;
339     box-shadow: 0 0 6px rgba(0,0,0,.2);
340     position: absolute;
341     top: 300px;
342     left: 50%;
343     margin-top: -125px;
344     margin-left: -275px;
345     width: 550px;
346     height: 250px;
347     border: 1px solid #bfbfbf;
348 }
349
350 #help dt {
351     float: left;
352     border-radius: 3px;
353     border: 1px solid #bfbfbf;
354     background: #fff;
355     width: 23px;
356     text-align: center;
357     clear: left;
358     display: block;
359     margin-top: -1px;
360 }
361 #help dd { margin: 5px 33px; }
362 #help .infos { padding-left: 0; }
363 #help h1 { margin-top: 0; }
364 #help div {
365     width: 50%;
366     float: left;
367     padding: 20px;
368 }
369
370 .stability {
371     border-left: 6px solid #000;
372     border-radius: 3px;
373     font-weight: 400;
374     padding: 4px 10px;
375     text-transform: lowercase;
376     margin-left: 14px;
377 }
378
379 .stability.Deprecated { border-color: #D60027; color: #880017; }
380 .stability.Experimental { border-color: #EC5315; color: #a53c0e; }
381 .stability.Unstable { border-color: #FFD700; color: #b39800; }
382 .stability.Stable { border-color: #AEC516; color: #7c8b10; }
383 .stability.Frozen { border-color: #009431; color: #007726; }
384 .stability.Locked { border-color: #0084B6; color: #00668c; }
385
386 :target { background: #FDFFD3; }
387
388 /* Code highlighting */
389 pre.rust .kw { color: #8959A8; }
390 pre.rust .kw-2, pre.rust .prelude-ty { color: #4271AE; }
391 pre.rust .number, pre.rust .string { color: #718C00; }
392 pre.rust .self, pre.rust .boolval, pre.rust .prelude-val,
393 pre.rust .attribute, pre.rust .attribute .ident { color: #C82829; }
394 pre.rust .comment { color: #8E908C; }
395 pre.rust .doccomment { color: #4D4D4C; }
396 pre.rust .macro, pre.rust .macro-nonterminal { color: #3E999F; }
397 pre.rust .lifetime { color: #B76514; }
398
399 .rusttest { display: none; }
400 pre.rust { position: relative; }
401 pre.rust a { transform: scaleX(-1); }
402 .test-arrow {
403     display: inline-block;
404     position: absolute;
405     top: 0;
406     right: 10px;
407     font-size: 150%;
408 }
409
410 .methods .section-header {
411     /* Override parent class attributes. */
412     border-bottom: none !important;
413     font-size: 1.1em !important;
414     margin: 0 0 -5px;
415     padding: 0;
416 }
417 .section-header:hover a:after {
418     content: '\2002\00a7\2002';
419 }
420
421 /* Media Queries */
422
423 @media (max-width: 700px) {
424     .sidebar {
425         display: none;
426     }
427
428     .content {
429         margin-left: 0px;
430     }
431
432     nav.sub {
433         margin: 0 auto;
434     }
435 }