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 SourceSerif4-LICENSE.md for the Source Serif 4 license. */
23 font-family: 'Source Serif 4';
26 src: local('Source Serif 4'), url("SourceSerif4-Regular.ttf.woff") format('woff');
30 font-family: 'Source Serif 4';
33 src: local('Source Serif 4 Italic'), url("SourceSerif4-It.ttf.woff") format('woff');
37 font-family: 'Source Serif 4';
40 src: local('Source Serif 4 Bold'), url("SourceSerif4-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 4", 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):not(.associatedtype) {
115 margin: 20px 0 15px 0;
120 border-bottom: 1px dashed;
123 /* workaround to keep flex from breaking below 700 px width due to the float: right on the nav
127 h1.fqn > .in-band > a:hover {
128 text-decoration: underline;
130 h2, h3:not(.impl):not(.method):not(.type):not(.tymethod),
131 h4:not(.method):not(.type):not(.tymethod):not(.associatedconstant):not(.associatedtype) {
132 border-bottom: 1px solid;
134 h3.impl, h3.method, h4.method, h3.type, h4.type, h4.associatedconstant, h4.associatedtype {
141 h3.impl, h3.method, h4.method.trait-impl, h3.type,
142 h4.type.trait-impl, h4.associatedconstant.trait-impl, h4.associatedtype.trait-impl {
147 .sidebar, a.source, .search-input, .content table td:first-child > a,
148 div.item-list .out-of-band,
149 #source-sidebar, #sidebar-toggle,
150 details.rustdoc-toggle > summary::before,
151 details.undocumented > summary::before,
152 .content ul.crate a.crate,
153 /* This selector is for the items listed in the "all items" page. */
154 #main > ul.docblock > li > a {
155 font-family: "Fira Sans", Arial, sans-serif;
158 .content ul.crate a.crate {
165 ul ul, ol ul, ul ol, ol ol {
177 code, pre, a.test-arrow {
178 font-family: "Source Code Pro", monospace;
180 .docblock code, .docblock-short code {
184 .docblock pre code, .docblock-short pre code {
192 .source .content pre {
213 text-transform: uppercase;
225 /* Improve the scrollbar display on firefox */
227 scrollbar-width: initial;
230 scrollbar-width: thin;
233 /* Improve the scrollbar display on webkit-based browsers */
234 ::-webkit-scrollbar {
237 .sidebar::-webkit-scrollbar {
240 ::-webkit-scrollbar-track {
241 -webkit-box-shadow: inset 0;
244 .sidebar .block > ul > li {
252 /* Everything else */
255 display: none !important;
267 .logo-container > img {
273 transform: translate(-50%, -50%);
280 margin: 30px 10px 20px 10px;
282 word-wrap: break-word;
288 border-bottom: 1px solid;
289 overflow-wrap: break-word;
290 word-wrap: break-word; /* deprecated */
291 word-break: break-word; /* Chrome, non-standard */
298 .location a:first-child {
306 .block h2, .block h3 {
311 .block ul, .block li {
319 text-overflow: ellipsis;
325 transition: border 500ms ease-out;
329 border-top: 1px solid;
330 border-bottom: 1px solid;
353 .source .content pre.rust {
359 .rustdoc .example-wrap {
360 display: inline-flex;
369 .example-wrap > pre.line-number {
374 border-top-left-radius: 5px;
375 border-bottom-left-radius: 5px;
378 .rustdoc:not(.source) .example-wrap > pre.rust {
383 .rustdoc .example-wrap > pre {
397 .content > .example-wrap pre.line-numbers {
399 -webkit-user-select: none;
400 -moz-user-select: none;
401 -ms-user-select: none;
409 overflow-wrap: anywhere;
417 text-overflow: ellipsis;
420 /* Wrap non-pre code blocks (`text`) but not (```text```). */
421 .docblock > :not(pre) > code,
422 .docblock-short > :not(pre) > code {
423 white-space: pre-wrap;
426 .docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5 {
427 border-bottom: 1px solid;
430 #main > .docblock h1 { font-size: 1.3em; }
431 #main > .docblock h2 { font-size: 1.15em; }
432 #main > .docblock h3, #main > .docblock h4, #main > .docblock h5 { font-size: 1em; }
434 .docblock h1 { font-size: 1em; }
435 .docblock h2 { font-size: 0.95em; }
436 .docblock h3, .docblock h4, .docblock h5 { font-size: 0.9em; }
443 .content .out-of-band {
452 h3.impl > .out-of-band {
456 h4.method > .out-of-band {
460 h4 > code, h3 > code, .invisible > code {
461 max-width: calc(100% - 41px);
467 display: inline-block;
477 display: inline-block;
485 font-family: "Fira Sans", Arial, sans-serif;
488 .content table:not(.table-display) {
489 border-spacing: 0 5px;
491 .content td { vertical-align: top; }
492 .content td:first-child { padding-right: 20px; }
493 .content td p:first-child { margin-top: 0; }
494 .content td h1, .content td h2 { margin-left: 0; font-size: 1.1em; }
495 .content tr:first-child td { border-top: 0; }
499 width: calc(100% - 2px);
518 .content .item-list {
519 list-style-type: none;
523 .content .multi-column {
524 -moz-column-count: 5;
525 -moz-column-gap: 2.5em;
526 -webkit-column-count: 5;
527 -webkit-column-gap: 2.5em;
531 .content .multi-column li { width: 100%; display: inline-block; }
537 /* Shift "where ..." part of method or fn definition down a line */
538 .content .method .where,
540 .content .where.fmt-newline {
545 .content .methods > div:not(.notable-traits):not(.methods) {
550 .content .docblock > .impl-items {
554 .content .docblock > .impl-items > h4 {
557 .content .docblock >.impl-items .table-display {
560 .content .docblock >.impl-items table td {
563 .content .docblock > .impl-items .table-display, .impl-items table td {
567 .content .item-info code {
571 .content .item-info {
577 .sub-variant > div > .item-info {
581 .content .item-info::before {
589 .content .impl-items .method, .content .impl-items > .type, .impl-items > .associatedconstant,
590 .impl-items > .associatedtype, .content .impl-items details > summary > .type,
591 .impl-items details > summary > .associatedconstant,
592 .impl-items details > summary > .associatedtype {
596 .content .impl-items .docblock, .content .impl-items .item-info {
600 .content .impl-items > .item-info {
604 .methods > .item-info, .content .impl-items > .item-info {
617 border-bottom: 1px solid;
618 padding-bottom: 10px;
626 border-top: 1px solid;
627 border-bottom: 1px solid;
629 nav.main .separator {
631 display: inline-block;
635 nav.sum { text-align: right; }
636 nav.sub form { display: inline; }
643 text-decoration: none;
644 background: transparent;
647 .small-section-header:hover > .anchor {
651 .in-band:hover > .anchor, .impl:hover > .anchor, .method.trait-impl:hover > .anchor,
652 .type.trait-impl:hover > .anchor, .associatedconstant.trait-impl:hover > .anchor,
653 .associatedtype.trait-impl:hover > .anchor {
654 display: inline-block;
665 .small-section-header > .anchor {
667 padding-right: 10px; /* avoid gap that causes hover to disappear */
670 content: '\2002\00a7\2002';
673 .docblock a:not(.srclink):not(.test-arrow):hover,
674 .docblock-short a:not(.srclink):not(.test-arrow):hover, .item-info a {
675 text-decoration: underline;
678 .invisible > .srclink, h4 > code + .srclink, h3 > code + .srclink {
686 .block a.current.crate { font-weight: 500; }
691 .search-container > div {
692 display: inline-flex;
693 width: calc(100% - 63px);
703 border-radius: 4px 0 0 4px;
706 border-right: 1px solid;
707 -moz-appearance: none;
708 -webkit-appearance: none;
709 /* Removes default arrow from firefox */
712 background-repeat: no-repeat;
713 background-color: transparent;
714 background-size: 20px;
715 background-position: calc(100% - 1px) 56%;
717 .search-container > .top-button {
723 /* Override Normalize.css: we have margins and do
724 not want to overflow - the `moz` attribute is necessary
725 until Firefox 29, too early to drop at this point */
726 -moz-box-sizing: border-box !important;
727 box-sizing: border-box !important;
734 transition: border-color 300ms ease;
735 transition: border-radius 300ms ease-in-out;
736 transition: box-shadow 300ms ease-in-out;
740 #crate-search + .search-input {
741 border-radius: 0 1px 1px 0;
742 width: calc(100% - 32px);
745 .search-input:focus {
751 .search-results .desc {
753 text-overflow: ellipsis;
762 .content .search-results td:first-child {
766 .content .search-results td:first-child a {
769 .content .search-results td:first-child a:after {
774 .content .search-results td:first-child a span {
778 tr.result span.primitive::after {
779 content: ' (primitive type)';
783 tr.result span.keyword::after {
784 content: ' (keyword)';
788 body.blur > :not(#help) {
790 -webkit-filter: blur(8px);
801 justify-content: center;
806 box-shadow: 0 0 6px rgba(0,0,0,.2);
815 margin-right: 0.5rem;
822 border-bottom: 1px solid #ccc;
826 #help dd { margin: 5px 35px; }
827 #help .infos { padding-left: 0; }
828 #help h1, #help h2 { margin-top: 0; }
832 padding: 0 20px 20px 17px;;
855 /* Black one-pixel outline around emoji shapes */
867 display: inline-block;
873 vertical-align: text-bottom;
876 .module-item.unstable,
877 .import-item.unstable {
889 .impl-items .since, .impl .since, .methods .since {
896 .impl-items .srclink, .impl .srclink, .methods .srclink {
898 /* Override header settings otherwise it's too bold */
903 .impl-items code, .impl code, .methods code {
907 .impl-items h4, h4.impl, h3.impl, .methods h3 {
912 /* Push the src link out to the right edge consistently */
913 justify-content: space-between;
920 .variants_table tbody tr td:first-child {
921 width: 1%; /* make the variant name as small as possible */
932 pre.rust .question-mark {
937 display: inline-block;
939 padding: 5px 10px 5px 10px;
947 text-decoration: none;
950 .section-header:hover a:before {
953 padding-right: 10px; /* avoid gap that causes hover to disappear */
954 content: '\2002\00a7\2002';
957 .section-header:hover a {
958 text-decoration: none;
979 .out-of-band > span.since {
985 .sub-variant, .sub-variant > h3 {
986 margin-top: 0px !important;
990 #main > details > .sub-variant > h3 {
1001 .sub-variant > div > span {
1007 display: inline-block;
1012 .docblock > .section-header:first-child {
1017 .docblock > .section-header:first-child:hover > a:before {
1021 #main > .variant, #main > .structfield {
1039 display: inline-block;
1046 padding: 5px 3px 3px 3px;
1052 .tooltip.ignore::after {
1053 content: "This example is not tested";
1055 .tooltip.compile_fail::after {
1056 content: "This example deliberately fails to compile";
1058 .tooltip.should_panic::after {
1059 content: "This example panics";
1061 .tooltip.edition::after {
1062 content: "This code runs with edition " attr(data-edition);
1072 border-style: solid;
1076 .tooltip:hover::before, .tooltip:hover::after {
1080 .tooltip.compile_fail, .tooltip.should_panic, .tooltip.ignore {
1085 .notable-traits-tooltip {
1086 display: inline-block;
1090 .notable-traits:hover .notable-traits-tooltiptext,
1091 .notable-traits .notable-traits-tooltiptext.force-tooltip {
1092 display: inline-block;
1095 .notable-traits .notable-traits-tooltiptext {
1097 padding: 5px 3px 3px 3px;
1107 .notable-traits-tooltip::after {
1108 /* The margin on the tooltip does not capture hover events,
1109 this extends the area of hover enough so that mouse hover is not
1110 lost when moving the mouse to the tooltip */
1111 content: "\00a0\00a0\00a0";
1114 .notable-traits .notable, .notable-traits .docblock {
1118 .notable-traits .docblock code.content{
1124 /* Example code has the "Run" button that needs to be positioned relative to the pre */
1125 pre.rust.rust-example-rendered {
1139 .search-failed > ul {
1157 border-top: 2px solid;
1160 #titles > button:not(:last-child) {
1162 width: calc(33.3% - 1px);
1165 #titles > button > div.count {
1166 display: inline-block;
1176 h4 > .notable-traits {
1186 margin-bottom: 10px;
1200 border-top-right-radius: 3px;
1201 border-bottom-right-radius: 3px;
1204 transition: left .5s;
1217 transition: left .5s;
1218 border-right: 1px solid;
1220 #source-sidebar > .title {
1223 border-bottom: 1px solid;
1233 .theme-picker button {
1237 #settings-menu, #help-button {
1247 #theme-picker, #settings-menu, #help-button, #copy-path {
1258 font-family: "Fira Sans", Arial, sans-serif;
1284 #theme-choices > button {
1289 background: rgba(0,0,0,0);
1292 #theme-choices > button:not(:first-child) {
1293 border-top: 1px solid;
1298 @media (min-width: 701px) {
1299 /* In case there is no documentation before a code block, we need to add some margin at the top
1300 to prevent an overlay between the "collapse toggle" and the information tooltip.
1301 However, it's not needed with smaller screen width because the doc/code block is always put
1302 "one line" below. */
1303 .docblock > .information:first-child > .tooltip {
1308 @media (max-width: 700px) {
1313 .rustdoc > .sidebar {
1323 .sidebar > .location {
1327 padding: 3px 10px 1px 10px;
1329 background: inherit;
1334 .sidebar .location:empty {
1338 .sidebar .logo-container {
1347 .sidebar .logo-container > img {
1361 border-bottom: 1px solid;
1362 border-right: 1px solid;
1366 .rustdoc.source > .sidebar > .sidebar-menu {
1377 border-right: 1px solid;
1381 .sidebar > .block.version {
1382 border-bottom: none;
1388 width: calc(100% - 32px);
1401 .content h4 > .out-of-band {
1409 .content .impl-items .method, .content .impl-items > .type, .impl-items > .associatedconstant,
1410 .impl-items > .associatedtype {
1415 display: none !important;
1424 h4 > .notable-traits {
1430 #titles > button > div.count {
1443 background-color: rgba(0,0,0,0);
1447 This allows to prevent the version text to overflow the sidebar title on mobile mode when the
1448 sidebar is displayed (after clicking on the "hamburger" button).
1450 .sidebar.mobile > div.version {
1455 width: calc(100% + 30px);
1463 .show-it > .block.items {
1467 .show-it > .block.items > ul {
1471 .show-it > .block.items > ul > li {
1476 .show-it > .block.items > ul > li > a {
1480 /* Because of ios, we need to actually have a full height sidebar title so the
1481 * actual sidebar can show up. But then we need to make it transparent so we don't
1482 * hide content. The filler just allows to create the background for the sidebar
1483 * title. But because of the absolute position, I had to lower the z-index.
1488 width: calc(100% - 45px);
1492 border-bottom: 1px solid;
1495 .item-list > details.rustdoc-toggle > summary:not(.hideme)::before {
1515 #main > .line-numbers {
1519 .notable-traits .notable-traits-tooltiptext {
1524 /* We don't display the help button on mobile devices. */
1528 .search-container > div {
1529 width: calc(100% - 32px);
1534 nav.sub, .content .out-of-band {
1539 @media (max-width: 464px) {
1540 #titles, #titles > button {
1544 /* This is to prevent the search bar from being underneath the <section>
1545 * element following it.
1551 #main > table:not(.table-display) td {
1552 word-break: break-word;
1556 .search-container > div {
1558 width: calc(100% - 37px);
1567 #crate-search + .search-input {
1568 width: calc(100% + 71px);
1572 #theme-picker, #settings-menu {
1593 margin-bottom: 13px;
1598 display: inline-block;
1600 font: 15px monospace;
1602 vertical-align: middle;
1605 box-shadow: inset 0 -1px 0;
1609 .hidden-by-impl-hider,
1610 .hidden-by-usual-hider {
1611 /* important because of conflicting rule for small screens */
1612 display: none !important;
1615 #implementations-list > h3 > span.in-band {
1622 border-collapse: collapse;
1627 .table-display tr td:first-child {
1631 .table-display tr td:last-child {
1634 .table-display .out-of-band {
1639 #implementors-list > .impl-items .table-display .out-of-band {
1643 .table-display td:hover .anchor {
1673 div.files > a:hover, div.name:hover {
1674 background-color: #a14b4b;
1676 div.name.expand + .children {
1687 div.name.expand::before {
1688 transform: rotate(90deg);
1693 /* The hideme class is used on summary tags that contain a span with
1694 placeholder text shown only when the toggle is closed. For instance,
1695 "Expand description" or "Show methods". */
1696 details.rustdoc-toggle > summary.hideme {
1700 details.rustdoc-toggle > summary::-webkit-details-marker,
1701 details.rustdoc-toggle > summary::marker,
1702 details.undocumented > summary::-webkit-details-marker,
1703 details.undocumented > summary::marker {
1707 details.rustdoc-toggle > summary.hideme > span {
1711 details.rustdoc-toggle > summary::before {
1715 letter-spacing: 1px;
1719 details.rustdoc-toggle.top-doc > summary,
1720 details.rustdoc-toggle.top-doc > summary::before,
1721 details.rustdoc-toggle.non-exhaustive > summary,
1722 details.rustdoc-toggle.non-exhaustive > summary::before {
1723 font-family: 'Fira Sans';
1727 details.non-exhaustive {
1731 details.rustdoc-toggle > summary.hideme::before {
1735 details.rustdoc-toggle > summary:not(.hideme)::before {
1741 .impl-items > details.rustdoc-toggle > summary:not(.hideme)::before,
1742 .undocumented > details.rustdoc-toggle > summary:not(.hideme)::before {
1748 /* When a "hideme" summary is open and the "Expand description" or "Show
1749 methods" text is hidden, we want the [-] toggle that remains to not
1750 affect the layout of the items to its right. To do that, we use
1751 absolute positioning. Note that we also set position: relative
1752 on the parent <details> to make this work properly. */
1753 details.rustdoc-toggle[open] > summary.hideme {
1757 details.rustdoc-toggle, details.undocumented {
1761 details.rustdoc-toggle[open] > summary.hideme > span {
1765 details.rustdoc-toggle[open] > summary::before {
1770 details.undocumented > summary::before {
1771 content: "[+] Show hidden undocumented items";
1777 details.undocumented[open] > summary::before {
1778 content: "[-] Hide undocumented items";