]>
Commit | Line | Data |
---|---|---|
b039eaaf | 1 | /* See FiraSans-LICENSE.txt for the Fira Sans license. */ |
1a4d82fc | 2 | @font-face { |
476ff2be SL |
3 | font-family: 'Fira Sans'; |
4 | font-style: normal; | |
5 | font-weight: 400; | |
6a06907d XL |
6 | src: local('Fira Sans'), |
7 | url("FiraSans-Regular.woff2") format("woff2"), | |
8 | url("FiraSans-Regular.woff") format('woff'); | |
9 | font-display: swap; | |
1a4d82fc JJ |
10 | } |
11 | @font-face { | |
476ff2be SL |
12 | font-family: 'Fira Sans'; |
13 | font-style: normal; | |
14 | font-weight: 500; | |
6a06907d XL |
15 | src: local('Fira Sans Medium'), |
16 | url("FiraSans-Medium.woff2") format("woff2"), | |
17 | url("FiraSans-Medium.woff") format('woff'); | |
18 | font-display: swap; | |
1a4d82fc | 19 | } |
b039eaaf | 20 | |
cdc7bbd5 | 21 | /* See SourceSerif4-LICENSE.md for the Source Serif 4 license. */ |
1a4d82fc | 22 | @font-face { |
cdc7bbd5 | 23 | font-family: 'Source Serif 4'; |
476ff2be SL |
24 | font-style: normal; |
25 | font-weight: 400; | |
136023e0 XL |
26 | src: local('Source Serif 4'), |
27 | url("SourceSerif4-Regular.ttf.woff2") format("woff2"), | |
28 | url("SourceSerif4-Regular.ttf.woff") format("woff"); | |
6a06907d | 29 | font-display: swap; |
1a4d82fc JJ |
30 | } |
31 | @font-face { | |
cdc7bbd5 | 32 | font-family: 'Source Serif 4'; |
476ff2be SL |
33 | font-style: italic; |
34 | font-weight: 400; | |
136023e0 XL |
35 | src: local('Source Serif 4 Italic'), |
36 | url("SourceSerif4-It.ttf.woff2") format("woff2"), | |
37 | url("SourceSerif4-It.ttf.woff") format("woff"); | |
6a06907d | 38 | font-display: swap; |
1a4d82fc JJ |
39 | } |
40 | @font-face { | |
cdc7bbd5 | 41 | font-family: 'Source Serif 4'; |
476ff2be SL |
42 | font-style: normal; |
43 | font-weight: 700; | |
136023e0 XL |
44 | src: local('Source Serif 4 Bold'), |
45 | url("SourceSerif4-Bold.ttf.woff2") format("woff2"), | |
46 | url("SourceSerif4-Bold.ttf.woff") format("woff"); | |
6a06907d | 47 | font-display: swap; |
1a4d82fc | 48 | } |
b039eaaf SL |
49 | |
50 | /* See SourceCodePro-LICENSE.txt for the Source Code Pro license. */ | |
1a4d82fc | 51 | @font-face { |
476ff2be SL |
52 | font-family: 'Source Code Pro'; |
53 | font-style: normal; | |
54 | font-weight: 400; | |
55 | /* Avoid using locally installed font because bad versions are in circulation: | |
56 | * see https://github.com/rust-lang/rust/issues/24355 */ | |
136023e0 XL |
57 | src: url("SourceCodePro-Regular.ttf.woff2") format("woff2"), |
58 | url("SourceCodePro-Regular.ttf.woff") format("woff"); | |
cdc7bbd5 XL |
59 | font-display: swap; |
60 | } | |
61 | @font-face { | |
62 | font-family: 'Source Code Pro'; | |
63 | font-style: italic; | |
64 | font-weight: 400; | |
136023e0 XL |
65 | src: url("SourceCodePro-It.ttf.woff2") format("woff2"), |
66 | url("SourceCodePro-It.ttf.woff") format("woff"); | |
6a06907d | 67 | font-display: swap; |
1a4d82fc JJ |
68 | } |
69 | @font-face { | |
476ff2be SL |
70 | font-family: 'Source Code Pro'; |
71 | font-style: normal; | |
72 | font-weight: 600; | |
136023e0 XL |
73 | src: url("SourceCodePro-Semibold.ttf.woff2") format("woff2"), |
74 | url("SourceCodePro-Semibold.ttf.woff") format("woff"); | |
6a06907d | 75 | font-display: swap; |
1a4d82fc JJ |
76 | } |
77 | ||
c295e0f8 | 78 | /* Avoid using legacy CJK serif fonts in Windows like Batang. */ |
17df50a5 | 79 | @font-face { |
3c0e092e XL |
80 | font-family: 'NanumBarunGothic'; |
81 | src: url("NanumBarunGothic.ttf.woff2") format("woff2"), | |
82 | url("NanumBarunGothic.ttf.woff") format("woff"); | |
17df50a5 | 83 | font-display: swap; |
3c0e092e | 84 | unicode-range: U+AC00-D7AF, U+1100-11FF, U+3130-318F, U+A960-A97F, U+D7B0-D7FF; |
17df50a5 XL |
85 | } |
86 | ||
1a4d82fc | 87 | * { |
3dfed10e XL |
88 | -webkit-box-sizing: border-box; |
89 | -moz-box-sizing: border-box; | |
90 | box-sizing: border-box; | |
1a4d82fc JJ |
91 | } |
92 | ||
e1599b0c XL |
93 | /* This part handles the "default" theme being used depending on the system one. */ |
94 | html { | |
95 | content: ""; | |
96 | } | |
97 | @media (prefers-color-scheme: light) { | |
98 | html { | |
99 | content: "light"; | |
100 | } | |
101 | } | |
102 | @media (prefers-color-scheme: dark) { | |
103 | html { | |
104 | content: "dark"; | |
105 | } | |
106 | } | |
107 | ||
1a4d82fc JJ |
108 | /* General structure and fonts */ |
109 | ||
110 | body { | |
a2a8927a | 111 | font: 1rem/1.4 "Source Serif 4", NanumBarunGothic, serif; |
476ff2be SL |
112 | margin: 0; |
113 | position: relative; | |
1a4d82fc | 114 | |
476ff2be SL |
115 | -webkit-font-feature-settings: "kern", "liga"; |
116 | -moz-font-feature-settings: "kern", "liga"; | |
117 | font-feature-settings: "kern", "liga"; | |
1a4d82fc JJ |
118 | } |
119 | ||
120 | h1 { | |
a2a8927a | 121 | font-size: 1.5rem; |
1a4d82fc JJ |
122 | } |
123 | h2 { | |
a2a8927a | 124 | font-size: 1.4rem; |
1a4d82fc JJ |
125 | } |
126 | h3 { | |
a2a8927a | 127 | font-size: 1.3rem; |
1a4d82fc | 128 | } |
c295e0f8 | 129 | h1, h2, h3, h4, h5, h6 { |
476ff2be | 130 | font-weight: 500; |
3c0e092e XL |
131 | } |
132 | h1, h2, h3, h4 { | |
476ff2be SL |
133 | margin: 20px 0 15px 0; |
134 | padding-bottom: 6px; | |
1a4d82fc | 135 | } |
3c0e092e XL |
136 | .docblock h3, .docblock h4, h5, h6 { |
137 | margin: 15px 0 5px 0; | |
138 | } | |
1a4d82fc | 139 | h1.fqn { |
cdc7bbd5 | 140 | display: flex; |
476ff2be SL |
141 | border-bottom: 1px dashed; |
142 | margin-top: 0; | |
cdc7bbd5 XL |
143 | |
144 | /* workaround to keep flex from breaking below 700 px width due to the float: right on the nav | |
145 | above the h1 */ | |
146 | padding-left: 1px; | |
1a4d82fc | 147 | } |
f035d41b XL |
148 | h1.fqn > .in-band > a:hover { |
149 | text-decoration: underline; | |
150 | } | |
3c0e092e XL |
151 | /* The only headings that get underlines are: |
152 | Markdown-generated headings within the top-doc | |
153 | Rustdoc-generated h2 section headings (e.g. "Implementations", "Required Methods", etc) | |
154 | Underlines elsewhere in the documentation break up visual flow and tend to invert | |
155 | section hierarchies. */ | |
156 | h2, | |
157 | .top-doc h3, | |
158 | .top-doc h4, | |
159 | .sidebar .others h3 { | |
476ff2be | 160 | border-bottom: 1px solid; |
1a4d82fc | 161 | } |
3c0e092e | 162 | h3.code-header { |
a2a8927a | 163 | font-size: 1.1rem; |
3c0e092e XL |
164 | } |
165 | h4.code-header { | |
a2a8927a | 166 | font-size: 1rem; |
3c0e092e XL |
167 | } |
168 | h3.code-header, h4.code-header { | |
17df50a5 | 169 | font-weight: 600; |
3c0e092e | 170 | border-bottom-style: none; |
17df50a5 XL |
171 | padding: 0; |
172 | margin: 0; | |
173 | } | |
174 | .impl, | |
175 | .impl-items .method, | |
176 | .methods .method, | |
177 | .impl-items .type, | |
178 | .methods .type, | |
179 | .impl-items .associatedconstant, | |
180 | .methods .associatedconstant, | |
181 | .impl-items .associatedtype, | |
182 | .methods .associatedtype { | |
0731742a | 183 | flex-basis: 100%; |
476ff2be | 184 | font-weight: 600; |
0731742a | 185 | margin-top: 16px; |
476ff2be SL |
186 | margin-bottom: 10px; |
187 | position: relative; | |
1a4d82fc | 188 | } |
ea8adc8c | 189 | |
17df50a5 XL |
190 | div.impl-items > div { |
191 | padding-left: 0; | |
192 | } | |
193 | ||
c295e0f8 | 194 | h1, h2, h3, h4, h5, h6, |
17df50a5 XL |
195 | .sidebar, a.source, .search-input, .search-results .result-name, |
196 | .content table td:first-child > a, | |
136023e0 | 197 | .item-left > a, |
17df50a5 | 198 | div.item-list .out-of-band, span.since, |
5869c6ff | 199 | #source-sidebar, #sidebar-toggle, |
17df50a5 | 200 | details.rustdoc-toggle > summary::before, |
17df50a5 XL |
201 | div.impl-items > div:not(.docblock):not(.item-info), |
202 | .content ul.crate a.crate, a.srclink, | |
5869c6ff | 203 | /* This selector is for the items listed in the "all items" page. */ |
a2a8927a | 204 | #main-content > ul.docblock > li > a { |
3c0e092e | 205 | font-family: "Fira Sans", Arial, NanumBarunGothic, sans-serif; |
1a4d82fc JJ |
206 | } |
207 | ||
1b1a35ee | 208 | .content ul.crate a.crate { |
a2a8927a | 209 | font-size: 1rem/1.6; |
1b1a35ee XL |
210 | } |
211 | ||
1a4d82fc | 212 | ol, ul { |
476ff2be | 213 | padding-left: 25px; |
1a4d82fc JJ |
214 | } |
215 | ul ul, ol ul, ul ol, ol ol { | |
a1dfa0c6 | 216 | margin-bottom: .6em; |
1a4d82fc JJ |
217 | } |
218 | ||
219 | p { | |
476ff2be | 220 | margin: 0 0 .6em 0; |
1a4d82fc JJ |
221 | } |
222 | ||
3b2f2976 XL |
223 | summary { |
224 | outline: none; | |
225 | } | |
226 | ||
17df50a5 XL |
227 | /* Fix some style changes due to normalize.css 8 */ |
228 | ||
229 | td, | |
230 | th { | |
231 | padding: 0; | |
232 | } | |
233 | ||
234 | table { | |
235 | border-collapse: collapse; | |
236 | } | |
237 | ||
238 | button, | |
239 | input, | |
240 | optgroup, | |
241 | select, | |
242 | textarea { | |
243 | color: inherit; | |
244 | font: inherit; | |
245 | margin: 0; | |
246 | } | |
247 | ||
248 | /* end tweaks for normalize.css 8 */ | |
249 | ||
a2a8927a XL |
250 | .rustdoc { |
251 | display: flex; | |
252 | flex-direction: row; | |
253 | flex-wrap: nowrap; | |
254 | } | |
255 | ||
256 | main { | |
257 | position: relative; | |
258 | flex-grow: 1; | |
259 | padding: 10px 15px 40px 45px; | |
260 | min-width: 0; | |
261 | } | |
262 | ||
263 | .source main { | |
264 | padding: 15px; | |
265 | } | |
266 | ||
267 | .width-limiter { | |
268 | max-width: 960px; | |
269 | margin-right: auto; | |
270 | } | |
271 | ||
272 | .source .width-limiter { | |
273 | max-width: unset; | |
274 | } | |
275 | ||
17df50a5 XL |
276 | details:not(.rustdoc-toggle) summary { |
277 | margin-bottom: .6em; | |
278 | } | |
279 | ||
280 | code, pre, a.test-arrow, .code-header { | |
a1dfa0c6 | 281 | font-family: "Source Code Pro", monospace; |
1a4d82fc | 282 | } |
9e0c209e | 283 | .docblock code, .docblock-short code { |
476ff2be | 284 | border-radius: 3px; |
0bf4aa26 | 285 | padding: 0 0.1em; |
1a4d82fc | 286 | } |
cdc7bbd5 | 287 | .docblock pre code, .docblock-short pre code { |
476ff2be | 288 | padding: 0; |
c1a9b12d | 289 | } |
1a4d82fc | 290 | pre { |
476ff2be | 291 | padding: 14px; |
1a4d82fc | 292 | } |
3c0e092e XL |
293 | .docblock.item-decl { |
294 | margin-left: 0; | |
295 | } | |
296 | .item-decl pre { | |
136023e0 XL |
297 | overflow-x: auto; |
298 | } | |
1a4d82fc | 299 | |
8bb4bdeb | 300 | .source .content pre { |
476ff2be | 301 | padding: 20px; |
1a4d82fc JJ |
302 | } |
303 | ||
9cc50fc6 | 304 | img { |
476ff2be | 305 | max-width: 100%; |
9cc50fc6 SL |
306 | } |
307 | ||
416331ca XL |
308 | li { |
309 | position: relative; | |
310 | } | |
311 | ||
8bb4bdeb | 312 | .source .content { |
476ff2be SL |
313 | max-width: none; |
314 | overflow: visible; | |
315 | margin-left: 0px; | |
1a4d82fc JJ |
316 | } |
317 | ||
318 | nav.sub { | |
a2a8927a XL |
319 | position: relative; |
320 | font-size: 1rem; | |
476ff2be | 321 | text-transform: uppercase; |
1a4d82fc JJ |
322 | } |
323 | ||
a2a8927a XL |
324 | .sub-container { |
325 | display: flex; | |
326 | flex-direction: row; | |
327 | flex-wrap: nowrap; | |
328 | } | |
329 | ||
330 | .sub-logo-container { | |
331 | display: none; | |
332 | margin-right: 20px; | |
333 | } | |
334 | ||
335 | .source .sub-logo-container { | |
336 | display: block; | |
337 | } | |
338 | ||
339 | .source .sub-logo-container > img { | |
340 | height: 60px; | |
341 | width: 60px; | |
342 | object-fit: contain; | |
343 | } | |
344 | ||
1a4d82fc | 345 | .sidebar { |
476ff2be | 346 | width: 200px; |
3c0e092e | 347 | overflow-y: scroll; |
a2a8927a XL |
348 | position: sticky; |
349 | min-width: 200px; | |
350 | height: 100vh; | |
351 | top: 0; | |
352 | left: 0; | |
3c0e092e XL |
353 | } |
354 | ||
355 | .rustdoc.source .sidebar { | |
a2a8927a XL |
356 | width: 50px; |
357 | min-width: 0px; | |
358 | max-width: 300px; | |
359 | flex-grow: 0; | |
360 | flex-shrink: 0; | |
361 | flex-basis: auto; | |
362 | border-right: 1px solid; | |
363 | overflow-x: hidden; | |
364 | /* The sidebar is by default hidden */ | |
365 | overflow-y: hidden; | |
366 | } | |
367 | ||
368 | .source .sidebar > *:not(:first-child) { | |
369 | transition: opacity 0.5s, visibility 0.2s; | |
370 | opacity: 0; | |
371 | visibility: hidden; | |
372 | } | |
373 | ||
374 | .source .sidebar.expanded { | |
3c0e092e | 375 | overflow-y: auto; |
8bb4bdeb XL |
376 | } |
377 | ||
a2a8927a XL |
378 | .source .sidebar.expanded > * { |
379 | opacity: 1; | |
380 | visibility: visible; | |
381 | } | |
382 | ||
ba9703b0 XL |
383 | /* Improve the scrollbar display on firefox */ |
384 | * { | |
385 | scrollbar-width: initial; | |
386 | } | |
387 | .sidebar { | |
388 | scrollbar-width: thin; | |
389 | } | |
390 | ||
391 | /* Improve the scrollbar display on webkit-based browsers */ | |
392 | ::-webkit-scrollbar { | |
393 | width: 12px; | |
394 | } | |
395 | .sidebar::-webkit-scrollbar { | |
396 | width: 8px; | |
397 | } | |
398 | ::-webkit-scrollbar-track { | |
399 | -webkit-box-shadow: inset 0; | |
400 | } | |
401 | ||
2c00a5a8 | 402 | .sidebar .block > ul > li { |
0531ce1d | 403 | margin-right: -10px; |
1a4d82fc JJ |
404 | } |
405 | ||
1a4d82fc JJ |
406 | /* Everything else */ |
407 | ||
60c5eb7d | 408 | .hidden { |
2c00a5a8 XL |
409 | display: none !important; |
410 | } | |
1a4d82fc | 411 | |
48663c56 | 412 | .logo-container { |
a2a8927a | 413 | display: flex; |
abe05a73 | 414 | margin-top: 10px; |
a2a8927a XL |
415 | margin-bottom: 10px; |
416 | justify-content: center; | |
1a4d82fc JJ |
417 | } |
418 | ||
48663c56 | 419 | .logo-container > img { |
a2a8927a XL |
420 | height: 100px; |
421 | width: 100px; | |
48663c56 XL |
422 | } |
423 | ||
1a4d82fc | 424 | .sidebar .location { |
8bb4bdeb | 425 | border: 1px solid; |
a2a8927a | 426 | font-size: 1.0625rem; |
abe05a73 | 427 | margin: 30px 10px 20px 10px; |
476ff2be | 428 | text-align: center; |
7cac9316 | 429 | word-wrap: break-word; |
17df50a5 XL |
430 | font-weight: inherit; |
431 | padding: 0; | |
1a4d82fc JJ |
432 | } |
433 | ||
abe05a73 | 434 | .sidebar .version { |
a2a8927a | 435 | font-size: 0.9375rem; |
abe05a73 | 436 | text-align: center; |
ff7c6d11 | 437 | border-bottom: 1px solid; |
abe05a73 XL |
438 | overflow-wrap: break-word; |
439 | word-wrap: break-word; /* deprecated */ | |
440 | word-break: break-word; /* Chrome, non-standard */ | |
441 | } | |
442 | ||
8bb4bdeb XL |
443 | .location:empty { |
444 | border: none; | |
445 | } | |
446 | ||
17df50a5 | 447 | .location a:first-of-type { |
2c00a5a8 XL |
448 | font-weight: 500; |
449 | } | |
17df50a5 XL |
450 | .location a:hover { |
451 | text-decoration: underline; | |
452 | } | |
1a4d82fc JJ |
453 | |
454 | .block { | |
abe05a73 | 455 | padding: 0; |
476ff2be | 456 | margin-bottom: 14px; |
1a4d82fc | 457 | } |
e9174d1e | 458 | .block h2, .block h3 { |
476ff2be | 459 | text-align: center; |
1a4d82fc | 460 | } |
e9174d1e | 461 | .block ul, .block li { |
abe05a73 | 462 | margin: 0 10px; |
476ff2be SL |
463 | padding: 0; |
464 | list-style: none; | |
e9174d1e | 465 | } |
1a4d82fc JJ |
466 | |
467 | .block a { | |
476ff2be SL |
468 | display: block; |
469 | text-overflow: ellipsis; | |
470 | overflow: hidden; | |
471 | line-height: 15px; | |
472 | padding: 7px 5px; | |
a2a8927a | 473 | font-size: 0.875rem; |
476ff2be SL |
474 | font-weight: 300; |
475 | transition: border 500ms ease-out; | |
1a4d82fc JJ |
476 | } |
477 | ||
abe05a73 | 478 | .sidebar-title { |
ff7c6d11 XL |
479 | border-top: 1px solid; |
480 | border-bottom: 1px solid; | |
abe05a73 | 481 | text-align: center; |
a2a8927a | 482 | font-size: 1.0625rem; |
abe05a73 | 483 | margin-bottom: 5px; |
17df50a5 XL |
484 | font-weight: inherit; |
485 | padding: 0; | |
abe05a73 XL |
486 | } |
487 | ||
488 | .sidebar-links { | |
489 | margin-bottom: 15px; | |
490 | } | |
491 | ||
492 | .sidebar-links > a { | |
493 | padding-left: 10px; | |
494 | width: 100%; | |
495 | } | |
496 | ||
ff7c6d11 XL |
497 | .sidebar-menu { |
498 | display: none; | |
499 | } | |
500 | ||
8bb4bdeb | 501 | .source .content pre.rust { |
476ff2be SL |
502 | white-space: pre; |
503 | overflow: auto; | |
504 | padding-left: 0; | |
1a4d82fc | 505 | } |
ff7c6d11 | 506 | |
17df50a5 | 507 | .rustdoc .example-wrap { |
a1dfa0c6 XL |
508 | display: inline-flex; |
509 | margin-bottom: 10px; | |
510 | } | |
511 | ||
512 | .example-wrap { | |
6a06907d | 513 | position: relative; |
a1dfa0c6 XL |
514 | width: 100%; |
515 | } | |
516 | ||
517 | .example-wrap > pre.line-number { | |
518 | overflow: initial; | |
519 | border: 1px solid; | |
a1dfa0c6 XL |
520 | padding: 13px 8px; |
521 | text-align: right; | |
17df50a5 XL |
522 | border-top-left-radius: 5px; |
523 | border-bottom-left-radius: 5px; | |
a1dfa0c6 XL |
524 | } |
525 | ||
94222f64 XL |
526 | .example-wrap > pre.rust a:hover { |
527 | text-decoration: underline; | |
528 | } | |
529 | ||
136023e0 | 530 | .rustdoc:not(.source) .example-wrap > pre:not(.line-number) { |
a1dfa0c6 | 531 | width: 100%; |
0731742a | 532 | overflow-x: auto; |
a1dfa0c6 XL |
533 | } |
534 | ||
3c0e092e XL |
535 | .rustdoc:not(.source) .example-wrap > pre.line-numbers { |
536 | width: auto; | |
537 | overflow-x: visible; | |
538 | } | |
539 | ||
17df50a5 | 540 | .rustdoc .example-wrap > pre { |
a1dfa0c6 XL |
541 | margin: 0; |
542 | } | |
543 | ||
7cac9316 | 544 | #search { |
ff7c6d11 XL |
545 | position: relative; |
546 | } | |
547 | ||
a2a8927a XL |
548 | .search-loading { |
549 | text-align: center; | |
550 | } | |
551 | ||
0531ce1d XL |
552 | #results > table { |
553 | width: 100%; | |
554 | table-layout: fixed; | |
555 | } | |
556 | ||
17df50a5 | 557 | .content > .example-wrap pre.line-numbers { |
476ff2be | 558 | position: relative; |
476ff2be SL |
559 | -webkit-user-select: none; |
560 | -moz-user-select: none; | |
561 | -ms-user-select: none; | |
562 | user-select: none; | |
1a4d82fc | 563 | } |
2c00a5a8 XL |
564 | .line-numbers span { |
565 | cursor: pointer; | |
566 | } | |
1a4d82fc | 567 | |
29967ef6 XL |
568 | .docblock-short { |
569 | overflow-wrap: anywhere; | |
570 | } | |
9e0c209e | 571 | .docblock-short p { |
476ff2be | 572 | display: inline; |
d9579d0f AL |
573 | } |
574 | ||
9e0c209e | 575 | .docblock-short p { |
476ff2be SL |
576 | overflow: hidden; |
577 | text-overflow: ellipsis; | |
578 | margin: 0; | |
1a4d82fc | 579 | } |
cdc7bbd5 XL |
580 | /* Wrap non-pre code blocks (`text`) but not (```text```). */ |
581 | .docblock > :not(pre) > code, | |
582 | .docblock-short > :not(pre) > code { | |
48663c56 | 583 | white-space: pre-wrap; |
2c00a5a8 | 584 | } |
1a4d82fc | 585 | |
a2a8927a XL |
586 | .top-doc .docblock h2 { font-size: 1.3rem; } |
587 | .top-doc .docblock h3 { font-size: 1.15rem; } | |
17df50a5 | 588 | .top-doc .docblock h4, |
3c0e092e | 589 | .top-doc .docblock h5 { |
a2a8927a | 590 | font-size: 1.1rem; |
3c0e092e | 591 | } |
c295e0f8 | 592 | .top-doc .docblock h6 { |
a2a8927a | 593 | font-size: 1rem; |
0731742a XL |
594 | } |
595 | ||
a2a8927a XL |
596 | .docblock h5 { font-size: 1rem; } |
597 | .docblock h6 { font-size: 0.95rem; } | |
1a4d82fc | 598 | |
3157f602 | 599 | .docblock { |
476ff2be | 600 | margin-left: 24px; |
ea8adc8c | 601 | position: relative; |
3157f602 XL |
602 | } |
603 | ||
3c0e092e | 604 | .docblock > :not(.information) { |
c295e0f8 XL |
605 | max-width: 100%; |
606 | overflow-x: auto; | |
607 | } | |
608 | ||
1a4d82fc | 609 | .content .out-of-band { |
cdc7bbd5 XL |
610 | flex-grow: 0; |
611 | text-align: right; | |
a2a8927a | 612 | font-size: 1.4375rem; |
476ff2be | 613 | margin: 0px; |
cdc7bbd5 | 614 | padding: 0 0 0 12px; |
476ff2be | 615 | font-weight: normal; |
a7813a04 XL |
616 | } |
617 | ||
17df50a5 | 618 | .method > .code-header, .trait-impl > .code-header, .invisible > .code-header { |
2c00a5a8 XL |
619 | max-width: calc(100% - 41px); |
620 | display: block; | |
a7813a04 XL |
621 | } |
622 | ||
9e0c209e | 623 | .invisible { |
476ff2be SL |
624 | width: 100%; |
625 | display: inline-block; | |
9e0c209e SL |
626 | } |
627 | ||
1a4d82fc | 628 | .content .in-band { |
cdc7bbd5 | 629 | flex-grow: 1; |
476ff2be SL |
630 | margin: 0px; |
631 | padding: 0px; | |
3c0e092e | 632 | overflow-wrap: anywhere; |
1a4d82fc JJ |
633 | } |
634 | ||
17df50a5 | 635 | .in-band > code, .in-band > .code-header { |
ea8adc8c XL |
636 | display: inline-block; |
637 | } | |
638 | ||
a2a8927a | 639 | #main-content { |
2c00a5a8 XL |
640 | position: relative; |
641 | } | |
a2a8927a | 642 | #main-content > .since { |
476ff2be | 643 | top: inherit; |
6a06907d | 644 | font-family: "Fira Sans", Arial, sans-serif; |
a7813a04 XL |
645 | } |
646 | ||
0531ce1d | 647 | .content table:not(.table-display) { |
476ff2be | 648 | border-spacing: 0 5px; |
1a4d82fc JJ |
649 | } |
650 | .content td { vertical-align: top; } | |
651 | .content td:first-child { padding-right: 20px; } | |
652 | .content td p:first-child { margin-top: 0; } | |
a2a8927a | 653 | .content td h1, .content td h2 { margin-left: 0; font-size: 1.1rem; } |
8faf50e0 | 654 | .content tr:first-child td { border-top: 0; } |
1a4d82fc | 655 | |
85aaf69f | 656 | .docblock table { |
476ff2be | 657 | margin: .5em 0; |
9fa01778 | 658 | width: calc(100% - 2px); |
136023e0 XL |
659 | overflow-x: auto; |
660 | display: block; | |
85aaf69f SL |
661 | } |
662 | ||
663 | .docblock table td { | |
476ff2be | 664 | padding: .5em; |
8faf50e0 | 665 | border: 1px dashed; |
85aaf69f SL |
666 | } |
667 | ||
668 | .docblock table th { | |
476ff2be SL |
669 | padding: .5em; |
670 | text-align: left; | |
8faf50e0 | 671 | border: 1px solid; |
476ff2be SL |
672 | } |
673 | ||
674 | .fields + table { | |
675 | margin-bottom: 1em; | |
85aaf69f SL |
676 | } |
677 | ||
1a4d82fc | 678 | .content .item-list { |
476ff2be SL |
679 | list-style-type: none; |
680 | padding: 0; | |
1a4d82fc JJ |
681 | } |
682 | ||
1a4d82fc | 683 | .content .multi-column { |
476ff2be SL |
684 | -moz-column-count: 5; |
685 | -moz-column-gap: 2.5em; | |
686 | -webkit-column-count: 5; | |
687 | -webkit-column-gap: 2.5em; | |
688 | column-count: 5; | |
689 | column-gap: 2.5em; | |
1a4d82fc JJ |
690 | } |
691 | .content .multi-column li { width: 100%; display: inline-block; } | |
692 | ||
17df50a5 | 693 | .content > .methods > .method { |
a2a8927a | 694 | font-size: 1rem; |
476ff2be | 695 | position: relative; |
1a4d82fc | 696 | } |
62682a34 | 697 | /* Shift "where ..." part of method or fn definition down a line */ |
476ff2be SL |
698 | .content .method .where, |
699 | .content .fn .where, | |
700 | .content .where.fmt-newline { | |
8bb4bdeb | 701 | display: block; |
a2a8927a | 702 | font-size: 0.8rem; |
476ff2be | 703 | } |
1a4d82fc | 704 | |
17df50a5 | 705 | .content .methods > div:not(.notable-traits):not(.method) { |
0531ce1d XL |
706 | margin-left: 40px; |
707 | margin-bottom: 15px; | |
708 | } | |
1a4d82fc | 709 | |
94b46f34 | 710 | .content .docblock > .impl-items { |
476ff2be | 711 | margin-left: 20px; |
94b46f34 XL |
712 | margin-top: -34px; |
713 | } | |
94b46f34 XL |
714 | .content .docblock >.impl-items .table-display { |
715 | margin: 0; | |
716 | } | |
717 | .content .docblock >.impl-items table td { | |
718 | padding: 0; | |
719 | } | |
94b46f34 XL |
720 | .content .docblock > .impl-items .table-display, .impl-items table td { |
721 | border: none; | |
d9579d0f | 722 | } |
1a4d82fc | 723 | |
fc512014 | 724 | .content .item-info code { |
a2a8927a | 725 | font-size: 0.81rem; |
e9174d1e SL |
726 | } |
727 | ||
fc512014 | 728 | .content .item-info { |
b7449926 XL |
729 | position: relative; |
730 | margin-left: 33px; | |
b7449926 XL |
731 | } |
732 | ||
fc512014 | 733 | .sub-variant > div > .item-info { |
a1dfa0c6 XL |
734 | margin-top: initial; |
735 | } | |
736 | ||
fc512014 | 737 | .content .item-info::before { |
dfeec247 | 738 | content: '⬑'; |
a2a8927a | 739 | font-size: 1.5625rem; |
b7449926 | 740 | position: absolute; |
136023e0 | 741 | top: -6px; |
dfeec247 | 742 | left: -19px; |
b7449926 | 743 | } |
a1dfa0c6 | 744 | |
fc512014 | 745 | .content .impl-items .docblock, .content .impl-items .item-info { |
a1dfa0c6 XL |
746 | margin-bottom: .6em; |
747 | } | |
748 | ||
fc512014 | 749 | .content .impl-items > .item-info { |
a1dfa0c6 XL |
750 | margin-left: 40px; |
751 | } | |
752 | ||
fc512014 | 753 | .methods > .item-info, .content .impl-items > .item-info { |
b7449926 XL |
754 | margin-top: -8px; |
755 | } | |
756 | ||
0731742a XL |
757 | .impl-items { |
758 | flex-basis: 100%; | |
759 | } | |
760 | ||
a2a8927a | 761 | #main-content > .item-info { |
b7449926 XL |
762 | margin-top: 0; |
763 | } | |
764 | ||
e74abb32 | 765 | nav:not(.sidebar) { |
a2a8927a | 766 | flex-grow: 1; |
476ff2be SL |
767 | border-bottom: 1px solid; |
768 | padding-bottom: 10px; | |
a2a8927a XL |
769 | margin-bottom: 25px; |
770 | } | |
771 | .source nav:not(.sidebar).sub { | |
772 | margin-left: 32px; | |
1a4d82fc JJ |
773 | } |
774 | nav.main { | |
476ff2be SL |
775 | padding: 20px 0; |
776 | text-align: center; | |
1a4d82fc JJ |
777 | } |
778 | nav.main .current { | |
476ff2be SL |
779 | border-top: 1px solid; |
780 | border-bottom: 1px solid; | |
1a4d82fc JJ |
781 | } |
782 | nav.main .separator { | |
476ff2be SL |
783 | border: 1px solid; |
784 | display: inline-block; | |
785 | height: 23px; | |
786 | margin: 0 20px; | |
1a4d82fc JJ |
787 | } |
788 | nav.sum { text-align: right; } | |
789 | nav.sub form { display: inline; } | |
790 | ||
1a4d82fc | 791 | a { |
476ff2be SL |
792 | text-decoration: none; |
793 | background: transparent; | |
1a4d82fc | 794 | } |
c34b1796 | 795 | |
136023e0 XL |
796 | .small-section-header { |
797 | display: flex; | |
798 | justify-content: space-between; | |
799 | position: relative; | |
800 | } | |
801 | ||
3b2f2976 XL |
802 | .small-section-header:hover > .anchor { |
803 | display: initial; | |
804 | } | |
805 | ||
cdc7bbd5 | 806 | .in-band:hover > .anchor, .impl:hover > .anchor, .method.trait-impl:hover > .anchor, |
17df50a5 XL |
807 | .type.trait-impl:hover > .anchor, .associatedconstant.trait-impl:hover > .anchor, |
808 | .associatedtype.trait-impl:hover > .anchor { | |
ea8adc8c XL |
809 | display: inline-block; |
810 | position: absolute; | |
3b2f2976 XL |
811 | } |
812 | .anchor { | |
813 | display: none; | |
ea8adc8c | 814 | position: absolute; |
3c0e092e | 815 | left: -0.5em; |
94222f64 | 816 | background: none !important; |
ea8adc8c XL |
817 | } |
818 | .anchor.field { | |
0531ce1d XL |
819 | left: -5px; |
820 | } | |
821 | .small-section-header > .anchor { | |
94222f64 XL |
822 | left: -15px; |
823 | padding-right: 8px; | |
3b2f2976 | 824 | } |
94222f64 XL |
825 | h2.small-section-header > .anchor { |
826 | padding-right: 6px; | |
827 | } | |
828 | .anchor::before { | |
829 | content: '§'; | |
3b2f2976 XL |
830 | } |
831 | ||
94b46f34 | 832 | .docblock a:not(.srclink):not(.test-arrow):hover, |
fc512014 | 833 | .docblock-short a:not(.srclink):not(.test-arrow):hover, .item-info a { |
476ff2be | 834 | text-decoration: underline; |
c34b1796 | 835 | } |
1a4d82fc | 836 | |
17df50a5 XL |
837 | .invisible > .srclink, |
838 | .method > .code-header + .srclink { | |
b7449926 XL |
839 | position: absolute; |
840 | top: 0; | |
841 | right: 0; | |
a2a8927a | 842 | font-size: 1.0625rem; |
b7449926 XL |
843 | font-weight: normal; |
844 | } | |
845 | ||
e9174d1e | 846 | .block a.current.crate { font-weight: 500; } |
1a4d82fc | 847 | |
136023e0 | 848 | .item-table { |
c295e0f8 XL |
849 | display: table; |
850 | } | |
851 | .item-row { | |
852 | display: table-row; | |
136023e0 | 853 | } |
136023e0 | 854 | .item-left, .item-right { |
c295e0f8 | 855 | display: table-cell; |
136023e0 XL |
856 | } |
857 | .item-left { | |
c295e0f8 | 858 | padding-right: 1.2rem; |
136023e0 XL |
859 | } |
860 | ||
83c7162d XL |
861 | .search-container { |
862 | position: relative; | |
a2a8927a | 863 | max-width: 960px; |
83c7162d | 864 | } |
0731742a XL |
865 | .search-container > div { |
866 | display: inline-flex; | |
3dfed10e | 867 | width: calc(100% - 63px); |
0731742a XL |
868 | } |
869 | #crate-search { | |
6a06907d | 870 | min-width: 115px; |
0731742a XL |
871 | margin-top: 5px; |
872 | padding: 6px; | |
873 | padding-right: 19px; | |
416331ca | 874 | flex: none; |
0731742a XL |
875 | border: 0; |
876 | border-right: 0; | |
877 | border-radius: 4px 0 0 4px; | |
878 | outline: none; | |
879 | cursor: pointer; | |
880 | border-right: 1px solid; | |
881 | -moz-appearance: none; | |
882 | -webkit-appearance: none; | |
883 | /* Removes default arrow from firefox */ | |
884 | text-indent: 0.01px; | |
885 | text-overflow: ""; | |
886 | background-repeat: no-repeat; | |
887 | background-color: transparent; | |
888 | background-size: 20px; | |
889 | background-position: calc(100% - 1px) 56%; | |
a2a8927a | 890 | background-image: /* AUTOREPLACE: */url("down-arrow.svg"); |
0731742a | 891 | } |
83c7162d XL |
892 | .search-container > .top-button { |
893 | position: absolute; | |
894 | right: 0; | |
895 | top: 10px; | |
896 | } | |
1a4d82fc | 897 | .search-input { |
a2a8927a XL |
898 | /* Override Normalize.css: it has a rule that sets |
899 | -webkit-appearance: textfield for search inputs. That | |
900 | causes rounded corners and no border on iOS Safari. */ | |
901 | -webkit-appearance: none; | |
476ff2be SL |
902 | /* Override Normalize.css: we have margins and do |
903 | not want to overflow - the `moz` attribute is necessary | |
904 | until Firefox 29, too early to drop at this point */ | |
905 | -moz-box-sizing: border-box !important; | |
906 | box-sizing: border-box !important; | |
907 | outline: none; | |
908 | border: none; | |
909 | border-radius: 1px; | |
910 | margin-top: 5px; | |
911 | padding: 10px 16px; | |
a2a8927a | 912 | font-size: 1.0625rem; |
476ff2be SL |
913 | transition: border-color 300ms ease; |
914 | transition: border-radius 300ms ease-in-out; | |
915 | transition: box-shadow 300ms ease-in-out; | |
48663c56 | 916 | width: 100%; |
0731742a XL |
917 | } |
918 | ||
919 | #crate-search + .search-input { | |
920 | border-radius: 0 1px 1px 0; | |
48663c56 | 921 | width: calc(100% - 32px); |
1a4d82fc JJ |
922 | } |
923 | ||
924 | .search-input:focus { | |
476ff2be SL |
925 | border-radius: 2px; |
926 | border: 0; | |
927 | outline: 0; | |
1a4d82fc JJ |
928 | } |
929 | ||
17df50a5 XL |
930 | .search-results { |
931 | display: none; | |
932 | padding-bottom: 2em; | |
933 | } | |
934 | ||
935 | .search-results.active { | |
936 | display: block; | |
937 | /* prevent overhanging tabs from moving the first result */ | |
938 | clear: both; | |
939 | } | |
940 | ||
941 | .search-results .desc > span { | |
476ff2be SL |
942 | white-space: nowrap; |
943 | text-overflow: ellipsis; | |
944 | overflow: hidden; | |
945 | display: block; | |
1a4d82fc JJ |
946 | } |
947 | ||
17df50a5 | 948 | .search-results > a { |
476ff2be | 949 | display: block; |
17df50a5 XL |
950 | width: 100%; |
951 | /* A little margin ensures the browser's outlining of focused links has room to display. */ | |
952 | margin-left: 2px; | |
953 | margin-right: 2px; | |
954 | border-bottom: 1px solid #aaa3; | |
1a4d82fc JJ |
955 | } |
956 | ||
17df50a5 XL |
957 | .search-results > a > div { |
958 | display: flex; | |
959 | flex-flow: row wrap; | |
0531ce1d | 960 | } |
1a4d82fc | 961 | |
17df50a5 XL |
962 | .search-results .result-name, .search-results div.desc, .search-results .result-description { |
963 | width: 50%; | |
964 | } | |
965 | .search-results .result-name { | |
966 | padding-right: 1em; | |
9e0c209e | 967 | } |
62682a34 | 968 | |
17df50a5 XL |
969 | .search-results .result-name > span { |
970 | display: inline-block; | |
971 | margin: 0; | |
972 | font-weight: normal; | |
94b46f34 XL |
973 | } |
974 | ||
c1a9b12d | 975 | body.blur > :not(#help) { |
476ff2be SL |
976 | filter: blur(8px); |
977 | -webkit-filter: blur(8px); | |
978 | opacity: .7; | |
c1a9b12d SL |
979 | } |
980 | ||
1a4d82fc | 981 | #help { |
476ff2be SL |
982 | width: 100%; |
983 | height: 100vh; | |
984 | position: fixed; | |
985 | top: 0; | |
986 | left: 0; | |
987 | display: flex; | |
988 | justify-content: center; | |
989 | align-items: center; | |
c1a9b12d SL |
990 | } |
991 | #help > div { | |
476ff2be | 992 | flex: 0 0 auto; |
476ff2be SL |
993 | box-shadow: 0 0 6px rgba(0,0,0,.2); |
994 | width: 550px; | |
2c00a5a8 | 995 | height: auto; |
8bb4bdeb | 996 | border: 1px solid; |
1a4d82fc | 997 | } |
1a4d82fc | 998 | #help dt { |
476ff2be | 999 | float: left; |
476ff2be SL |
1000 | clear: left; |
1001 | display: block; | |
5869c6ff | 1002 | margin-right: 0.5rem; |
1a4d82fc | 1003 | } |
c295e0f8 | 1004 | #help span.top, #help span.bottom { |
29967ef6 XL |
1005 | text-align: center; |
1006 | display: block; | |
a2a8927a | 1007 | font-size: 1.125rem; |
c295e0f8 XL |
1008 | |
1009 | } | |
1010 | #help span.top { | |
1011 | text-align: center; | |
1012 | display: block; | |
1013 | margin: 10px 0; | |
1014 | border-bottom: 1px solid; | |
29967ef6 XL |
1015 | padding-bottom: 4px; |
1016 | margin-bottom: 6px; | |
1017 | } | |
c295e0f8 XL |
1018 | #help span.bottom { |
1019 | clear: both; | |
1020 | border-top: 1px solid; | |
1021 | } | |
abe05a73 | 1022 | #help dd { margin: 5px 35px; } |
1a4d82fc | 1023 | #help .infos { padding-left: 0; } |
e9174d1e | 1024 | #help h1, #help h2 { margin-top: 0; } |
c1a9b12d | 1025 | #help > div div { |
476ff2be SL |
1026 | width: 50%; |
1027 | float: left; | |
29967ef6 | 1028 | padding: 0 20px 20px 17px;; |
1a4d82fc JJ |
1029 | } |
1030 | ||
136023e0 | 1031 | .item-info .stab { |
32a655c1 | 1032 | display: table; |
136023e0 XL |
1033 | } |
1034 | .stab { | |
476ff2be SL |
1035 | padding: 3px; |
1036 | margin-bottom: 5px; | |
a2a8927a | 1037 | font-size: 0.9rem; |
136023e0 | 1038 | font-weight: normal; |
1a4d82fc | 1039 | } |
32a655c1 | 1040 | .stab p { |
476ff2be | 1041 | display: inline; |
1a4d82fc JJ |
1042 | } |
1043 | ||
0731742a | 1044 | .stab .emoji { |
a2a8927a | 1045 | font-size: 1.2rem; |
32a655c1 SL |
1046 | } |
1047 | ||
cdc7bbd5 XL |
1048 | /* Black one-pixel outline around emoji shapes */ |
1049 | .emoji { | |
1050 | text-shadow: | |
1051 | 1px 0 0 black, | |
1052 | -1px 0 0 black, | |
1053 | 0 1px 0 black, | |
1054 | 0 -1px 0 black; | |
1055 | } | |
1056 | ||
1057 | .module-item .stab, | |
1058 | .import-item .stab { | |
9fa01778 XL |
1059 | border-radius: 3px; |
1060 | display: inline-block; | |
a2a8927a | 1061 | font-size: 0.8rem; |
9fa01778 XL |
1062 | line-height: 1.2; |
1063 | margin-bottom: 0; | |
136023e0 | 1064 | margin-left: .3em; |
9fa01778 XL |
1065 | padding: 2px; |
1066 | vertical-align: text-bottom; | |
1a4d82fc JJ |
1067 | } |
1068 | ||
cdc7bbd5 XL |
1069 | .module-item.unstable, |
1070 | .import-item.unstable { | |
476ff2be | 1071 | opacity: 0.65; |
d9579d0f | 1072 | } |
1a4d82fc | 1073 | |
a7813a04 | 1074 | .since { |
476ff2be SL |
1075 | font-weight: normal; |
1076 | font-size: initial; | |
7453a54e SL |
1077 | } |
1078 | ||
fc512014 | 1079 | .impl-items .since, .impl .since, .methods .since { |
0731742a | 1080 | padding-left: 12px; |
136023e0 | 1081 | padding-right: 2px; |
0731742a XL |
1082 | position: initial; |
1083 | } | |
1084 | ||
fc512014 | 1085 | .impl-items .srclink, .impl .srclink, .methods .srclink { |
0731742a | 1086 | /* Override header settings otherwise it's too bold */ |
0731742a | 1087 | font-weight: normal; |
a2a8927a XL |
1088 | font-size: 1rem; |
1089 | } | |
1090 | .impl .srclink { | |
1091 | font-size: 1.0625rem; | |
0731742a XL |
1092 | } |
1093 | ||
136023e0 XL |
1094 | .rightside { |
1095 | float: right; | |
0731742a XL |
1096 | } |
1097 | ||
17df50a5 | 1098 | .has-srclink { |
a2a8927a | 1099 | font-size: 1rem; |
0731742a XL |
1100 | margin-bottom: 12px; |
1101 | /* Push the src link out to the right edge consistently */ | |
1102 | justify-content: space-between; | |
1103 | } | |
1104 | ||
7453a54e | 1105 | .variants_table { |
476ff2be | 1106 | width: 100%; |
7453a54e SL |
1107 | } |
1108 | ||
1109 | .variants_table tbody tr td:first-child { | |
476ff2be | 1110 | width: 1%; /* make the variant name as small as possible */ |
7453a54e SL |
1111 | } |
1112 | ||
c34b1796 | 1113 | td.summary-column { |
476ff2be | 1114 | width: 100%; |
c34b1796 AL |
1115 | } |
1116 | ||
1a4d82fc | 1117 | .summary { |
476ff2be | 1118 | padding-right: 0px; |
1a4d82fc | 1119 | } |
1a4d82fc | 1120 | |
c30ab7b3 | 1121 | pre.rust .question-mark { |
476ff2be | 1122 | font-weight: bold; |
c30ab7b3 | 1123 | } |
1a4d82fc | 1124 | |
b039eaaf | 1125 | a.test-arrow { |
476ff2be | 1126 | display: inline-block; |
a2a8927a | 1127 | visibility: hidden; |
476ff2be SL |
1128 | position: absolute; |
1129 | padding: 5px 10px 5px 10px; | |
1130 | border-radius: 5px; | |
a2a8927a | 1131 | font-size: 1.3rem; |
476ff2be SL |
1132 | top: 5px; |
1133 | right: 5px; | |
74b04a01 | 1134 | z-index: 1; |
1a4d82fc | 1135 | } |
a2a8927a XL |
1136 | .example-wrap:hover .test-arrow { |
1137 | visibility: visible; | |
1138 | } | |
9e0c209e | 1139 | a.test-arrow:hover{ |
476ff2be | 1140 | text-decoration: none; |
9e0c209e | 1141 | } |
ea8adc8c XL |
1142 | .section-header:hover a:before { |
1143 | position: absolute; | |
1144 | left: -25px; | |
b7449926 | 1145 | padding-right: 10px; /* avoid gap that causes hover to disappear */ |
476ff2be | 1146 | content: '\2002\00a7\2002'; |
1a4d82fc JJ |
1147 | } |
1148 | ||
c34b1796 | 1149 | .section-header:hover a { |
476ff2be | 1150 | text-decoration: none; |
c34b1796 AL |
1151 | } |
1152 | ||
cdc7bbd5 XL |
1153 | .code-attribute { |
1154 | font-weight: 300; | |
1155 | } | |
1156 | ||
a7813a04 | 1157 | .since + .srclink { |
476ff2be | 1158 | padding-left: 10px; |
a7813a04 XL |
1159 | } |
1160 | ||
041b39d2 XL |
1161 | .item-spacer { |
1162 | width: 100%; | |
1163 | height: 12px; | |
1164 | } | |
1165 | ||
48663c56 | 1166 | .out-of-band > span.since { |
476ff2be | 1167 | position: initial; |
a2a8927a | 1168 | font-size: 1.25rem; |
476ff2be | 1169 | margin-right: 5px; |
a7813a04 | 1170 | } |
1a4d82fc | 1171 | |
3c0e092e XL |
1172 | h3.variant { |
1173 | font-weight: 600; | |
a2a8927a | 1174 | font-size: 1.1rem; |
3c0e092e XL |
1175 | margin-bottom: 10px; |
1176 | border-bottom: none; | |
a1dfa0c6 XL |
1177 | } |
1178 | ||
3c0e092e | 1179 | .sub-variant h4 { |
a2a8927a | 1180 | font-size: 1rem; |
3c0e092e XL |
1181 | font-weight: 400; |
1182 | border-bottom: none; | |
1183 | margin-top: 0; | |
1184 | margin-bottom: 0; | |
a1dfa0c6 XL |
1185 | } |
1186 | ||
3c0e092e XL |
1187 | .sub-variant { |
1188 | margin-left: 24px; | |
1189 | margin-bottom: 40px; | |
a1dfa0c6 XL |
1190 | } |
1191 | ||
3c0e092e XL |
1192 | .sub-variant > .sub-variant-field { |
1193 | margin-left: 24px; | |
3157f602 XL |
1194 | } |
1195 | ||
ea8adc8c XL |
1196 | .toggle-label { |
1197 | display: inline-block; | |
1198 | margin-left: 4px; | |
1199 | margin-top: 3px; | |
1200 | } | |
1201 | ||
3c0e092e | 1202 | .top-doc .docblock > .section-header:first-child { |
abe05a73 | 1203 | margin-left: 15px; |
abe05a73 | 1204 | } |
3c0e092e | 1205 | .top-doc .docblock > .section-header:first-child:hover > a:before { |
abe05a73 XL |
1206 | left: -10px; |
1207 | } | |
1208 | ||
3c0e092e XL |
1209 | .docblock > .section-header:first-child { |
1210 | margin-top: 0; | |
1211 | } | |
1212 | ||
17df50a5 | 1213 | :target > code, :target > .code-header { |
8bb4bdeb | 1214 | opacity: 1; |
a7813a04 | 1215 | } |
1a4d82fc | 1216 | |
136023e0 XL |
1217 | :target { |
1218 | padding-right: 3px; | |
1219 | } | |
1220 | ||
48663c56 XL |
1221 | .information { |
1222 | position: absolute; | |
ba9703b0 | 1223 | left: -25px; |
48663c56 XL |
1224 | margin-top: 7px; |
1225 | z-index: 1; | |
1226 | } | |
1227 | ||
1228 | .tooltip { | |
1229 | position: relative; | |
1230 | display: inline-block; | |
1231 | cursor: pointer; | |
1232 | } | |
1233 | ||
fc512014 | 1234 | .tooltip::after { |
48663c56 XL |
1235 | display: none; |
1236 | text-align: center; | |
ba9703b0 | 1237 | padding: 5px 3px 3px 3px; |
48663c56 XL |
1238 | border-radius: 6px; |
1239 | margin-left: 5px; | |
a2a8927a | 1240 | font-size: 1rem; |
48663c56 XL |
1241 | } |
1242 | ||
fc512014 XL |
1243 | .tooltip.ignore::after { |
1244 | content: "This example is not tested"; | |
1245 | } | |
1246 | .tooltip.compile_fail::after { | |
1247 | content: "This example deliberately fails to compile"; | |
1248 | } | |
1249 | .tooltip.should_panic::after { | |
1250 | content: "This example panics"; | |
1251 | } | |
1252 | .tooltip.edition::after { | |
1253 | content: "This code runs with edition " attr(data-edition); | |
1254 | } | |
1255 | ||
1256 | .tooltip::before { | |
48663c56 XL |
1257 | content: " "; |
1258 | position: absolute; | |
1259 | top: 50%; | |
ba9703b0 | 1260 | left: 16px; |
48663c56 XL |
1261 | margin-top: -5px; |
1262 | border-width: 5px; | |
1263 | border-style: solid; | |
fc512014 | 1264 | display: none; |
48663c56 XL |
1265 | } |
1266 | ||
fc512014 | 1267 | .tooltip:hover::before, .tooltip:hover::after { |
29967ef6 XL |
1268 | display: inline; |
1269 | } | |
1270 | ||
f035d41b | 1271 | .tooltip.compile_fail, .tooltip.should_panic, .tooltip.ignore { |
ba9703b0 | 1272 | font-weight: bold; |
a2a8927a | 1273 | font-size: 1.25rem; |
ba9703b0 XL |
1274 | } |
1275 | ||
3dfed10e XL |
1276 | .notable-traits-tooltip { |
1277 | display: inline-block; | |
1278 | cursor: pointer; | |
1279 | } | |
1280 | ||
1281 | .notable-traits:hover .notable-traits-tooltiptext, | |
1282 | .notable-traits .notable-traits-tooltiptext.force-tooltip { | |
1283 | display: inline-block; | |
1284 | } | |
1285 | ||
1286 | .notable-traits .notable-traits-tooltiptext { | |
1287 | display: none; | |
1288 | padding: 5px 3px 3px 3px; | |
1289 | border-radius: 6px; | |
1290 | margin-left: 5px; | |
1291 | z-index: 10; | |
a2a8927a | 1292 | font-size: 1rem; |
3dfed10e XL |
1293 | cursor: default; |
1294 | position: absolute; | |
48663c56 XL |
1295 | border: 1px solid; |
1296 | } | |
1297 | ||
3dfed10e XL |
1298 | .notable-traits-tooltip::after { |
1299 | /* The margin on the tooltip does not capture hover events, | |
1300 | this extends the area of hover enough so that mouse hover is not | |
1301 | lost when moving the mouse to the tooltip */ | |
1302 | content: "\00a0\00a0\00a0"; | |
1303 | } | |
1304 | ||
1305 | .notable-traits .notable, .notable-traits .docblock { | |
1306 | margin: 0; | |
1307 | } | |
1308 | ||
17df50a5 XL |
1309 | .notable-traits .notable { |
1310 | margin: 0; | |
1311 | margin-bottom: 13px; | |
a2a8927a | 1312 | font-size: 1.1875rem; |
17df50a5 XL |
1313 | font-weight: 600; |
1314 | } | |
1315 | ||
3dfed10e XL |
1316 | .notable-traits .docblock code.content{ |
1317 | margin: 0; | |
1318 | padding: 0; | |
a2a8927a | 1319 | font-size: 1.25rem; |
3dfed10e XL |
1320 | } |
1321 | ||
1322 | /* Example code has the "Run" button that needs to be positioned relative to the pre */ | |
1323 | pre.rust.rust-example-rendered { | |
48663c56 | 1324 | position: relative; |
3dfed10e XL |
1325 | } |
1326 | ||
1327 | pre.rust { | |
ba9703b0 XL |
1328 | tab-size: 4; |
1329 | -moz-tab-size: 4; | |
48663c56 XL |
1330 | } |
1331 | ||
1332 | .search-failed { | |
1333 | text-align: center; | |
1334 | margin-top: 20px; | |
17df50a5 XL |
1335 | display: none; |
1336 | } | |
1337 | ||
1338 | .search-failed.active { | |
1339 | display: block; | |
48663c56 XL |
1340 | } |
1341 | ||
1342 | .search-failed > ul { | |
1343 | text-align: left; | |
1344 | max-width: 570px; | |
1345 | margin-left: auto; | |
1346 | margin-right: auto; | |
1347 | } | |
1348 | ||
1349 | #titles { | |
1350 | height: 35px; | |
1351 | } | |
1352 | ||
fc512014 | 1353 | #titles > button { |
48663c56 XL |
1354 | float: left; |
1355 | width: 33.3%; | |
1356 | text-align: center; | |
a2a8927a | 1357 | font-size: 1.125rem; |
48663c56 | 1358 | cursor: pointer; |
fc512014 | 1359 | border: 0; |
48663c56 XL |
1360 | border-top: 2px solid; |
1361 | } | |
1362 | ||
fc512014 | 1363 | #titles > button:not(:last-child) { |
48663c56 XL |
1364 | margin-right: 1px; |
1365 | width: calc(33.3% - 1px); | |
1366 | } | |
1367 | ||
fc512014 | 1368 | #titles > button > div.count { |
48663c56 | 1369 | display: inline-block; |
a2a8927a | 1370 | font-size: 1rem; |
48663c56 XL |
1371 | } |
1372 | ||
3dfed10e XL |
1373 | .notable-traits { |
1374 | cursor: pointer; | |
1375 | z-index: 2; | |
1376 | margin-left: 5px; | |
1377 | } | |
1378 | ||
48663c56 XL |
1379 | #all-types { |
1380 | text-align: center; | |
1381 | border: 1px solid; | |
1382 | margin: 0 10px; | |
1383 | margin-bottom: 10px; | |
1384 | display: block; | |
1385 | border-radius: 7px; | |
1386 | } | |
1387 | #all-types > p { | |
1388 | margin: 5px 0; | |
1389 | } | |
1390 | ||
1391 | #sidebar-toggle { | |
a2a8927a XL |
1392 | position: sticky; |
1393 | top: 0; | |
1394 | left: 0; | |
48663c56 XL |
1395 | cursor: pointer; |
1396 | font-weight: bold; | |
a2a8927a XL |
1397 | font-size: 1.2rem; |
1398 | border-bottom: 1px solid; | |
1399 | display: flex; | |
1400 | height: 40px; | |
1401 | justify-content: center; | |
1402 | align-items: center; | |
1403 | z-index: 10; | |
48663c56 XL |
1404 | } |
1405 | #source-sidebar { | |
a2a8927a | 1406 | width: 100%; |
48663c56 XL |
1407 | z-index: 1; |
1408 | overflow: auto; | |
48663c56 XL |
1409 | } |
1410 | #source-sidebar > .title { | |
a2a8927a | 1411 | font-size: 1.5rem; |
48663c56 XL |
1412 | text-align: center; |
1413 | border-bottom: 1px solid; | |
1414 | margin-bottom: 6px; | |
1415 | } | |
1416 | ||
1417 | .theme-picker { | |
1418 | position: absolute; | |
a2a8927a XL |
1419 | left: -34px; |
1420 | top: 9px; | |
48663c56 XL |
1421 | } |
1422 | ||
1423 | .theme-picker button { | |
1424 | outline: none; | |
1425 | } | |
1426 | ||
17df50a5 | 1427 | #settings-menu, #help-button { |
48663c56 | 1428 | position: absolute; |
48663c56 | 1429 | top: 10px; |
3dfed10e XL |
1430 | } |
1431 | ||
1432 | #settings-menu { | |
1433 | right: 0; | |
48663c56 XL |
1434 | outline: none; |
1435 | } | |
1436 | ||
17df50a5 | 1437 | #theme-picker, #settings-menu, #help-button, #copy-path { |
cdc7bbd5 | 1438 | padding: 4px; |
a2a8927a XL |
1439 | /* Rare exception to specifying font sizes in rem. Since these are acting |
1440 | as icons, it's okay to specify their sizes in pixels. */ | |
1441 | font-size: 16px; | |
cdc7bbd5 XL |
1442 | width: 27px; |
1443 | height: 29px; | |
1444 | border: 1px solid; | |
1445 | border-radius: 3px; | |
1446 | cursor: pointer; | |
1447 | } | |
1448 | ||
17df50a5 | 1449 | #help-button { |
3dfed10e | 1450 | right: 30px; |
6a06907d | 1451 | font-family: "Fira Sans", Arial, sans-serif; |
3dfed10e | 1452 | text-align: center; |
a2a8927a XL |
1453 | /* Rare exception to specifying font sizes in rem. Since this is acting |
1454 | as an icon, it's okay to specify their sizes in pixels. */ | |
1455 | font-size: 16px; | |
cdc7bbd5 | 1456 | padding-top: 2px; |
3dfed10e XL |
1457 | } |
1458 | ||
cdc7bbd5 | 1459 | #copy-path { |
17df50a5 | 1460 | background: initial; |
cdc7bbd5 | 1461 | margin-left: 10px; |
17df50a5 XL |
1462 | padding: 0; |
1463 | padding-left: 2px; | |
1464 | border: 0; | |
48663c56 XL |
1465 | } |
1466 | ||
1467 | #theme-choices { | |
1468 | display: none; | |
1469 | position: absolute; | |
1470 | left: 0; | |
1471 | top: 28px; | |
1472 | border: 1px solid; | |
1473 | border-radius: 3px; | |
1474 | z-index: 1; | |
1475 | cursor: pointer; | |
1476 | } | |
1477 | ||
1478 | #theme-choices > button { | |
1479 | border: none; | |
1480 | width: 100%; | |
1b1a35ee | 1481 | padding: 4px 8px; |
48663c56 XL |
1482 | text-align: center; |
1483 | background: rgba(0,0,0,0); | |
1484 | } | |
1485 | ||
1486 | #theme-choices > button:not(:first-child) { | |
1487 | border-top: 1px solid; | |
1488 | } | |
1489 | ||
17df50a5 XL |
1490 | kbd { |
1491 | display: inline-block; | |
1492 | padding: 3px 5px; | |
1493 | font: 15px monospace; | |
1494 | line-height: 10px; | |
1495 | vertical-align: middle; | |
1496 | border: solid 1px; | |
1497 | border-radius: 3px; | |
1498 | box-shadow: inset 0 -1px 0; | |
1499 | cursor: default; | |
1500 | } | |
1501 | ||
1502 | .hidden-by-impl-hider, | |
1503 | .hidden-by-usual-hider { | |
1504 | /* important because of conflicting rule for small screens */ | |
1505 | display: none !important; | |
1506 | } | |
1507 | ||
1508 | #implementations-list > h3 > span.in-band { | |
1509 | width: 100%; | |
1510 | } | |
1511 | ||
1512 | .table-display { | |
1513 | width: 100%; | |
1514 | border: 0; | |
1515 | border-collapse: collapse; | |
1516 | border-spacing: 0; | |
a2a8927a | 1517 | font-size: 1rem; |
17df50a5 XL |
1518 | } |
1519 | ||
1520 | .table-display tr td:first-child { | |
1521 | padding-right: 0; | |
1522 | } | |
1523 | ||
1524 | .table-display tr td:last-child { | |
1525 | float: right; | |
1526 | } | |
1527 | .table-display .out-of-band { | |
1528 | position: relative; | |
a2a8927a | 1529 | font-size: 1.1875rem; |
17df50a5 XL |
1530 | display: block; |
1531 | } | |
1532 | #implementors-list > .impl-items .table-display .out-of-band { | |
a2a8927a | 1533 | font-size: 1.0625rem; |
17df50a5 XL |
1534 | } |
1535 | ||
1536 | .table-display td:hover .anchor { | |
1537 | display: block; | |
1538 | top: 2px; | |
1539 | left: -5px; | |
1540 | } | |
1541 | ||
a2a8927a | 1542 | #main-content > ul { |
17df50a5 XL |
1543 | padding-left: 10px; |
1544 | } | |
a2a8927a | 1545 | #main-content > ul > li { |
17df50a5 XL |
1546 | list-style: none; |
1547 | } | |
1548 | ||
1549 | .non-exhaustive { | |
1550 | margin-bottom: 1em; | |
1551 | } | |
1552 | ||
1553 | div.children { | |
1554 | padding-left: 27px; | |
1555 | display: none; | |
1556 | } | |
1557 | div.name { | |
1558 | cursor: pointer; | |
1559 | position: relative; | |
1560 | margin-left: 16px; | |
1561 | } | |
1562 | div.files > a { | |
1563 | display: block; | |
1564 | padding: 0 3px; | |
1565 | } | |
1566 | div.files > a:hover, div.name:hover { | |
1567 | background-color: #a14b4b; | |
1568 | } | |
1569 | div.name.expand + .children { | |
1570 | display: block; | |
1571 | } | |
1572 | div.name::before { | |
1573 | content: "\25B6"; | |
1574 | padding-left: 4px; | |
a2a8927a | 1575 | font-size: 0.7rem; |
17df50a5 XL |
1576 | position: absolute; |
1577 | left: -16px; | |
1578 | top: 4px; | |
1579 | } | |
1580 | div.name.expand::before { | |
1581 | transform: rotate(90deg); | |
1582 | left: -15px; | |
1583 | top: 2px; | |
1584 | } | |
1585 | ||
1586 | /* The hideme class is used on summary tags that contain a span with | |
1587 | placeholder text shown only when the toggle is closed. For instance, | |
1588 | "Expand description" or "Show methods". */ | |
1589 | details.rustdoc-toggle > summary.hideme { | |
1590 | cursor: pointer; | |
1591 | } | |
1592 | ||
3c0e092e | 1593 | details.rustdoc-toggle > summary { |
17df50a5 XL |
1594 | list-style: none; |
1595 | } | |
1596 | details.rustdoc-toggle > summary::-webkit-details-marker, | |
3c0e092e | 1597 | details.rustdoc-toggle > summary::marker { |
17df50a5 XL |
1598 | display: none; |
1599 | } | |
1600 | ||
1601 | details.rustdoc-toggle > summary.hideme > span { | |
1602 | margin-left: 9px; | |
1603 | } | |
1604 | ||
1605 | details.rustdoc-toggle > summary::before { | |
94222f64 | 1606 | content: ""; |
17df50a5 | 1607 | cursor: pointer; |
94222f64 XL |
1608 | width: 17px; |
1609 | height: max(17px, 1.1em); | |
1610 | background-repeat: no-repeat; | |
1611 | background-position: top left; | |
1612 | display: inline-block; | |
1613 | vertical-align: middle; | |
1614 | opacity: .5; | |
1615 | } | |
1616 | ||
1617 | /* Screen readers see the text version at the end the line. | |
1618 | Visual readers see the icon at the start of the line, but small and transparent. */ | |
1619 | details.rustdoc-toggle > summary::after { | |
1620 | content: "Expand"; | |
1621 | overflow: hidden; | |
1622 | width: 0; | |
1623 | height: 0; | |
1624 | position: absolute; | |
1625 | } | |
1626 | ||
1627 | details.rustdoc-toggle > summary.hideme::after { | |
1628 | /* "hideme" toggles already have a description when they're contracted */ | |
1629 | content: ""; | |
1630 | } | |
1631 | ||
1632 | details.rustdoc-toggle > summary:focus::before, | |
1633 | details.rustdoc-toggle > summary:hover::before { | |
1634 | opacity: 1; | |
17df50a5 XL |
1635 | } |
1636 | ||
1637 | details.rustdoc-toggle.top-doc > summary, | |
1638 | details.rustdoc-toggle.top-doc > summary::before, | |
1639 | details.rustdoc-toggle.non-exhaustive > summary, | |
1640 | details.rustdoc-toggle.non-exhaustive > summary::before { | |
1641 | font-family: 'Fira Sans'; | |
a2a8927a | 1642 | font-size: 1rem; |
17df50a5 XL |
1643 | } |
1644 | ||
1645 | details.non-exhaustive { | |
1646 | margin-bottom: 8px; | |
1647 | } | |
1648 | ||
1649 | details.rustdoc-toggle > summary.hideme::before { | |
1650 | position: relative; | |
1651 | } | |
1652 | ||
1653 | details.rustdoc-toggle > summary:not(.hideme)::before { | |
1654 | position: absolute; | |
3c0e092e | 1655 | left: -24px; |
17df50a5 XL |
1656 | top: 3px; |
1657 | } | |
1658 | ||
3c0e092e | 1659 | .impl-items > details.rustdoc-toggle > summary:not(.hideme)::before { |
17df50a5 | 1660 | position: absolute; |
3c0e092e | 1661 | left: -24px; |
17df50a5 XL |
1662 | } |
1663 | ||
1664 | /* When a "hideme" summary is open and the "Expand description" or "Show | |
1665 | methods" text is hidden, we want the [-] toggle that remains to not | |
1666 | affect the layout of the items to its right. To do that, we use | |
1667 | absolute positioning. Note that we also set position: relative | |
1668 | on the parent <details> to make this work properly. */ | |
1669 | details.rustdoc-toggle[open] > summary.hideme { | |
1670 | position: absolute; | |
1671 | } | |
1672 | ||
3c0e092e | 1673 | details.rustdoc-toggle { |
17df50a5 XL |
1674 | position: relative; |
1675 | } | |
1676 | ||
1677 | details.rustdoc-toggle[open] > summary.hideme > span { | |
1678 | display: none; | |
1679 | } | |
1680 | ||
a2a8927a XL |
1681 | details.undocumented[open] > summary::before, |
1682 | details.rustdoc-toggle[open] > summary::before, | |
1683 | details.rustdoc-toggle[open] > summary.hideme::before { | |
1684 | background-image: /* AUTOREPLACE: */url("toggle-minus.svg"); | |
1685 | } | |
1686 | ||
1687 | details.undocumented > summary::before, details.rustdoc-toggle > summary::before { | |
1688 | background-image: /* AUTOREPLACE: */url("toggle-plus.svg"); | |
1689 | } | |
1690 | ||
94222f64 XL |
1691 | details.rustdoc-toggle[open] > summary::before, |
1692 | details.rustdoc-toggle[open] > summary.hideme::before { | |
1693 | width: 17px; | |
1694 | height: max(17px, 1.1em); | |
1695 | background-repeat: no-repeat; | |
1696 | background-position: top left; | |
1697 | display: inline-block; | |
1698 | content: ""; | |
1699 | } | |
1700 | ||
1701 | details.rustdoc-toggle[open] > summary::after, | |
1702 | details.rustdoc-toggle[open] > summary.hideme::after { | |
1703 | content: "Collapse"; | |
17df50a5 XL |
1704 | } |
1705 | ||
1a4d82fc JJ |
1706 | /* Media Queries */ |
1707 | ||
3dfed10e XL |
1708 | @media (min-width: 701px) { |
1709 | /* In case there is no documentation before a code block, we need to add some margin at the top | |
1710 | to prevent an overlay between the "collapse toggle" and the information tooltip. | |
6a06907d | 1711 | However, it's not needed with smaller screen width because the doc/code block is always put |
3dfed10e | 1712 | "one line" below. */ |
cdc7bbd5 | 1713 | .docblock > .information:first-child > .tooltip { |
3dfed10e XL |
1714 | margin-top: 16px; |
1715 | } | |
a2a8927a XL |
1716 | |
1717 | /* When we expand the sidebar on the source code page, we hide the logo on the left of the | |
1718 | search bar to have more space. */ | |
1719 | .sidebar.expanded + main .width-limiter .sub-logo-container.rust-logo { | |
1720 | display: none; | |
1721 | } | |
1722 | ||
1723 | /* It doesn't render well on mobile because of the layout, so better only have the transition | |
1724 | on desktop. */ | |
1725 | .rustdoc.source .sidebar { | |
1726 | transition: width .5s; | |
1727 | } | |
1728 | ||
1729 | .source .sidebar.expanded { | |
1730 | width: 300px; | |
1731 | } | |
3dfed10e XL |
1732 | } |
1733 | ||
1a4d82fc | 1734 | @media (max-width: 700px) { |
476ff2be SL |
1735 | body { |
1736 | padding-top: 0px; | |
1737 | } | |
1738 | ||
a2a8927a XL |
1739 | main { |
1740 | padding-left: 15px; | |
1741 | padding-top: 0px; | |
1742 | } | |
1743 | ||
1744 | .rustdoc { | |
1745 | flex-direction: column; | |
1746 | } | |
1747 | ||
1748 | .rustdoc:not(.source) > .sidebar { | |
1749 | width: 100%; | |
abe05a73 | 1750 | height: 45px; |
476ff2be | 1751 | min-height: 40px; |
a2a8927a | 1752 | max-height: 45px; |
abe05a73 | 1753 | margin: 0; |
abe05a73 | 1754 | padding: 0 15px; |
476ff2be | 1755 | position: static; |
0731742a | 1756 | z-index: 11; |
a2a8927a XL |
1757 | overflow-y: hidden; |
1758 | } | |
1759 | ||
1760 | .rustdoc.source > .sidebar { | |
1761 | position: fixed; | |
1762 | top: 0; | |
1763 | left: 0; | |
1764 | margin: 0; | |
1765 | z-index: 11; | |
1766 | width: 0; | |
1767 | } | |
1768 | ||
1769 | .sidebar.mobile { | |
1770 | position: sticky !important; | |
1771 | top: 0; | |
1772 | left: 0; | |
1773 | width: 100%; | |
1774 | margin-left: 0; | |
1775 | background-color: rgba(0,0,0,0); | |
476ff2be SL |
1776 | } |
1777 | ||
ff7c6d11 | 1778 | .sidebar > .location { |
476ff2be SL |
1779 | float: right; |
1780 | margin: 0px; | |
abe05a73 | 1781 | margin-top: 2px; |
476ff2be SL |
1782 | padding: 3px 10px 1px 10px; |
1783 | min-height: 39px; | |
1784 | background: inherit; | |
1785 | text-align: left; | |
a2a8927a | 1786 | font-size: 1.5rem; |
476ff2be SL |
1787 | } |
1788 | ||
1789 | .sidebar .location:empty { | |
1790 | padding: 0; | |
1791 | } | |
1792 | ||
a2a8927a | 1793 | .rustdoc:not(.source) .sidebar .logo-container { |
476ff2be | 1794 | width: 35px; |
48663c56 | 1795 | height: 35px; |
476ff2be | 1796 | margin-top: 5px; |
abe05a73 | 1797 | margin-bottom: 5px; |
476ff2be | 1798 | float: left; |
ff7c6d11 | 1799 | margin-left: 50px; |
476ff2be SL |
1800 | } |
1801 | ||
48663c56 XL |
1802 | .sidebar .logo-container > img { |
1803 | max-width: 35px; | |
1804 | max-height: 35px; | |
1805 | } | |
1806 | ||
ff7c6d11 XL |
1807 | .sidebar-menu { |
1808 | position: fixed; | |
1809 | z-index: 10; | |
1810 | font-size: 2rem; | |
1811 | cursor: pointer; | |
1812 | width: 45px; | |
1813 | left: 0; | |
a2a8927a | 1814 | top: 0; |
ff7c6d11 XL |
1815 | text-align: center; |
1816 | display: block; | |
1817 | border-bottom: 1px solid; | |
1818 | border-right: 1px solid; | |
2c00a5a8 | 1819 | height: 45px; |
476ff2be SL |
1820 | } |
1821 | ||
48663c56 XL |
1822 | .rustdoc.source > .sidebar > .sidebar-menu { |
1823 | display: none; | |
1824 | } | |
1825 | ||
17df50a5 XL |
1826 | /* We do NOT hide this element so that alternative device readers still have this information |
1827 | available. */ | |
ff7c6d11 XL |
1828 | .sidebar-elems { |
1829 | position: fixed; | |
1830 | z-index: 1; | |
ff7c6d11 XL |
1831 | top: 45px; |
1832 | bottom: 0; | |
17df50a5 XL |
1833 | width: 246px; |
1834 | /* We move the sidebar to the left by its own width so it doesn't appear. */ | |
1835 | left: -246px; | |
ff7c6d11 XL |
1836 | overflow-y: auto; |
1837 | border-right: 1px solid; | |
476ff2be SL |
1838 | } |
1839 | ||
ff7c6d11 | 1840 | .sidebar > .block.version { |
136023e0 | 1841 | overflow: hidden; |
ff7c6d11 | 1842 | border-bottom: none; |
5869c6ff | 1843 | margin-bottom: 0; |
136023e0 XL |
1844 | height: 100%; |
1845 | padding-left: 12px; | |
1846 | } | |
1847 | .sidebar > .block.version > div.narrow-helper { | |
1848 | float: left; | |
1849 | width: 1px; | |
1850 | height: 100%; | |
1851 | } | |
1852 | .sidebar > .block.version > p { | |
1853 | /* hide Version text if too narrow */ | |
1854 | margin: 0; | |
1855 | min-width: 55px; | |
1856 | /* vertically center */ | |
1857 | display: flex; | |
1858 | align-items: center; | |
1859 | height: 100%; | |
ff7c6d11 XL |
1860 | } |
1861 | ||
1862 | nav.sub { | |
2c00a5a8 | 1863 | width: calc(100% - 32px); |
a2a8927a XL |
1864 | margin-left: 32px; |
1865 | margin-bottom: 10px; | |
1866 | } | |
1867 | ||
1868 | .source nav:not(.sidebar).sub { | |
1869 | margin-left: 32px; | |
ff7c6d11 XL |
1870 | } |
1871 | ||
476ff2be SL |
1872 | .content { |
1873 | margin-left: 0px; | |
1874 | } | |
1875 | ||
a2a8927a XL |
1876 | .source .content { |
1877 | margin-top: 10px; | |
2c00a5a8 XL |
1878 | } |
1879 | ||
abe05a73 XL |
1880 | #search { |
1881 | margin-left: 0; | |
a2a8927a | 1882 | padding: 0; |
abe05a73 XL |
1883 | } |
1884 | ||
0531ce1d XL |
1885 | .anchor { |
1886 | display: none !important; | |
1887 | } | |
0bf4aa26 | 1888 | |
48663c56 | 1889 | .theme-picker { |
48663c56 | 1890 | z-index: 1; |
476ff2be | 1891 | } |
ea8adc8c | 1892 | |
17df50a5 | 1893 | .notable-traits { |
3dfed10e XL |
1894 | position: absolute; |
1895 | left: -22px; | |
1896 | top: 24px; | |
1897 | } | |
1898 | ||
fc512014 | 1899 | #titles > button > div.count { |
ff7c6d11 XL |
1900 | float: left; |
1901 | width: 100%; | |
1902 | } | |
1903 | ||
1904 | #titles { | |
1905 | height: 50px; | |
1906 | } | |
1907 | ||
136023e0 XL |
1908 | .show-it, .sidebar-elems:focus-within { |
1909 | z-index: 2; | |
17df50a5 | 1910 | left: 0; |
2c00a5a8 XL |
1911 | } |
1912 | ||
1913 | .show-it > .block.items { | |
1914 | margin: 8px 0; | |
1915 | } | |
1916 | ||
1917 | .show-it > .block.items > ul { | |
1918 | margin: 0; | |
1919 | } | |
1920 | ||
1921 | .show-it > .block.items > ul > li { | |
1922 | text-align: center; | |
1923 | margin: 2px 0; | |
1924 | } | |
1925 | ||
1926 | .show-it > .block.items > ul > li > a { | |
a2a8927a | 1927 | font-size: 1.3125rem; |
ff7c6d11 XL |
1928 | } |
1929 | ||
1930 | /* Because of ios, we need to actually have a full height sidebar title so the | |
1931 | * actual sidebar can show up. But then we need to make it transparent so we don't | |
1932 | * hide content. The filler just allows to create the background for the sidebar | |
1933 | * title. But because of the absolute position, I had to lower the z-index. | |
1934 | */ | |
1935 | #sidebar-filler { | |
1936 | position: fixed; | |
1937 | left: 45px; | |
1938 | width: calc(100% - 45px); | |
1939 | top: 0; | |
1940 | height: 45px; | |
1941 | z-index: -1; | |
1942 | border-bottom: 1px solid; | |
1943 | } | |
0531ce1d | 1944 | |
a2a8927a XL |
1945 | #main-content > details.rustdoc-toggle > summary::before, |
1946 | #main-content > div > details.rustdoc-toggle > summary::before { | |
17df50a5 | 1947 | left: -11px; |
cdc7bbd5 XL |
1948 | } |
1949 | ||
0bf4aa26 XL |
1950 | #all-types { |
1951 | margin: 10px; | |
1952 | } | |
48663c56 | 1953 | |
a2a8927a XL |
1954 | .sidebar.expanded #sidebar-toggle { |
1955 | font-size: 1.5rem; | |
1956 | } | |
1957 | ||
1958 | .sidebar:not(.expanded) #sidebar-toggle { | |
1959 | position: fixed; | |
1960 | left: 1px; | |
48663c56 XL |
1961 | top: 100px; |
1962 | width: 30px; | |
1963 | font-size: 1.5rem; | |
1964 | text-align: center; | |
1965 | padding: 0; | |
a2a8927a XL |
1966 | z-index: 10; |
1967 | border-top-right-radius: 3px; | |
1968 | border-bottom-right-radius: 3px; | |
1969 | cursor: pointer; | |
1970 | font-weight: bold; | |
1971 | border: 1px solid; | |
1972 | border-left: 0; | |
48663c56 XL |
1973 | } |
1974 | ||
1975 | #source-sidebar { | |
1976 | z-index: 11; | |
1977 | } | |
1978 | ||
a2a8927a | 1979 | #main-content > .line-numbers { |
48663c56 XL |
1980 | margin-top: 0; |
1981 | } | |
3dfed10e XL |
1982 | |
1983 | .notable-traits .notable-traits-tooltiptext { | |
1984 | left: 0; | |
1985 | top: 100%; | |
1986 | } | |
29967ef6 XL |
1987 | |
1988 | /* We don't display the help button on mobile devices. */ | |
17df50a5 | 1989 | #help-button { |
29967ef6 XL |
1990 | display: none; |
1991 | } | |
136023e0 XL |
1992 | |
1993 | /* Display an alternating layout on tablets and phones */ | |
1994 | .item-table { | |
c295e0f8 XL |
1995 | display: block; |
1996 | } | |
1997 | .item-row { | |
136023e0 XL |
1998 | display: flex; |
1999 | flex-flow: column wrap; | |
2000 | } | |
2001 | .item-left, .item-right { | |
2002 | width: 100%; | |
2003 | } | |
2004 | ||
29967ef6 XL |
2005 | .search-container > div { |
2006 | width: calc(100% - 32px); | |
2007 | } | |
17df50a5 XL |
2008 | |
2009 | /* Display an alternating layout on tablets and phones */ | |
2010 | .search-results > a { | |
2011 | border-bottom: 1px solid #aaa9; | |
2012 | padding: 5px 0px; | |
2013 | } | |
2014 | .search-results .result-name, .search-results div.desc, .search-results .result-description { | |
2015 | width: 100%; | |
2016 | } | |
136023e0 | 2017 | .search-results div.desc, .search-results .result-description, .item-right { |
17df50a5 XL |
2018 | padding-left: 2em; |
2019 | } | |
a2a8927a XL |
2020 | |
2021 | .source .sidebar.expanded { | |
2022 | max-width: 100vw; | |
2023 | width: 100vw; | |
2024 | } | |
2025 | ||
2026 | /* Position of the "[-]" element. */ | |
2027 | details.rustdoc-toggle:not(.top-doc) > summary { | |
2028 | margin-left: 10px; | |
2029 | } | |
2030 | .impl-items > details.rustdoc-toggle > summary:not(.hideme)::before, | |
2031 | #main-content > details.rustdoc-toggle:not(.top-doc) > summary::before, | |
2032 | #main-content > div > details.rustdoc-toggle > summary::before { | |
2033 | left: -11px; | |
2034 | } | |
ff7c6d11 XL |
2035 | } |
2036 | ||
48663c56 | 2037 | @media print { |
17df50a5 | 2038 | nav.sub, .content .out-of-band { |
48663c56 XL |
2039 | display: none; |
2040 | } | |
2041 | } | |
ff7c6d11 | 2042 | |
5869c6ff | 2043 | @media (max-width: 464px) { |
fc512014 | 2044 | #titles, #titles > button { |
ff7c6d11 XL |
2045 | height: 73px; |
2046 | } | |
2047 | ||
a2a8927a | 2048 | #main-content > table:not(.table-display) td { |
29967ef6 | 2049 | word-break: break-word; |
fc512014 | 2050 | width: 50%; |
29967ef6 XL |
2051 | } |
2052 | ||
2053 | .search-container > div { | |
2054 | display: block; | |
2055 | width: calc(100% - 37px); | |
2056 | } | |
2057 | ||
2058 | #crate-search { | |
2059 | width: 100%; | |
2060 | border-radius: 4px; | |
2061 | border: 0; | |
2062 | } | |
2063 | ||
2064 | #crate-search + .search-input { | |
2065 | width: calc(100% + 71px); | |
2066 | margin-left: -36px; | |
2067 | } | |
2068 | ||
2069 | #theme-picker, #settings-menu { | |
2070 | padding: 5px; | |
2071 | width: 31px; | |
2072 | height: 31px; | |
2073 | } | |
2074 | ||
2075 | #theme-picker { | |
2076 | margin-top: -2px; | |
2077 | } | |
2078 | ||
2079 | #settings-menu { | |
2080 | top: 7px; | |
ff7c6d11 | 2081 | } |
5869c6ff XL |
2082 | |
2083 | .docblock { | |
2084 | margin-left: 12px; | |
2085 | } | |
c295e0f8 XL |
2086 | |
2087 | .docblock code { | |
2088 | overflow-wrap: anywhere; | |
2089 | } | |
a2a8927a XL |
2090 | |
2091 | .sub-container { | |
2092 | flex-direction: column; | |
2093 | } | |
2094 | ||
2095 | .sub-logo-container { | |
2096 | align-self: center; | |
2097 | } | |
2098 | ||
2099 | .source .sub-logo-container > img { | |
2100 | height: 35px; | |
2101 | width: 35px; | |
2102 | } | |
2103 | ||
2104 | .sidebar:not(.expanded) #sidebar-toggle { | |
2105 | top: 10px; | |
2106 | } | |
ff7c6d11 | 2107 | } |
3c0e092e XL |
2108 | |
2109 | ||
2110 | /* Begin: styles for --scrape-examples feature */ | |
2111 | ||
2112 | .scraped-example-title { | |
2113 | font-family: 'Fira Sans'; | |
2114 | } | |
2115 | ||
2116 | .scraped-example:not(.expanded) .code-wrapper pre.line-numbers { | |
2117 | overflow: hidden; | |
2118 | max-height: 240px; | |
2119 | } | |
2120 | ||
2121 | .scraped-example:not(.expanded) .code-wrapper .example-wrap pre.rust { | |
2122 | overflow-y: hidden; | |
2123 | max-height: 240px; | |
2124 | padding-bottom: 0; | |
2125 | } | |
2126 | ||
2127 | .scraped-example .code-wrapper .prev { | |
2128 | position: absolute; | |
2129 | top: 0.25em; | |
2130 | right: 2.25em; | |
2131 | z-index: 100; | |
2132 | cursor: pointer; | |
2133 | } | |
2134 | ||
2135 | .scraped-example .code-wrapper .next { | |
2136 | position: absolute; | |
2137 | top: 0.25em; | |
2138 | right: 1.25em; | |
2139 | z-index: 100; | |
2140 | cursor: pointer; | |
2141 | } | |
2142 | ||
2143 | .scraped-example .code-wrapper .expand { | |
2144 | position: absolute; | |
2145 | top: 0.25em; | |
2146 | right: 0.25em; | |
2147 | z-index: 100; | |
2148 | cursor: pointer; | |
2149 | } | |
2150 | ||
2151 | .scraped-example .code-wrapper { | |
2152 | position: relative; | |
2153 | display: flex; | |
2154 | flex-direction: row; | |
2155 | flex-wrap: wrap; | |
2156 | width: 100%; | |
2157 | } | |
2158 | ||
2159 | .scraped-example:not(.expanded) .code-wrapper:before { | |
2160 | content: " "; | |
2161 | width: 100%; | |
2162 | height: 5px; | |
2163 | position: absolute; | |
2164 | z-index: 100; | |
2165 | top: 0; | |
2166 | background: linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0)); | |
2167 | } | |
2168 | ||
2169 | .scraped-example:not(.expanded) .code-wrapper:after { | |
2170 | content: " "; | |
2171 | width: 100%; | |
2172 | height: 5px; | |
2173 | position: absolute; | |
2174 | z-index: 100; | |
2175 | bottom: 0; | |
2176 | background: linear-gradient(to top, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0)); | |
2177 | } | |
2178 | ||
2179 | .scraped-example:not(.expanded) .code-wrapper { | |
2180 | overflow: hidden; | |
2181 | max-height: 240px; | |
2182 | } | |
2183 | ||
2184 | .scraped-example .code-wrapper .line-numbers { | |
2185 | margin: 0; | |
2186 | padding: 14px 0; | |
2187 | } | |
2188 | ||
2189 | .scraped-example .code-wrapper .line-numbers span { | |
2190 | padding: 0 14px; | |
2191 | } | |
2192 | ||
2193 | .scraped-example .code-wrapper .example-wrap { | |
2194 | flex: 1; | |
2195 | overflow-x: auto; | |
2196 | overflow-y: hidden; | |
2197 | margin-bottom: 0; | |
2198 | } | |
2199 | ||
2200 | .scraped-example .code-wrapper .example-wrap pre.rust { | |
2201 | overflow-x: inherit; | |
2202 | width: inherit; | |
2203 | overflow-y: hidden; | |
2204 | } | |
2205 | ||
2206 | .scraped-example .example-wrap .rust span.highlight { | |
2207 | background: #fcffd6; | |
2208 | } | |
2209 | ||
2210 | .scraped-example .example-wrap .rust span.highlight.focus { | |
2211 | background: #f6fdb0; | |
2212 | } | |
2213 | ||
2214 | .more-examples-toggle { | |
2215 | margin-top: 10px; | |
2216 | } | |
2217 | ||
2218 | .more-examples-toggle summary { | |
2219 | color: #999; | |
2220 | font-family: 'Fira Sans'; | |
2221 | } | |
2222 | ||
2223 | .more-scraped-examples { | |
2224 | margin-left: 25px; | |
2225 | display: flex; | |
2226 | flex-direction: row; | |
2227 | width: calc(100% - 25px); | |
2228 | } | |
2229 | ||
2230 | .more-scraped-examples-inner { | |
2231 | /* 20px is width of toggle-line + toggle-line-inner */ | |
2232 | width: calc(100% - 20px); | |
2233 | } | |
2234 | ||
2235 | .toggle-line { | |
2236 | align-self: stretch; | |
2237 | margin-right: 10px; | |
2238 | margin-top: 5px; | |
2239 | padding: 0 4px; | |
2240 | cursor: pointer; | |
2241 | } | |
2242 | ||
2243 | .toggle-line:hover .toggle-line-inner { | |
2244 | background: #aaa; | |
2245 | } | |
2246 | ||
2247 | .toggle-line-inner { | |
2248 | min-width: 2px; | |
2249 | background: #ddd; | |
2250 | height: 100%; | |
2251 | } | |
2252 | ||
2253 | .more-scraped-examples .scraped-example { | |
2254 | margin-bottom: 20px; | |
2255 | } | |
2256 | ||
2257 | .more-scraped-examples .scraped-example:last-child { | |
2258 | margin-bottom: 0; | |
2259 | } | |
2260 | ||
2261 | .example-links a { | |
2262 | margin-top: 20px; | |
2263 | font-family: 'Fira Sans'; | |
2264 | } | |
2265 | ||
2266 | .example-links ul { | |
2267 | margin-bottom: 0; | |
2268 | } | |
2269 | ||
2270 | /* End: styles for --scrape-examples feature */ |