rustdoc.css 27.4 KB
Newer Older
1
/* See FiraSans-LICENSE.txt for the Fira Sans license. */
2
@font-face {
3 4 5 6
	font-family: 'Fira Sans';
	font-style: normal;
	font-weight: 400;
	src: local('Fira Sans'), url("FiraSans-Regular.woff") format('woff');
7 8
}
@font-face {
9 10 11 12
	font-family: 'Fira Sans';
	font-style: normal;
	font-weight: 500;
	src: local('Fira Sans Medium'), url("FiraSans-Medium.woff") format('woff');
13
}
14

15
/* See SourceSerifPro-LICENSE.txt for the Source Serif Pro license. */
16
@font-face {
17 18 19
	font-family: 'Source Serif Pro';
	font-style: normal;
	font-weight: 400;
20
	src: local('Source Serif Pro'), url("SourceSerifPro-Regular.ttf.woff") format('woff');
21 22
}
@font-face {
23 24 25
	font-family: 'Source Serif Pro';
	font-style: italic;
	font-weight: 400;
26
	src: local('Source Serif Pro Italic'), url("SourceSerifPro-It.ttf.woff") format('woff');
27 28
}
@font-face {
29 30 31
	font-family: 'Source Serif Pro';
	font-style: normal;
	font-weight: 700;
32
	src: local('Source Serif Pro Bold'), url("SourceSerifPro-Bold.ttf.woff") format('woff');
33
}
34 35

/* See SourceCodePro-LICENSE.txt for the Source Code Pro license. */
36
@font-face {
37 38 39
	font-family: 'Source Code Pro';
	font-style: normal;
	font-weight: 400;
40 41
	/* Avoid using locally installed font because bad versions are in circulation:
	 * see https://github.com/rust-lang/rust/issues/24355 */
42
	src: url("SourceCodePro-Regular.woff") format('woff');
43 44
}
@font-face {
45 46 47
	font-family: 'Source Code Pro';
	font-style: normal;
	font-weight: 600;
48
	src: url("SourceCodePro-Semibold.woff") format('woff');
49
}
50

51
* {
G
Guillaume Gomez 已提交
52 53 54
	-webkit-box-sizing: border-box;
	-moz-box-sizing: border-box;
	box-sizing: border-box;
55 56
}

57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
/* This part handles the "default" theme being used depending on the system one. */
html {
	content: "";
}
@media (prefers-color-scheme: light) {
	html {
		content: "light";
	}
}
@media (prefers-color-scheme: dark) {
	html {
		content: "dark";
	}
}

A
Adrien Tétar 已提交
72
/* General structure and fonts */
73 74

body {
J
Jon Gjengset 已提交
75
	font: 16px/1.4 "Source Serif Pro", serif;
76 77 78
	margin: 0;
	position: relative;
	padding: 10px 15px 20px 15px;
79

80 81 82
	-webkit-font-feature-settings: "kern", "liga";
	-moz-font-feature-settings: "kern", "liga";
	font-feature-settings: "kern", "liga";
83 84
}

A
Adrien Tétar 已提交
85
h1 {
86
	font-size: 1.5em;
A
Adrien Tétar 已提交
87 88
}
h2 {
89
	font-size: 1.4em;
A
Adrien Tétar 已提交
90 91
}
h3 {
92
	font-size: 1.3em;
A
Adrien Tétar 已提交
93
}
94
h1, h2, h3:not(.impl):not(.method):not(.type):not(.tymethod):not(.notable),
G
Guillaume Gomez 已提交
95
h4:not(.method):not(.type):not(.tymethod):not(.associatedconstant) {
96 97 98
	font-weight: 500;
	margin: 20px 0 15px 0;
	padding-bottom: 6px;
99
}
A
Adrien Tétar 已提交
100
h1.fqn {
101 102
	border-bottom: 1px dashed;
	margin-top: 0;
103
}
104 105 106
h1.fqn > .in-band > a:hover {
	text-decoration: underline;
}
G
Guillaume Gomez 已提交
107 108
h2, h3:not(.impl):not(.method):not(.type):not(.tymethod),
h4:not(.method):not(.type):not(.tymethod):not(.associatedconstant) {
109
	border-bottom: 1px solid;
110
}
111
h3.impl, h3.method, h4.method, h3.type, h4.type, h4.associatedconstant {
J
John Heitmann 已提交
112
	flex-basis: 100%;
113
	font-weight: 600;
J
John Heitmann 已提交
114
	margin-top: 16px;
115 116
	margin-bottom: 10px;
	position: relative;
A
Adrien Tétar 已提交
117
}
118
h3.impl, h3.method, h3.type {
119
	padding-left: 15px;
A
Adrien Tétar 已提交
120
}
121 122

h1, h2, h3, h4,
123
.sidebar, a.source, .search-input, .content table td:first-child > a,
G
Guillaume Gomez 已提交
124 125
.collapse-toggle, div.item-list .out-of-band,
#source-sidebar, #sidebar-toggle {
J
Jon Gjengset 已提交
126
	font-family: "Fira Sans", sans-serif;
127 128
}

C
Camelid 已提交
129 130 131 132
.content ul.crate a.crate {
	font: 16px/1.6 "Fira Sans";
}

A
Adrien Tétar 已提交
133
ol, ul {
134
	padding-left: 25px;
135
}
A
Adrien Tétar 已提交
136
ul ul, ol ul, ul ol, ol ol {
137
	margin-bottom: .6em;
A
Adrien Tétar 已提交
138
}
139 140

p {
141
	margin: 0 0 .6em 0;
142
}
A
Adrien Tétar 已提交
143

144 145 146 147
summary {
	outline: none;
}

148
code, pre, a.test-arrow {
J
Jon Gjengset 已提交
149
	font-family: "Source Code Pro", monospace;
A
Adrien Tétar 已提交
150
}
Liigo's avatar
Liigo 已提交
151
.docblock code, .docblock-short code {
152
	border-radius: 3px;
153
	padding: 0 0.1em;
154
}
155
.docblock pre code, .docblock-short pre code, .docblock code.spotlight {
156
	padding: 0;
I
Ivan Ukhov 已提交
157
}
158 159 160
.docblock code.spotlight :last-child {
	padding-bottom: 0.6em;
}
A
Adrien Tétar 已提交
161
pre {
162
	padding: 14px;
A
Adrien Tétar 已提交
163 164
}

165
.source .content pre {
166
	padding: 20px;
167 168
}

W
Wesley Wiser 已提交
169
img {
170
	max-width: 100%;
W
Wesley Wiser 已提交
171 172
}

173 174 175 176
li {
	position: relative;
}

177
.source .content {
178 179 180 181 182
	margin-top: 50px;
	max-width: none;
	overflow: visible;
	margin-left: 0px;
	min-width: 70em;
183 184
}

185
nav.sub {
186 187
	font-size: 16px;
	text-transform: uppercase;
188 189 190
}

.sidebar {
191
	width: 200px;
G
Guillaume Gomez 已提交
192
	position: fixed;
193 194
	left: 0;
	top: 0;
195
	bottom: 0;
G
Guillaume Gomez 已提交
196
	overflow: auto;
197 198 199 200 201 202 203
}

/* Improve the scrollbar display on firefox */
* {
	scrollbar-width: initial;
}
.sidebar {
204 205 206
	scrollbar-width: thin;
}

207 208 209 210
/* Improve the scrollbar display on webkit-based browsers */
::-webkit-scrollbar {
	width: 12px;
}
211 212 213
.sidebar::-webkit-scrollbar {
	width: 8px;
}
214
::-webkit-scrollbar-track {
215
	-webkit-box-shadow: inset 0;
216 217
}

G
Guillaume Gomez 已提交
218
.sidebar .block > ul > li {
G
Guillaume Gomez 已提交
219
	margin-right: -10px;
220 221
}

G
Guillaume Gomez 已提交
222 223 224
.content, nav {
	max-width: 960px;
}
225 226 227

/* Everything else */

228
.hidden {
G
Guillaume Gomez 已提交
229 230
	display: none !important;
}
231

232
.logo-container {
G
Guillaume Gomez 已提交
233 234 235
	height: 100px;
	width: 100px;
	position: relative;
236 237
	margin: 20px auto;
	display: block;
238
	margin-top: 10px;
239 240
}

G
Guillaume Gomez 已提交
241 242 243 244 245 246 247 248 249 250
.logo-container > img {
	max-width: 100px;
	max-height: 100px;
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	display: block;
}

251
.sidebar .location {
252
	border: 1px solid;
253
	font-size: 17px;
254
	margin: 30px 10px 20px 10px;
255
	text-align: center;
256
	word-wrap: break-word;
257 258
}

259 260 261
.sidebar .version {
	font-size: 15px;
	text-align: center;
G
Guillaume Gomez 已提交
262
	border-bottom: 1px solid;
263 264 265 266 267
	overflow-wrap: break-word;
	word-wrap: break-word; /* deprecated */
	word-break: break-word; /* Chrome, non-standard */
}

268 269 270 271
.location:empty {
	border: none;
}

G
Guillaume Gomez 已提交
272 273 274
.location a:first-child {
	font-weight: 500;
}
275

276
.block {
277
	padding: 0;
278
	margin-bottom: 14px;
279
}
280
.block h2, .block h3 {
281 282 283
	margin-top: 0;
	margin-bottom: 8px;
	text-align: center;
284
}
285
.block ul, .block li {
286
	margin: 0 10px;
287 288
	padding: 0;
	list-style: none;
289
}
290

291
.block a {
292 293 294 295 296 297 298 299
	display: block;
	text-overflow: ellipsis;
	overflow: hidden;
	line-height: 15px;
	padding: 7px 5px;
	font-size: 14px;
	font-weight: 300;
	transition: border 500ms ease-out;
300 301
}

302
.sidebar-title {
G
Guillaume Gomez 已提交
303 304
	border-top: 1px solid;
	border-bottom: 1px solid;
305 306 307 308 309 310 311 312 313 314 315 316 317 318
	text-align: center;
	font-size: 17px;
	margin-bottom: 5px;
}

.sidebar-links {
	margin-bottom: 15px;
}

.sidebar-links > a {
	padding-left: 10px;
	width: 100%;
}

319 320 321 322
.sidebar-menu {
	display: none;
}

323
.content {
324
	padding: 15px 0;
325 326
}

327
.source .content pre.rust {
328 329 330
	white-space: pre;
	overflow: auto;
	padding-left: 0;
331
}
G
Guillaume Gomez 已提交
332

G
Guillaume Gomez 已提交
333
.rustdoc:not(.source) .example-wrap {
334
	display: inline-flex;
335
	margin-bottom: 10px;
336
	position: relative;
G
Guillaume Gomez 已提交
337 338 339
}

.example-wrap {
340 341 342 343 344 345 346 347 348 349 350 351
	width: 100%;
}

.example-wrap > pre.line-number {
	overflow: initial;
	border: 1px solid;
	border-top-left-radius: 5px;
	border-bottom-left-radius: 5px;
	padding: 13px 8px;
	text-align: right;
}

G
Guillaume Gomez 已提交
352
.rustdoc:not(.source) .example-wrap > pre.rust {
353
	width: 100%;
G
Guillaume Gomez 已提交
354
	overflow-x: auto;
355 356
}

G
Guillaume Gomez 已提交
357
.rustdoc:not(.source) .example-wrap > pre {
358 359 360
	margin: 0;
}

361 362
#search {
	margin-left: 230px;
G
Guillaume Gomez 已提交
363
	position: relative;
364
}
G
Guillaume Gomez 已提交
365 366 367 368 369 370 371 372

#results {
	position: absolute;
	right: 0;
	left: 0;
	overflow: auto;
}

G
Guillaume Gomez 已提交
373 374 375
#results > table {
	width: 100%;
	table-layout: fixed;
376
	margin-bottom: 40px;
G
Guillaume Gomez 已提交
377 378
}

379
.content pre.line-numbers {
380 381 382
	float: left;
	border: none;
	position: relative;
383

384 385 386 387
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
388
}
G
Guillaume Gomez 已提交
389 390 391
.line-numbers span {
	cursor: pointer;
}
392

Liigo's avatar
Liigo 已提交
393
.docblock-short p {
394
	display: inline;
395 396
}

Liigo's avatar
Liigo 已提交
397
.docblock-short.nowrap {
398 399 400 401
	display: block;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
402
}
403

Liigo's avatar
Liigo 已提交
404
.docblock-short p {
405 406 407
	overflow: hidden;
	text-overflow: ellipsis;
	margin: 0;
408
}
409
.docblock code, .docblock-short code {
V
vlad-boroda 已提交
410
	white-space: pre-wrap;
G
Guillaume Gomez 已提交
411
}
412 413

.docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5 {
414
	border-bottom: 1px solid;
415
}
416

417 418 419 420
#main > .docblock h1 { font-size: 1.3em; }
#main > .docblock h2 { font-size: 1.15em; }
#main > .docblock h3, #main > .docblock h4, #main > .docblock h5 { font-size: 1em; }

421
#main > h2 + div, #main > h2 + h3, #main > h3 + div {
J
John Heitmann 已提交
422 423
	display: none; /* Changed to flex or block via js once the page is loaded */
	flex-wrap: wrap;
424 425
}

426 427 428
.docblock h1 { font-size: 1em; }
.docblock h2 { font-size: 0.95em; }
.docblock h3, .docblock h4, .docblock h5 { font-size: 0.9em; }
429

430
.docblock {
431
	margin-left: 24px;
432
	position: relative;
433 434
}

A
Aaron Turon 已提交
435
.content .out-of-band {
436
	float: right;
437 438 439 440
	font-size: 23px;
	margin: 0px;
	padding: 0px;
	font-weight: normal;
441 442 443
}

h3.impl > .out-of-band {
444
	font-size: 21px;
445 446
}

447 448 449 450
h4.method > .out-of-band {
	font-size: 19px;
}

E
Eitan Adler 已提交
451
h4 > code, h3 > code, .invisible > code {
452 453
	max-width: calc(100% - 41px);
	display: block;
454 455
}

N
Nick Cameron 已提交
456
.invisible {
457 458
	width: 100%;
	display: inline-block;
N
Nick Cameron 已提交
459 460
}

461
.content .in-band {
462 463
	margin: 0px;
	padding: 0px;
464 465
}

G
Guillaume Gomez 已提交
466 467 468 469
.in-band > code {
	display: inline-block;
}

G
Guillaume Gomez 已提交
470 471 472
#main {
	position: relative;
}
473
#main > .since {
474
	top: inherit;
J
Jon Gjengset 已提交
475
	font-family: "Fira Sans", sans-serif;
476 477
}

G
Guillaume Gomez 已提交
478
.content table:not(.table-display) {
479
	border-spacing: 0 5px;
480 481 482 483 484
}
.content td { vertical-align: top; }
.content td:first-child { padding-right: 20px; }
.content td p:first-child { margin-top: 0; }
.content td h1, .content td h2 { margin-left: 0; font-size: 1.1em; }
485
.content tr:first-child td { border-top: 0; }
486

487
.docblock table {
488
	margin: .5em 0;
G
Guillaume Gomez 已提交
489 490
	width: calc(100% - 2px);
	border: 1px dashed;
491 492 493
}

.docblock table td {
494
	padding: .5em;
495
	border: 1px dashed;
496 497 498
}

.docblock table th {
499 500
	padding: .5em;
	text-align: left;
501
	border: 1px solid;
502 503
}

504 505 506 507
.fields + table {
	margin-bottom: 1em;
}

508
.content .item-list {
509 510
	list-style-type: none;
	padding: 0;
511 512 513
}

.content .multi-column {
514 515 516 517 518 519
	-moz-column-count: 5;
	-moz-column-gap: 2.5em;
	-webkit-column-count: 5;
	-webkit-column-gap: 2.5em;
	column-count: 5;
	column-gap: 2.5em;
520 521 522
}
.content .multi-column li { width: 100%; display: inline-block; }

523
.content .method {
524 525
	font-size: 1em;
	position: relative;
526
}
527
/* Shift "where ..." part of method or fn definition down a line */
528 529 530
.content .method .where,
.content .fn .where,
.content .where.fmt-newline {
G
Guillaume Gomez 已提交
531
	display: block;
532
	font-size: 0.8em;
533
}
D
Dirk Gadsden 已提交
534

535
.content .methods > div:not(.notable-traits) {
G
Guillaume Gomez 已提交
536 537 538
	margin-left: 40px;
	margin-bottom: 15px;
}
539

540
.content .docblock > .impl-items {
541
	margin-left: 20px;
542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557
	margin-top: -34px;
}
.content .docblock > .impl-items > h4 {
	border-bottom: 0;
}
.content .docblock >.impl-items .table-display {
	margin: 0;
}
.content .docblock >.impl-items table td {
	padding: 0;
}
.toggle-wrapper.marg-left > .collapse-toggle {
	left: -24px;
}
.content .docblock > .impl-items .table-display, .impl-items table td {
	border: none;
558
}
559

560
.content .stability code {
561
	font-size: 90%;
562 563
}

564 565 566 567 568
.content .stability {
	position: relative;
	margin-left: 33px;
	margin-top: -13px;
}
569

G
Guillaume Gomez 已提交
570 571 572 573
.sub-variant > div > .stability {
	margin-top: initial;
}

574
.content .stability::before {
575
	content: '⬑';
Liigo's avatar
Liigo 已提交
576
	font-size: 25px;
577
	position: absolute;
Liigo's avatar
Liigo 已提交
578
	top: -6px;
579
	left: -19px;
580
}
581 582 583 584 585 586 587 588 589 590 591 592 593 594

.content .impl-items .method, .content .impl-items > .type, .impl-items > .associatedconstant {
	margin-left: 20px;
}

.content .impl-items .docblock, .content .impl-items .stability {
	margin-bottom: .6em;
}

.content .impl-items > .stability {
	margin-left: 40px;
}

.methods > .stability, .content .impl-items > .stability {
595 596
	margin-top: -8px;
}
597

J
John Heitmann 已提交
598 599 600 601
.impl-items {
	flex-basis: 100%;
}

602 603 604 605
#main > .stability {
	margin-top: 0;
}

606
nav:not(.sidebar) {
607 608 609
	border-bottom: 1px solid;
	padding-bottom: 10px;
	margin-bottom: 10px;
610 611
}
nav.main {
612 613
	padding: 20px 0;
	text-align: center;
614 615
}
nav.main .current {
616 617
	border-top: 1px solid;
	border-bottom: 1px solid;
618 619
}
nav.main .separator {
620 621 622 623
	border: 1px solid;
	display: inline-block;
	height: 23px;
	margin: 0 20px;
624 625 626 627
}
nav.sum { text-align: right; }
nav.sub form { display: inline; }

628
nav.sub, .content {
629
	margin-left: 230px;
630 631 632
}

a {
633 634
	text-decoration: none;
	background: transparent;
635
}
636

G
Guillaume Gomez 已提交
637 638 639
.small-section-header:hover > .anchor {
	display: initial;
}
J
Jouan Amate 已提交
640

641
.in-band:hover > .anchor, .impl:hover > .anchor {
G
Guillaume Gomez 已提交
642 643
	display: inline-block;
	position: absolute;
J
Jouan Amate 已提交
644
}
G
Guillaume Gomez 已提交
645 646
.anchor {
	display: none;
647
	position: absolute;
648
	left: -7px;
G
Guillaume Gomez 已提交
649
}
650
.anchor.field {
651
	left: -5px;
652
}
653 654
.small-section-header > .anchor {
	left: -28px;
655
	padding-right: 10px; /* avoid gap that causes hover to disappear */
656
}
657
.anchor:before {
G
Guillaume Gomez 已提交
658 659 660
	content: '\2002\00a7\2002';
}

G
Guillaume Gomez 已提交
661 662
.docblock a:not(.srclink):not(.test-arrow):hover,
.docblock-short a:not(.srclink):not(.test-arrow):hover, .stability a {
663
	text-decoration: underline;
664
}
665

G
Guillaume Gomez 已提交
666
.invisible > .srclink, h4 > code + .srclink {
667 668 669 670 671 672 673
	position: absolute;
	top: 0;
	right: 0;
	font-size: 17px;
	font-weight: normal;
}

674
.block a.current.crate { font-weight: 500; }
675

G
Guillaume Gomez 已提交
676 677 678
.search-container {
	position: relative;
}
G
Guillaume Gomez 已提交
679 680
.search-container > div {
	display: inline-flex;
G
Guillaume Gomez 已提交
681
	width: calc(100% - 63px);
G
Guillaume Gomez 已提交
682 683 684 685
}
#crate-search {
	margin-top: 5px;
	padding: 6px;
686
	padding-right: 19px;
687
	flex: none;
G
Guillaume Gomez 已提交
688 689 690 691 692 693 694 695 696 697 698
	border: 0;
	border-right: 0;
	border-radius: 4px 0 0 4px;
	outline: none;
	cursor: pointer;
	border-right: 1px solid;
	-moz-appearance: none;
	-webkit-appearance: none;
	/* Removes default arrow from firefox */
	text-indent: 0.01px;
	text-overflow: "";
699 700
	background-repeat: no-repeat;
	background-color: transparent;
701
	background-size: 20px;
702
	background-position: calc(100% - 1px) 56%;
G
Guillaume Gomez 已提交
703
}
G
Guillaume Gomez 已提交
704 705 706 707 708
.search-container > .top-button {
	position: absolute;
	right: 0;
	top: 10px;
}
709
.search-input {
710 711 712 713 714 715 716
	/* Override Normalize.css: we have margins and do
	 not want to overflow - the `moz` attribute is necessary
	 until Firefox 29, too early to drop at this point */
	-moz-box-sizing: border-box !important;
	box-sizing: border-box !important;
	outline: none;
	border: none;
717
	border-radius: 1px;
718 719 720 721 722 723
	margin-top: 5px;
	padding: 10px 16px;
	font-size: 17px;
	transition: border-color 300ms ease;
	transition: border-radius 300ms ease-in-out;
	transition: box-shadow 300ms ease-in-out;
724
	width: 100%;
725 726
}

727 728
#crate-search + .search-input {
	border-radius: 0 1px 1px 0;
729
	width: calc(100% - 32px);
730 731
}

732
.search-input:focus {
733 734 735
	border-radius: 2px;
	border: 0;
	outline: 0;
A
Adrien Tétar 已提交
736
}
737

738
.search-results .desc {
739 740 741 742
	white-space: nowrap;
	text-overflow: ellipsis;
	overflow: hidden;
	display: block;
743 744
}

745
.search-results a {
746
	display: block;
747 748
}

G
Guillaume Gomez 已提交
749 750
.content .search-results td:first-child {
	padding-right: 0;
751
	width: 50%;
G
Guillaume Gomez 已提交
752 753 754 755
}
.content .search-results td:first-child a {
	padding-right: 10px;
}
756
.content .search-results td:first-child a:after {
G
Guillaume Gomez 已提交
757 758 759
	clear: both;
	content: "";
	display: block;
760
}
G
Guillaume Gomez 已提交
761 762 763
.content .search-results td:first-child a span {
	float: left;
}
764

765
tr.result span.primitive::after {
G
Guillaume Gomez 已提交
766 767
	content: ' (primitive type)';
	font-style: italic;
E
Eitan Adler 已提交
768
}
769

G
Guillaume Gomez 已提交
770 771 772 773 774
tr.result span.keyword::after {
	content: ' (keyword)';
	font-style: italic;
}

775
body.blur > :not(#help) {
776 777 778
	filter: blur(8px);
	-webkit-filter: blur(8px);
	opacity: .7;
779 780
}

781
#help {
782 783 784 785 786 787 788 789
	width: 100%;
	height: 100vh;
	position: fixed;
	top: 0;
	left: 0;
	display: flex;
	justify-content: center;
	align-items: center;
790 791
}
#help > div {
792 793 794
	flex: 0 0 auto;
	box-shadow: 0 0 6px rgba(0,0,0,.2);
	width: 550px;
M
Marcel Hellwig 已提交
795
	height: auto;
G
Guillaume Gomez 已提交
796
	border: 1px solid;
797 798
}
#help dt {
799 800 801
	float: left;
	clear: left;
	display: block;
802
}
G
Guillaume Gomez 已提交
803
#help dd { margin: 5px 35px; }
804
#help .infos { padding-left: 0; }
805
#help h1, #help h2 { margin-top: 0; }
806
#help > div div {
807 808 809
	width: 50%;
	float: left;
	padding: 20px;
G
Guillaume Gomez 已提交
810
	padding-left: 17px;
811
}
812

813 814
.stab {
	display: table;
815 816 817 818 819
	border-width: 1px;
	border-style: solid;
	padding: 3px;
	margin-bottom: 5px;
	font-size: 90%;
820
}
821
.stab p {
822
	display: inline;
823 824
}

825 826 827 828
.stab summary {
	display: list-item;
}

829
.stab .emoji {
830 831 832
	font-size: 1.5em;
}

833
.module-item .stab {
834 835 836 837 838 839 840 841
	border-radius: 3px;
	display: inline-block;
	font-size: 80%;
	line-height: 1.2;
	margin-bottom: 0;
	margin-right: .3em;
	padding: 2px;
	vertical-align: text-bottom;
842
}
843

844
.module-item.unstable {
845
	opacity: 0.65;
846
}
847

848
.since {
849 850 851 852 853
	font-weight: normal;
	font-size: initial;
	position: absolute;
	right: 0;
	top: 0;
854 855
}

J
John Heitmann 已提交
856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882
.impl-items .since, .impl .since {
	flex-grow: 0;
	padding-left: 12px;
	padding-right: 2px;
	position: initial;
}

.impl-items .srclink, .impl .srclink {
	flex-grow: 0;
	/* Override header settings otherwise it's too bold */
	font-size: 17px;
	font-weight: normal;
}

.impl-items code, .impl code {
	flex-grow: 1;
}

.impl-items h4, h4.impl, h3.impl {
	display: flex;
	flex-basis: 100%;
	font-size: 16px;
	margin-bottom: 12px;
	/* Push the src link out to the right edge consistently */
	justify-content: space-between;
}

883
.variants_table {
884
	width: 100%;
885 886 887
}

.variants_table tbody tr td:first-child {
888
	width: 1%; /* make the variant name as small as possible */
889 890
}

891
td.summary-column {
892
	width: 100%;
893 894
}

A
Aaron Turon 已提交
895
.summary {
896
	padding-right: 0px;
A
Aaron Turon 已提交
897 898
}

E
est31 已提交
899
pre.rust .question-mark {
900
	font-weight: bold;
E
est31 已提交
901
}
902

903
a.test-arrow {
904 905 906 907 908 909 910
	display: inline-block;
	position: absolute;
	padding: 5px 10px 5px 10px;
	border-radius: 5px;
	font-size: 130%;
	top: 5px;
	right: 5px;
911
	z-index: 1;
912
}
913
a.test-arrow:hover{
914
	text-decoration: none;
915
}
916

917 918 919
.section-header:hover a:before {
	position: absolute;
	left: -25px;
920
	padding-right: 10px; /* avoid gap that causes hover to disappear */
921
	content: '\2002\00a7\2002';
922
}
D
Daniel Fagnan 已提交
923

924
.section-header:hover a {
925
	text-decoration: none;
926 927 928
}

.section-header a {
929
	color: inherit;
930 931
}

932
.collapse-toggle {
933 934 935 936
	font-weight: 300;
	position: absolute;
	left: -23px;
	top: 0;
937 938
}

939 940 941 942 943
h3 > .collapse-toggle, h4 > .collapse-toggle {
	font-size: 0.8em;
	top: 5px;
}

944
.toggle-wrapper > .collapse-toggle {
945 946
	left: -24px;
	margin-top: 0px;
947 948 949
}

.toggle-wrapper {
950
	position: relative;
951
	margin-top: 0;
952 953 954
}

.toggle-wrapper.collapsed {
955
	height: 25px;
956
	transition: height .2s;
957
	margin-bottom: .6em;
958 959 960
}

.collapse-toggle > .inner {
961 962 963
	display: inline-block;
	width: 1.2ch;
	text-align: center;
964 965
}

966 967 968 969 970
.collapse-toggle.hidden-default {
	position: relative;
	margin-left: 20px;
}

971
.since + .srclink {
972 973
	display: table-cell;
	padding-left: 10px;
974
}
975

976 977 978 979 980
.item-spacer {
	width: 100%;
	height: 12px;
}

981
.out-of-band > span.since {
982 983 984
	position: initial;
	font-size: 20px;
	margin-right: 5px;
G
Guillaume Gomez 已提交
985 986
}

987
.toggle-wrapper > .collapse-toggle {
988
	left: 0;
989 990
}

G
Guillaume Gomez 已提交
991 992 993 994
.variant + .toggle-wrapper + .docblock > p {
	margin-top: 5px;
}

995
.sub-variant, .sub-variant > h3 {
G
Guillaume Gomez 已提交
996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012
	margin-top: 1px !important;
}

#main > .sub-variant > h3 {
	font-size: 15px;
	margin-left: 25px;
	margin-bottom: 5px;
}

.sub-variant > div {
	margin-left: 20px;
	margin-bottom: 10px;
}

.sub-variant > div > span {
	display: block;
	position: relative;
1013 1014
}

1015 1016 1017 1018 1019 1020
.toggle-label {
	display: inline-block;
	margin-left: 4px;
	margin-top: 3px;
}

1021
.enum > .toggle-wrapper + .docblock, .struct > .toggle-wrapper + .docblock {
1022 1023 1024
	margin-left: 30px;
	margin-bottom: 20px;
	margin-top: 5px;
1025 1026
}

1027 1028
.docblock > .section-header:first-child {
	margin-left: 15px;
1029
	margin-top: 0;
1030 1031 1032 1033 1034 1035
}

.docblock > .section-header:first-child:hover > a:before {
	left: -10px;
}

1036
.enum > .collapsed, .struct > .collapsed {
1037
	margin-bottom: 25px;
1038 1039
}

1040
#main > .variant, #main > .structfield {
1041 1042 1043 1044 1045
	display: block;
}

.attributes {
	display: block;
1046 1047 1048 1049
	margin-top: 0px !important;
	margin-right: 0px;
	margin-bottom: 0px !important;
	margin-left: 30px;
1050 1051
}
.toggle-attributes.collapsed {
1052 1053 1054 1055 1056 1057 1058
	margin-bottom: 0;
}
.impl-items > .toggle-attributes {
	margin-left: 20px;
}
.impl-items .attributes {
	font-weight: 500;
G
Guillaume Gomez 已提交
1059 1060
}

1061
:target > code {
G
Guillaume Gomez 已提交
1062
	opacity: 1;
1063 1064
}

G
Guillaume Gomez 已提交
1065 1066
.information {
	position: absolute;
1067
	left: -25px;
G
Guillaume Gomez 已提交
1068
	margin-top: 7px;
G
Guillaume Gomez 已提交
1069
	z-index: 1;
G
Guillaume Gomez 已提交
1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081
}

.tooltip {
	position: relative;
	display: inline-block;
	cursor: pointer;
}

.tooltip .tooltiptext {
	width: 120px;
	display: none;
	text-align: center;
1082
	padding: 5px 3px 3px 3px;
G
Guillaume Gomez 已提交
1083 1084 1085 1086
	border-radius: 6px;
	margin-left: 5px;
	top: -5px;
	left: 105%;
J
John Heitmann 已提交
1087
	z-index: 10;
1088
	font-size: 16px;
G
Guillaume Gomez 已提交
1089 1090 1091 1092 1093 1094
}

.tooltip .tooltiptext::after {
	content: " ";
	position: absolute;
	top: 50%;
1095
	left: 16px;
G
Guillaume Gomez 已提交
1096 1097 1098 1099
	margin-top: -5px;
	border-width: 5px;
	border-style: solid;
}
G
Guillaume Gomez 已提交
1100

1101
.tooltip.compile_fail, .tooltip.should_panic, .tooltip.ignore {
1102 1103 1104 1105
	font-weight: bold;
	font-size: 20px;
}

1106
.notable-traits-tooltip {
M
Manish Goregaokar 已提交
1107 1108 1109 1110
	display: inline-block;
	cursor: pointer;
}

1111 1112
.notable-traits:hover .notable-traits-tooltiptext,
.notable-traits .notable-traits-tooltiptext.force-tooltip {
M
Manish Goregaokar 已提交
1113 1114 1115
	display: inline-block;
}

1116
.notable-traits .notable-traits-tooltiptext {
M
Manish Goregaokar 已提交
1117 1118 1119 1120 1121 1122 1123 1124
	display: none;
	padding: 5px 3px 3px 3px;
	border-radius: 6px;
	margin-left: 5px;
	z-index: 10;
	font-size: 16px;
	cursor: default;
	position: absolute;
1125
	border: 1px solid;
M
Manish Goregaokar 已提交
1126 1127
}

1128
.notable-traits-tooltip::after {
M
Manish Goregaokar 已提交
1129 1130 1131
	/* The margin on the tooltip does not capture hover events,
	   this extends the area of hover enough so that mouse hover is not
	   lost when moving the mouse to the tooltip */
G
Guillaume Gomez 已提交
1132
	content: "\00a0\00a0\00a0";
M
Manish Goregaokar 已提交
1133 1134
}

1135
.notable-traits .notable, .notable-traits .docblock {
M
Manish Goregaokar 已提交
1136 1137 1138
	margin: 0;
}

1139
.notable-traits .docblock code.content{
G
Guillaume Gomez 已提交
1140 1141 1142
	margin: 0;
	padding: 0;
	font-size: 20px;
1143 1144
}

G
Guillaume Gomez 已提交
1145
/* Example code has the "Run" button that needs to be positioned relative to the pre */
1146
pre.rust.rust-example-rendered {
G
Guillaume Gomez 已提交
1147
	position: relative;
1148 1149 1150
}

pre.rust {
0
0xd4d 已提交
1151 1152
	tab-size: 4;
	-moz-tab-size: 4;
G
Guillaume Gomez 已提交
1153
}
1154 1155 1156 1157 1158 1159

.search-failed {
	text-align: center;
	margin-top: 20px;
}

1160 1161 1162 1163 1164 1165 1166
.search-failed > ul {
	text-align: left;
	max-width: 570px;
	margin-left: auto;
	margin-right: auto;
}

1167 1168 1169 1170 1171 1172 1173 1174 1175 1176
#titles {
	height: 35px;
}

#titles > div {
	float: left;
	width: 33.3%;
	text-align: center;
	font-size: 18px;
	cursor: pointer;
G
Guillaume Gomez 已提交
1177
	border-top: 2px solid;
1178 1179
}

1180
#titles > div:not(:last-child) {
G
Guillaume Gomez 已提交
1181 1182
	margin-right: 1px;
	width: calc(33.3% - 1px);
1183
}
1184 1185 1186 1187 1188

#titles > div > div.count {
	display: inline-block;
	font-size: 16px;
}
1189

1190
.notable-traits {
1191 1192
	cursor: pointer;
	z-index: 2;
1193
	margin-left: 5px;
1194 1195
}

1196
h4 > .notable-traits {
1197 1198 1199 1200 1201
	position: absolute;
	left: -44px;
	top: 2px;
}

G
Guillaume Gomez 已提交
1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213
#all-types {
	text-align: center;
	border: 1px solid;
	margin: 0 10px;
	margin-bottom: 10px;
	display: block;
	border-radius: 7px;
}
#all-types > p {
	margin: 5px 0;
}

1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246
#sidebar-toggle {
	position: fixed;
	top: 30px;
	left: 300px;
	z-index: 10;
	padding: 3px;
	border-top-right-radius: 3px;
	border-bottom-right-radius: 3px;
	cursor: pointer;
	font-weight: bold;
	transition: left .5s;
	font-size: 1.2em;
	border: 1px solid;
	border-left: 0;
}
#source-sidebar {
	position: fixed;
	top: 0;
	bottom: 0;
	left: 0;
	width: 300px;
	z-index: 1;
	overflow: auto;
	transition: left .5s;
	border-right: 1px solid;
}
#source-sidebar > .title {
	font-size: 1.5em;
	text-align: center;
	border-bottom: 1px solid;
	margin-bottom: 6px;
}

G
Guillaume Gomez 已提交
1247 1248 1249 1250 1251 1252 1253 1254 1255 1256
.theme-picker {
	position: absolute;
	left: 211px;
	top: 19px;
}

.theme-picker button {
	outline: none;
}

G
Guillaume Gomez 已提交
1257
#settings-menu, .help-button {
G
Guillaume Gomez 已提交
1258 1259
	position: absolute;
	top: 10px;
G
Guillaume Gomez 已提交
1260 1261 1262 1263
}

#settings-menu {
	right: 0;
G
Guillaume Gomez 已提交
1264 1265 1266
	outline: none;
}

G
Guillaume Gomez 已提交
1267 1268 1269 1270 1271 1272 1273 1274
.help-button {
	right: 30px;
	font-family: "Fira Sans",sans-serif;
	text-align: center;
	font-size: 17px;
}

#theme-picker, #settings-menu, .help-button {
G
Guillaume Gomez 已提交
1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296
	padding: 4px;
	width: 27px;
	height: 29px;
	border: 1px solid;
	border-radius: 3px;
	cursor: pointer;
}

#theme-choices {
	display: none;
	position: absolute;
	left: 0;
	top: 28px;
	border: 1px solid;
	border-radius: 3px;
	z-index: 1;
	cursor: pointer;
}

#theme-choices > button {
	border: none;
	width: 100%;
1297
	padding: 4px 8px;
G
Guillaume Gomez 已提交
1298 1299 1300 1301 1302 1303 1304 1305
	text-align: center;
	background: rgba(0,0,0,0);
}

#theme-choices > button:not(:first-child) {
	border-top: 1px solid;
}

1306 1307
/* Media Queries */

1308 1309 1310 1311 1312 1313 1314 1315 1316 1317
@media (min-width: 701px) {
	/* In case there is no documentation before a code block, we need to add some margin at the top
	to prevent an overlay between the "collapse toggle" and the information tooltip.
	However, it's needed needed with smaller screen width because the doc/code block is always put
	"one line" below. */
	.information:first-child > .tooltip {
		margin-top: 16px;
	}
}

1318
@media (max-width: 700px) {
1319 1320 1321 1322
	body {
		padding-top: 0px;
	}

1323
	.rustdoc > .sidebar {
1324
		height: 45px;
1325
		min-height: 40px;
1326 1327 1328
		margin: 0;
		margin-left: -15px;
		padding: 0 15px;
1329
		position: static;
1330
		z-index: 11;
1331 1332
	}

1333
	.sidebar > .location {
1334 1335
		float: right;
		margin: 0px;
1336
		margin-top: 2px;
1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347
		padding: 3px 10px 1px 10px;
		min-height: 39px;
		background: inherit;
		text-align: left;
		font-size: 24px;
	}

	.sidebar .location:empty {
		padding: 0;
	}

G
Guillaume Gomez 已提交
1348
	.sidebar .logo-container {
1349
		width: 35px;
G
Guillaume Gomez 已提交
1350
		height: 35px;
1351
		margin-top: 5px;
1352
		margin-bottom: 5px;
1353
		float: left;
1354
		margin-left: 50px;
1355 1356
	}

G
Guillaume Gomez 已提交
1357 1358 1359 1360 1361
	.sidebar .logo-container > img {
		max-width: 35px;
		max-height: 35px;
	}

1362
	.sidebar-menu {
1363 1364
		position: fixed;
		z-index: 10;
1365 1366
		font-size: 2rem;
		cursor: pointer;
1367 1368 1369
		width: 45px;
		left: 0;
		text-align: center;
1370
		display: block;
1371 1372
		border-bottom: 1px solid;
		border-right: 1px solid;
G
Guillaume Gomez 已提交
1373
		height: 45px;
1374 1375
	}

1376 1377 1378 1379
	.rustdoc.source > .sidebar > .sidebar-menu {
		display: none;
	}

1380 1381 1382 1383 1384 1385 1386
	.sidebar-elems {
		position: fixed;
		z-index: 1;
		left: 0;
		top: 45px;
		bottom: 0;
		overflow-y: auto;
1387
		border-right: 1px solid;
1388 1389 1390
		display: none;
	}

1391 1392 1393 1394 1395
	.sidebar > .block.version {
		border-bottom: none;
		margin-top: 12px;
	}

1396
	nav.sub {
G
Guillaume Gomez 已提交
1397 1398
		width: calc(100% - 32px);
		float: right;
1399 1400
	}

1401 1402 1403 1404
	.content {
		margin-left: 0px;
	}

1405
	#main {
1406
		margin-top: 45px;
1407 1408 1409
		padding: 0;
	}

1410 1411 1412 1413
	.content .in-band {
		width: 100%;
	}

1414 1415
	.content h4 > .out-of-band {
		position: inherit;
1416 1417 1418 1419 1420 1421 1422 1423 1424
	}

	.toggle-wrapper > .collapse-toggle {
		left: 0px;
	}

	.toggle-wrapper {
		height: 1.5em;
	}
1425 1426 1427 1428

	#search {
		margin-left: 0;
	}
1429 1430 1431 1432

	.content .impl-items .method, .content .impl-items > .type, .impl-items > .associatedconstant {
		display: flex;
	}
1433 1434

	.anchor {
1435
		display: none !important;
1436
	}
G
Guillaume Gomez 已提交
1437 1438 1439 1440

	h1.fqn {
		overflow: initial;
	}
1441

G
Guillaume Gomez 已提交
1442 1443 1444 1445
	.theme-picker {
		left: 10px;
		top: 54px;
		z-index: 1;
1446
	}
1447

1448
	h4 > .notable-traits {
1449 1450 1451 1452 1453
		position: absolute;
		left: -22px;
		top: 24px;
	}

G
Guillaume Gomez 已提交
1454 1455 1456 1457 1458 1459 1460 1461
	#titles > div > div.count {
		float: left;
		width: 100%;
	}

	#titles {
		height: 50px;
	}
G
Guillaume Gomez 已提交
1462 1463 1464 1465 1466 1467 1468 1469

	.sidebar.mobile {
		position: fixed;
		width: 100%;
		margin-left: 0;
		background-color: rgba(0,0,0,0);
		height: 100%;
	}
G
Guillaume Gomez 已提交
1470 1471 1472
	.sidebar {
		width: calc(100% + 30px);
	}
G
Guillaume Gomez 已提交
1473 1474 1475

	.show-it {
		display: block;
1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493
		width: 246px;
	}

	.show-it > .block.items {
		margin: 8px 0;
	}

	.show-it > .block.items > ul {
		margin: 0;
	}

	.show-it > .block.items > ul > li {
		text-align: center;
		margin: 2px 0;
	}

	.show-it > .block.items > ul > li > a {
		font-size: 21px;
G
Guillaume Gomez 已提交
1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509
	}

	/* Because of ios, we need to actually have a full height sidebar title so the
	 * actual sidebar can show up. But then we need to make it transparent so we don't
	 * hide content. The filler just allows to create the background for the sidebar
	 * title. But because of the absolute position, I had to lower the z-index.
	 */
	#sidebar-filler {
		position: fixed;
		left: 45px;
		width: calc(100% - 45px);
		top: 0;
		height: 45px;
		z-index: -1;
		border-bottom: 1px solid;
	}
1510 1511

	.collapse-toggle {
1512 1513 1514 1515 1516
		left: -20px;
	}

	.impl > .collapse-toggle {
		left: -10px;
1517
	}
G
Guillaume Gomez 已提交
1518 1519 1520 1521

	#all-types {
		margin: 10px;
	}
1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533

	#sidebar-toggle {
		top: 100px;
		width: 30px;
		font-size: 1.5rem;
		text-align: center;
		padding: 0;
	}

	#source-sidebar {
		z-index: 11;
	}
G
Guillaume Gomez 已提交
1534 1535 1536 1537

	#main > .line-numbers {
		margin-top: 0;
	}
1538

1539
	.notable-traits .notable-traits-tooltiptext {
1540 1541 1542
		left: 0;
		top: 100%;
	}
G
Guillaume Gomez 已提交
1543 1544
}

G
Guillaume Gomez 已提交
1545 1546 1547 1548 1549
@media print {
	nav.sub, .content .out-of-band, .collapse-toggle {
		display: none;
	}
}
G
Guillaume Gomez 已提交
1550 1551 1552 1553 1554 1555 1556 1557 1558

@media (max-width: 416px) {
	#titles {
		height: 73px;
	}

	#titles > div {
		height: 73px;
	}
1559 1560
}

1561
h3.notable {
1562 1563 1564 1565 1566
	margin: 0;
	margin-bottom: 13px;
	font-size: 19px;
}

1567 1568 1569
kbd {
	display: inline-block;
	padding: 3px 5px;
J
Jon Gjengset 已提交
1570
	font: 15px monospace;
1571 1572
	line-height: 10px;
	vertical-align: middle;
1573
	border: solid 1px;
1574
	border-radius: 3px;
1575
	box-shadow: inset 0 -1px 0;
1576
	cursor: default;
1577
}
1578

1579 1580
.hidden-by-impl-hider,
.hidden-by-usual-hider {
1581 1582
	/* important because of conflicting rule for small screens */
	display: none !important;
1583
}
G
Guillaume Gomez 已提交
1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608

#implementations-list > h3 > span.in-band {
	width: 100%;
}

.table-display {
	width: 100%;
	border: 0;
	border-collapse: collapse;
	border-spacing: 0;
	font-size: 16px;
}

.table-display tr td:first-child {
	padding-right: 0;
}

.table-display tr td:last-child {
	float: right;
}
.table-display .out-of-band {
	position: relative;
	font-size: 19px;
	display: block;
}
G
Guillaume Gomez 已提交
1609 1610 1611 1612 1613 1614 1615 1616 1617
#implementors-list > .impl-items .table-display .out-of-band {
	font-size: 17px;
}

.table-display td:hover .anchor {
	display: block;
	top: 2px;
	left: -5px;
}
1618 1619 1620 1621 1622 1623 1624

#main > ul {
	padding-left: 10px;
}
#main > ul > li {
	list-style: none;
}
1625 1626 1627 1628

.non-exhaustive {
	margin-bottom: 1em;
}
G
Guillaume Gomez 已提交
1629 1630 1631 1632 1633

div.children {
	padding-left: 27px;
	display: none;
}
G
Guillaume Gomez 已提交
1634 1635 1636 1637 1638
div.name {
	cursor: pointer;
	position: relative;
	margin-left: 16px;
}
G
Guillaume Gomez 已提交
1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650
div.files > a {
	display: block;
	padding: 0 3px;
}
div.files > a:hover, div.name:hover {
	background-color: #a14b4b;
}
div.name.expand + .children {
	display: block;
}
div.name::before {
	content: "\25B6";
G
Guillaume Gomez 已提交
1651
	padding-left: 4px;
G
Guillaume Gomez 已提交
1652
	font-size: 0.7em;
G
Guillaume Gomez 已提交
1653 1654 1655
	position: absolute;
	left: -16px;
	top: 4px;
G
Guillaume Gomez 已提交
1656 1657 1658
}
div.name.expand::before {
	transform: rotate(90deg);
G
Guillaume Gomez 已提交
1659 1660
	left: -15px;
	top: 2px;
G
Guillaume Gomez 已提交
1661
}
1662 1663

/* This part is to fix the "Expand attributes" part in the type declaration. */
1664
.type-decl > pre > .toggle-wrapper.toggle-attributes.top-attr {
1665 1666
	margin-left: 0 !important;
}
1667
.type-decl > pre > .docblock.attributes.top-attr {
1668 1669 1670 1671 1672 1673 1674 1675
	margin-left: 1.8em !important;
}
.type-decl > pre > .toggle-attributes {
	margin-left: 2.2em;
}
.type-decl > pre > .docblock.attributes {
	margin-left: 4em;
}