1 /* See FiraSans-LICENSE.txt for the Fira Sans license. */
3 font-family: 'Fira Sans';
6 src: local('Fira Sans'),
7 url("FiraSans-Regular.woff2") format("woff2"),
8 url("FiraSans-Regular.woff") format('woff');
12 font-family: 'Fira Sans';
15 src: local('Fira Sans Medium'),
16 url("FiraSans-Medium.woff2") format("woff2"),
17 url("FiraSans-Medium.woff") format('woff');
21 /* See SourceSerifPro-LICENSE.txt for the Source Serif Pro license. */
23 font-family: 'Source Serif Pro';
26 src: local('Source Serif Pro'), url("SourceSerifPro-Regular.ttf.woff") format('woff');
30 font-family: 'Source Serif Pro';
33 src: local('Source Serif Pro Italic'), url("SourceSerifPro-It.ttf.woff") format('woff');
37 font-family: 'Source Serif Pro';
40 src: local('Source Serif Pro Bold'), url("SourceSerifPro-Bold.ttf.woff") format('woff');
44 /* See SourceCodePro-LICENSE.txt for the Source Code Pro license. */
46 font-family: 'Source Code Pro';
49 /* Avoid using locally installed font because bad versions are in circulation:
50 * see https://github.com/rust-lang/rust/issues/24355 */
51 src: url("SourceCodePro-Regular.ttf.woff") format('woff');
55 font-family: 'Source Code Pro';
58 src: url("SourceCodePro-It.ttf.woff") format('woff');
62 font-family: 'Source Code Pro';
65 src: url("SourceCodePro-Semibold.ttf.woff") format('woff');
70 -webkit-box-sizing: border-box;
71 -moz-box-sizing: border-box;
72 box-sizing: border-box;
75 /* This part handles the "default" theme being used depending on the system one. */
79 @media (prefers-color-scheme: light) {
84 @media (prefers-color-scheme: dark) {
90 /* General structure and fonts */
93 font: 16px/1.4 "Source Serif Pro", serif;
96 padding: 10px 15px 20px 15px;
98 -webkit-font-feature-settings: "kern", "liga";
99 -moz-font-feature-settings: "kern", "liga";
100 font-feature-settings: "kern", "liga";
112 h1, h2, h3:not(.impl):not(.method):not(.type):not(.tymethod):not(.notable),
113 h4:not(.method):not(.type):not(.tymethod):not(.associatedconstant) {
115 margin: 20px 0 15px 0;
119 border-bottom: 1px dashed;
122 h1.fqn > .in-band > a:hover {
123 text-decoration: underline;
125 h2, h3:not(.impl):not(.method):not(.type):not(.tymethod),
126 h4:not(.method):not(.type):not(.tymethod):not(.associatedconstant) {
127 border-bottom: 1px solid;
129 h3.impl, h3.method, h4.method, h3.type, h4.type, h4.associatedconstant {
136 h3.impl, h3.method, h3.type {
141 .sidebar, a.source, .search-input, .content table td:first-child > a,
142 .collapse-toggle, div.item-list .out-of-band,
143 #source-sidebar, #sidebar-toggle,
144 /* This selector is for the items listed in the "all items" page. */
145 #main > ul.docblock > li > a {
146 font-family: "Fira Sans", Arial, sans-serif;
149 .content ul.crate a.crate {
151 font-family: "Fira Sans", Arial, sans-serif;
157 ul ul, ol ul, ul ol, ol ol {
169 code, pre, a.test-arrow {
170 font-family: "Source Code Pro", monospace;
172 .docblock code, .docblock-short code {
176 .docblock pre code, .docblock-short pre code {
184 .source .content pre {
206 text-transform: uppercase;
218 /* Improve the scrollbar display on firefox */
220 scrollbar-width: initial;
223 scrollbar-width: thin;
226 /* Improve the scrollbar display on webkit-based browsers */
227 ::-webkit-scrollbar {
230 .sidebar::-webkit-scrollbar {
233 ::-webkit-scrollbar-track {
234 -webkit-box-shadow: inset 0;
237 .sidebar .block > ul > li {
245 /* Everything else */
248 display: none !important;
260 .logo-container > img {
266 transform: translate(-50%, -50%);
273 margin: 30px 10px 20px 10px;
275 word-wrap: break-word;
281 border-bottom: 1px solid;
282 overflow-wrap: break-word;
283 word-wrap: break-word; /* deprecated */
284 word-break: break-word; /* Chrome, non-standard */
291 .location a:first-child {
299 .block h2, .block h3 {
304 .block ul, .block li {
312 text-overflow: ellipsis;
318 transition: border 500ms ease-out;
322 border-top: 1px solid;
323 border-bottom: 1px solid;
346 .source .content pre.rust {
352 .rustdoc:not(.source) .example-wrap {
353 display: inline-flex;
362 .example-wrap > pre.line-number {
365 border-top-left-radius: 5px;
366 border-bottom-left-radius: 5px;
371 .rustdoc:not(.source) .example-wrap > pre.rust {
376 .rustdoc:not(.source) .example-wrap > pre {
398 .content pre.line-numbers {
403 -webkit-user-select: none;
404 -moz-user-select: none;
405 -ms-user-select: none;
413 overflow-wrap: anywhere;
421 text-overflow: ellipsis;
424 /* Wrap non-pre code blocks (`text`) but not (```text```). */
425 .docblock > :not(pre) > code,
426 .docblock-short > :not(pre) > code {
427 white-space: pre-wrap;
430 .docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5 {
431 border-bottom: 1px solid;
434 #main > .docblock h1 { font-size: 1.3em; }
435 #main > .docblock h2 { font-size: 1.15em; }
436 #main > .docblock h3, #main > .docblock h4, #main > .docblock h5 { font-size: 1em; }
438 #main > h2 + div, #main > h2 + h3, #main > h3 + div {
439 display: none; /* Changed to flex or block via js once the page is loaded */
443 .docblock h1 { font-size: 1em; }
444 .docblock h2 { font-size: 0.95em; }
445 .docblock h3, .docblock h4, .docblock h5 { font-size: 0.9em; }
452 .content .out-of-band {
460 h3.impl > .out-of-band {
464 h4.method > .out-of-band {
468 h4 > code, h3 > code, .invisible > code {
469 max-width: calc(100% - 41px);
475 display: inline-block;
484 display: inline-block;
492 font-family: "Fira Sans", Arial, sans-serif;
495 .content table:not(.table-display) {
496 border-spacing: 0 5px;
498 .content td { vertical-align: top; }
499 .content td:first-child { padding-right: 20px; }
500 .content td p:first-child { margin-top: 0; }
501 .content td h1, .content td h2 { margin-left: 0; font-size: 1.1em; }
502 .content tr:first-child td { border-top: 0; }
506 width: calc(100% - 2px);
525 .content .item-list {
526 list-style-type: none;
530 .content .multi-column {
531 -moz-column-count: 5;
532 -moz-column-gap: 2.5em;
533 -webkit-column-count: 5;
534 -webkit-column-gap: 2.5em;
538 .content .multi-column li { width: 100%; display: inline-block; }
544 /* Shift "where ..." part of method or fn definition down a line */
545 .content .method .where,
547 .content .where.fmt-newline {
552 .content .methods > div:not(.notable-traits) {
557 .content .docblock > .impl-items {
561 .content .docblock > .impl-items > h4 {
564 .content .docblock >.impl-items .table-display {
567 .content .docblock >.impl-items table td {
570 .toggle-wrapper.marg-left > .collapse-toggle {
573 .content .docblock > .impl-items .table-display, .impl-items table td {
577 .content .item-info code {
581 .content .item-info {
587 .sub-variant > div > .item-info {
591 .content .item-info::before {
599 .content .impl-items .method, .content .impl-items > .type, .impl-items > .associatedconstant {
603 .content .impl-items .docblock, .content .impl-items .item-info {
607 .content .impl-items > .item-info {
611 .methods > .item-info, .content .impl-items > .item-info {
624 border-bottom: 1px solid;
625 padding-bottom: 10px;
633 border-top: 1px solid;
634 border-bottom: 1px solid;
636 nav.main .separator {
638 display: inline-block;
642 nav.sum { text-align: right; }
643 nav.sub form { display: inline; }
650 text-decoration: none;
651 background: transparent;
654 .small-section-header:hover > .anchor {
658 .in-band:hover > .anchor, .impl:hover > .anchor {
659 display: inline-block;
670 .small-section-header > .anchor {
672 padding-right: 10px; /* avoid gap that causes hover to disappear */
675 content: '\2002\00a7\2002';
678 .docblock a:not(.srclink):not(.test-arrow):hover,
679 .docblock-short a:not(.srclink):not(.test-arrow):hover, .item-info a {
680 text-decoration: underline;
683 .invisible > .srclink, h4 > code + .srclink, h3 > code + .srclink {
691 .block a.current.crate { font-weight: 500; }
696 .search-container > div {
697 display: inline-flex;
698 width: calc(100% - 63px);
708 border-radius: 4px 0 0 4px;
711 border-right: 1px solid;
712 -moz-appearance: none;
713 -webkit-appearance: none;
714 /* Removes default arrow from firefox */
717 background-repeat: no-repeat;
718 background-color: transparent;
719 background-size: 20px;
720 background-position: calc(100% - 1px) 56%;
722 .search-container > .top-button {
728 /* Override Normalize.css: we have margins and do
729 not want to overflow - the `moz` attribute is necessary
730 until Firefox 29, too early to drop at this point */
731 -moz-box-sizing: border-box !important;
732 box-sizing: border-box !important;
739 transition: border-color 300ms ease;
740 transition: border-radius 300ms ease-in-out;
741 transition: box-shadow 300ms ease-in-out;
745 #crate-search + .search-input {
746 border-radius: 0 1px 1px 0;
747 width: calc(100% - 32px);
750 .search-input:focus {
756 .search-results .desc {
758 text-overflow: ellipsis;
767 .content .search-results td:first-child {
771 .content .search-results td:first-child a {
774 .content .search-results td:first-child a:after {
779 .content .search-results td:first-child a span {
783 tr.result span.primitive::after {
784 content: ' (primitive type)';
788 tr.result span.keyword::after {
789 content: ' (keyword)';
793 body.blur > :not(#help) {
795 -webkit-filter: blur(8px);
806 justify-content: center;
811 box-shadow: 0 0 6px rgba(0,0,0,.2);
820 margin-right: 0.5rem;
827 border-bottom: 1px solid #ccc;
831 #help dd { margin: 5px 35px; }
832 #help .infos { padding-left: 0; }
833 #help h1, #help h2 { margin-top: 0; }
837 padding: 0 20px 20px 17px;;
860 /* Black one-pixel outline around emoji shapes */
871 display: inline-block;
877 vertical-align: text-bottom;
880 .module-item.unstable {
892 .impl-items .since, .impl .since, .methods .since {
899 .impl-items .srclink, .impl .srclink, .methods .srclink {
901 /* Override header settings otherwise it's too bold */
906 .impl-items code, .impl code, .methods code {
910 .impl-items h4, h4.impl, h3.impl, .methods h3 {
915 /* Push the src link out to the right edge consistently */
916 justify-content: space-between;
923 .variants_table tbody tr td:first-child {
924 width: 1%; /* make the variant name as small as possible */
935 pre.rust .question-mark {
940 display: inline-block;
942 padding: 5px 10px 5px 10px;
950 text-decoration: none;
953 .section-header:hover a:before {
956 padding-right: 10px; /* avoid gap that causes hover to disappear */
957 content: '\2002\00a7\2002';
960 .section-header:hover a {
961 text-decoration: none;
975 h3 > .collapse-toggle, h4 > .collapse-toggle {
980 .toggle-wrapper > .collapse-toggle {
990 .toggle-wrapper.collapsed {
992 transition: height .2s;
996 .collapse-toggle > .inner {
997 display: inline-block;
1002 .collapse-toggle.hidden-default {
1008 display: table-cell;
1017 .out-of-band > span.since {
1023 .toggle-wrapper > .collapse-toggle {
1027 .variant + .toggle-wrapper + .docblock > p {
1031 .sub-variant, .sub-variant > h3 {
1032 margin-top: 1px !important;
1035 #main > .sub-variant > h3 {
1041 .sub-variant > div {
1043 margin-bottom: 10px;
1046 .sub-variant > div > span {
1052 display: inline-block;
1057 .enum > .toggle-wrapper + .docblock, .struct > .toggle-wrapper + .docblock {
1059 margin-bottom: 20px;
1063 .docblock > .section-header:first-child {
1068 .docblock > .section-header:first-child:hover > a:before {
1072 .enum > .collapsed, .struct > .collapsed {
1073 margin-bottom: 25px;
1076 #main > .variant, #main > .structfield {
1082 margin-top: 0px !important;
1084 margin-bottom: 0px !important;
1087 .toggle-attributes.collapsed {
1090 .impl-items > .toggle-attributes {
1093 .impl-items .attributes {
1110 display: inline-block;
1117 padding: 5px 3px 3px 3px;
1123 .tooltip.ignore::after {
1124 content: "This example is not tested";
1126 .tooltip.compile_fail::after {
1127 content: "This example deliberately fails to compile";
1129 .tooltip.should_panic::after {
1130 content: "This example panics";
1132 .tooltip.edition::after {
1133 content: "This code runs with edition " attr(data-edition);
1143 border-style: solid;
1147 .tooltip:hover::before, .tooltip:hover::after {
1151 .tooltip.compile_fail, .tooltip.should_panic, .tooltip.ignore {
1156 .notable-traits-tooltip {
1157 display: inline-block;
1161 .notable-traits:hover .notable-traits-tooltiptext,
1162 .notable-traits .notable-traits-tooltiptext.force-tooltip {
1163 display: inline-block;
1166 .notable-traits .notable-traits-tooltiptext {
1168 padding: 5px 3px 3px 3px;
1178 .notable-traits-tooltip::after {
1179 /* The margin on the tooltip does not capture hover events,
1180 this extends the area of hover enough so that mouse hover is not
1181 lost when moving the mouse to the tooltip */
1182 content: "\00a0\00a0\00a0";
1185 .notable-traits .notable, .notable-traits .docblock {
1189 .notable-traits .docblock code.content{
1195 /* Example code has the "Run" button that needs to be positioned relative to the pre */
1196 pre.rust.rust-example-rendered {
1210 .search-failed > ul {
1228 border-top: 2px solid;
1231 #titles > button:not(:last-child) {
1233 width: calc(33.3% - 1px);
1236 #titles > button > div.count {
1237 display: inline-block;
1247 h4 > .notable-traits {
1257 margin-bottom: 10px;
1271 border-top-right-radius: 3px;
1272 border-bottom-right-radius: 3px;
1275 transition: left .5s;
1288 transition: left .5s;
1289 border-right: 1px solid;
1291 #source-sidebar > .title {
1294 border-bottom: 1px solid;
1304 .theme-picker button {
1308 #settings-menu, .help-button {
1318 #theme-picker, #settings-menu, .help-button, #copy-path {
1329 font-family: "Fira Sans", Arial, sans-serif;
1354 #theme-choices > button {
1359 background: rgba(0,0,0,0);
1362 #theme-choices > button:not(:first-child) {
1363 border-top: 1px solid;
1368 @media (min-width: 701px) {
1369 /* In case there is no documentation before a code block, we need to add some margin at the top
1370 to prevent an overlay between the "collapse toggle" and the information tooltip.
1371 However, it's not needed with smaller screen width because the doc/code block is always put
1372 "one line" below. */
1373 .docblock > .information:first-child > .tooltip {
1378 @media (max-width: 700px) {
1383 .rustdoc > .sidebar {
1393 .sidebar > .location {
1397 padding: 3px 10px 1px 10px;
1399 background: inherit;
1404 .sidebar .location:empty {
1408 .sidebar .logo-container {
1417 .sidebar .logo-container > img {
1431 border-bottom: 1px solid;
1432 border-right: 1px solid;
1436 .rustdoc.source > .sidebar > .sidebar-menu {
1447 border-right: 1px solid;
1451 .sidebar > .block.version {
1452 border-bottom: none;
1458 width: calc(100% - 32px);
1475 .content h4 > .out-of-band {
1479 .toggle-wrapper > .collapse-toggle {
1491 .content .impl-items .method, .content .impl-items > .type, .impl-items > .associatedconstant {
1496 display: none !important;
1509 h4 > .notable-traits {
1515 #titles > button > div.count {
1528 background-color: rgba(0,0,0,0);
1532 This allows to prevent the version text to overflow the sidebar title on mobile mode when the
1533 sidebar is displayed (after clicking on the "hamburger" button).
1535 .sidebar.mobile > div.version {
1540 width: calc(100% + 30px);
1548 .show-it > .block.items {
1552 .show-it > .block.items > ul {
1556 .show-it > .block.items > ul > li {
1561 .show-it > .block.items > ul > li > a {
1565 /* Because of ios, we need to actually have a full height sidebar title so the
1566 * actual sidebar can show up. But then we need to make it transparent so we don't
1567 * hide content. The filler just allows to create the background for the sidebar
1568 * title. But because of the absolute position, I had to lower the z-index.
1573 width: calc(100% - 45px);
1577 border-bottom: 1px solid;
1584 .impl > .collapse-toggle {
1604 #main > .line-numbers {
1608 .notable-traits .notable-traits-tooltiptext {
1613 /* We don't display the help button on mobile devices. */
1617 .search-container > div {
1618 width: calc(100% - 32px);
1623 nav.sub, .content .out-of-band, .collapse-toggle {
1628 @media (max-width: 464px) {
1629 #titles, #titles > button {
1633 /* This is to prevent the search bar from being underneath the <section>
1634 * element following it.
1640 #main > table:not(.table-display) td {
1641 word-break: break-word;
1645 .search-container > div {
1647 width: calc(100% - 37px);
1656 #crate-search + .search-input {
1657 width: calc(100% + 71px);
1661 #theme-picker, #settings-menu {
1682 margin-bottom: 13px;
1687 display: inline-block;
1689 font: 15px monospace;
1691 vertical-align: middle;
1694 box-shadow: inset 0 -1px 0;
1698 .hidden-by-impl-hider,
1699 .hidden-by-usual-hider {
1700 /* important because of conflicting rule for small screens */
1701 display: none !important;
1704 #implementations-list > h3 > span.in-band {
1711 border-collapse: collapse;
1716 .table-display tr td:first-child {
1720 .table-display tr td:last-child {
1723 .table-display .out-of-band {
1728 #implementors-list > .impl-items .table-display .out-of-band {
1732 .table-display td:hover .anchor {
1762 div.files > a:hover, div.name:hover {
1763 background-color: #a14b4b;
1765 div.name.expand + .children {
1776 div.name.expand::before {
1777 transform: rotate(90deg);
1782 /* This part is to fix the "Expand attributes" part in the type declaration. */
1783 .type-decl > pre > .toggle-wrapper.toggle-attributes.top-attr {
1784 margin-left: 0 !important;
1786 .type-decl > pre > .docblock.attributes.top-attr {
1787 margin-left: 1.8em !important;
1789 .type-decl > pre > .toggle-attributes {
1792 .type-decl > pre > .docblock.attributes {