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 .collapse-toggle, 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 #main > h2 + div, #main > h2 + h3, #main > h3 + div {
435 display: none; /* Changed to flex or block via js once the page is loaded */
439 .docblock h1 { font-size: 1em; }
440 .docblock h2 { font-size: 0.95em; }
441 .docblock h3, .docblock h4, .docblock h5 { font-size: 0.9em; }
448 .content .out-of-band {
457 h3.impl > .out-of-band {
461 h4.method > .out-of-band {
465 h4 > code, h3 > code, .invisible > code {
466 max-width: calc(100% - 41px);
472 display: inline-block;
482 display: inline-block;
490 font-family: "Fira Sans", Arial, sans-serif;
493 .content table:not(.table-display) {
494 border-spacing: 0 5px;
496 .content td { vertical-align: top; }
497 .content td:first-child { padding-right: 20px; }
498 .content td p:first-child { margin-top: 0; }
499 .content td h1, .content td h2 { margin-left: 0; font-size: 1.1em; }
500 .content tr:first-child td { border-top: 0; }
504 width: calc(100% - 2px);
523 .content .item-list {
524 list-style-type: none;
528 .content .multi-column {
529 -moz-column-count: 5;
530 -moz-column-gap: 2.5em;
531 -webkit-column-count: 5;
532 -webkit-column-gap: 2.5em;
536 .content .multi-column li { width: 100%; display: inline-block; }
542 /* Shift "where ..." part of method or fn definition down a line */
543 .content .method .where,
545 .content .where.fmt-newline {
550 .content .methods > div:not(.notable-traits) {
555 .content .docblock > .impl-items {
559 .content .docblock > .impl-items > h4 {
562 .content .docblock >.impl-items .table-display {
565 .content .docblock >.impl-items table td {
568 .toggle-wrapper.marg-left > .collapse-toggle {
571 .content .docblock > .impl-items .table-display, .impl-items table td {
575 .content .item-info code {
579 .content .item-info {
585 .sub-variant > div > .item-info {
589 .content .item-info::before {
597 .content .impl-items .method, .content .impl-items > .type, .impl-items > .associatedconstant,
598 .impl-items > .associatedtype, .content .impl-items details > summary > .type,
599 .impl-items details > summary > .associatedconstant,
600 .impl-items details > summary > .associatedtype {
604 .content .impl-items .docblock, .content .impl-items .item-info {
608 .content .impl-items > .item-info {
612 .methods > .item-info, .content .impl-items > .item-info {
625 border-bottom: 1px solid;
626 padding-bottom: 10px;
634 border-top: 1px solid;
635 border-bottom: 1px solid;
637 nav.main .separator {
639 display: inline-block;
643 nav.sum { text-align: right; }
644 nav.sub form { display: inline; }
651 text-decoration: none;
652 background: transparent;
655 .small-section-header:hover > .anchor {
659 .in-band:hover > .anchor, .impl:hover > .anchor, .method.trait-impl:hover > .anchor,
660 .type.trait-impl:hover > .anchor, .associatedconstant.trait-impl:hover > .anchor,
661 .associatedtype.trait-impl:hover > .anchor {
662 display: inline-block;
673 .small-section-header > .anchor {
675 padding-right: 10px; /* avoid gap that causes hover to disappear */
678 content: '\2002\00a7\2002';
681 .docblock a:not(.srclink):not(.test-arrow):hover,
682 .docblock-short a:not(.srclink):not(.test-arrow):hover, .item-info a {
683 text-decoration: underline;
686 .invisible > .srclink, h4 > code + .srclink, h3 > code + .srclink {
694 .block a.current.crate { font-weight: 500; }
699 .search-container > div {
700 display: inline-flex;
701 width: calc(100% - 63px);
711 border-radius: 4px 0 0 4px;
714 border-right: 1px solid;
715 -moz-appearance: none;
716 -webkit-appearance: none;
717 /* Removes default arrow from firefox */
720 background-repeat: no-repeat;
721 background-color: transparent;
722 background-size: 20px;
723 background-position: calc(100% - 1px) 56%;
725 .search-container > .top-button {
731 /* Override Normalize.css: we have margins and do
732 not want to overflow - the `moz` attribute is necessary
733 until Firefox 29, too early to drop at this point */
734 -moz-box-sizing: border-box !important;
735 box-sizing: border-box !important;
742 transition: border-color 300ms ease;
743 transition: border-radius 300ms ease-in-out;
744 transition: box-shadow 300ms ease-in-out;
748 #crate-search + .search-input {
749 border-radius: 0 1px 1px 0;
750 width: calc(100% - 32px);
753 .search-input:focus {
759 .search-results .desc {
761 text-overflow: ellipsis;
770 .content .search-results td:first-child {
774 .content .search-results td:first-child a {
777 .content .search-results td:first-child a:after {
782 .content .search-results td:first-child a span {
786 tr.result span.primitive::after {
787 content: ' (primitive type)';
791 tr.result span.keyword::after {
792 content: ' (keyword)';
796 body.blur > :not(#help) {
798 -webkit-filter: blur(8px);
809 justify-content: center;
814 box-shadow: 0 0 6px rgba(0,0,0,.2);
823 margin-right: 0.5rem;
830 border-bottom: 1px solid #ccc;
834 #help dd { margin: 5px 35px; }
835 #help .infos { padding-left: 0; }
836 #help h1, #help h2 { margin-top: 0; }
840 padding: 0 20px 20px 17px;;
863 /* Black one-pixel outline around emoji shapes */
875 display: inline-block;
881 vertical-align: text-bottom;
884 .module-item.unstable,
885 .import-item.unstable {
897 .impl-items .since, .impl .since, .methods .since {
904 .impl-items .srclink, .impl .srclink, .methods .srclink {
906 /* Override header settings otherwise it's too bold */
911 .impl-items code, .impl code, .methods code {
915 .impl-items h4, h4.impl, h3.impl, .methods h3 {
920 /* Push the src link out to the right edge consistently */
921 justify-content: space-between;
928 .variants_table tbody tr td:first-child {
929 width: 1%; /* make the variant name as small as possible */
940 pre.rust .question-mark {
945 display: inline-block;
947 padding: 5px 10px 5px 10px;
955 text-decoration: none;
958 .section-header:hover a:before {
961 padding-right: 10px; /* avoid gap that causes hover to disappear */
962 content: '\2002\00a7\2002';
965 .section-header:hover a {
966 text-decoration: none;
984 h3 > .collapse-toggle, h4 > .collapse-toggle {
989 .toggle-wrapper > .collapse-toggle {
999 .toggle-wrapper.collapsed {
1001 transition: height .2s;
1002 margin-bottom: .6em;
1005 .collapse-toggle > .inner {
1006 display: inline-block;
1011 .collapse-toggle.hidden-default {
1017 display: table-cell;
1026 .out-of-band > span.since {
1032 .toggle-wrapper > .collapse-toggle {
1036 .variant + .toggle-wrapper + .docblock > p {
1040 .sub-variant, .sub-variant > h3 {
1041 margin-top: 0px !important;
1045 #main > details > .sub-variant > h3 {
1051 .sub-variant > div {
1053 margin-bottom: 10px;
1056 .sub-variant > div > span {
1062 display: inline-block;
1067 .docblock > .section-header:first-child {
1072 .docblock > .section-header:first-child:hover > a:before {
1076 #main > .variant, #main > .structfield {
1094 display: inline-block;
1101 padding: 5px 3px 3px 3px;
1107 .tooltip.ignore::after {
1108 content: "This example is not tested";
1110 .tooltip.compile_fail::after {
1111 content: "This example deliberately fails to compile";
1113 .tooltip.should_panic::after {
1114 content: "This example panics";
1116 .tooltip.edition::after {
1117 content: "This code runs with edition " attr(data-edition);
1127 border-style: solid;
1131 .tooltip:hover::before, .tooltip:hover::after {
1135 .tooltip.compile_fail, .tooltip.should_panic, .tooltip.ignore {
1140 .notable-traits-tooltip {
1141 display: inline-block;
1145 .notable-traits:hover .notable-traits-tooltiptext,
1146 .notable-traits .notable-traits-tooltiptext.force-tooltip {
1147 display: inline-block;
1150 .notable-traits .notable-traits-tooltiptext {
1152 padding: 5px 3px 3px 3px;
1162 .notable-traits-tooltip::after {
1163 /* The margin on the tooltip does not capture hover events,
1164 this extends the area of hover enough so that mouse hover is not
1165 lost when moving the mouse to the tooltip */
1166 content: "\00a0\00a0\00a0";
1169 .notable-traits .notable, .notable-traits .docblock {
1173 .notable-traits .docblock code.content{
1179 /* Example code has the "Run" button that needs to be positioned relative to the pre */
1180 pre.rust.rust-example-rendered {
1194 .search-failed > ul {
1212 border-top: 2px solid;
1215 #titles > button:not(:last-child) {
1217 width: calc(33.3% - 1px);
1220 #titles > button > div.count {
1221 display: inline-block;
1231 h4 > .notable-traits {
1241 margin-bottom: 10px;
1255 border-top-right-radius: 3px;
1256 border-bottom-right-radius: 3px;
1259 transition: left .5s;
1272 transition: left .5s;
1273 border-right: 1px solid;
1275 #source-sidebar > .title {
1278 border-bottom: 1px solid;
1288 .theme-picker button {
1292 #settings-menu, #help-button {
1302 #theme-picker, #settings-menu, #help-button, #copy-path {
1313 font-family: "Fira Sans", Arial, sans-serif;
1339 #theme-choices > button {
1344 background: rgba(0,0,0,0);
1347 #theme-choices > button:not(:first-child) {
1348 border-top: 1px solid;
1353 @media (min-width: 701px) {
1354 /* In case there is no documentation before a code block, we need to add some margin at the top
1355 to prevent an overlay between the "collapse toggle" and the information tooltip.
1356 However, it's not needed with smaller screen width because the doc/code block is always put
1357 "one line" below. */
1358 .docblock > .information:first-child > .tooltip {
1363 @media (max-width: 700px) {
1368 .rustdoc > .sidebar {
1378 .sidebar > .location {
1382 padding: 3px 10px 1px 10px;
1384 background: inherit;
1389 .sidebar .location:empty {
1393 .sidebar .logo-container {
1402 .sidebar .logo-container > img {
1416 border-bottom: 1px solid;
1417 border-right: 1px solid;
1421 .rustdoc.source > .sidebar > .sidebar-menu {
1432 border-right: 1px solid;
1436 .sidebar > .block.version {
1437 border-bottom: none;
1443 width: calc(100% - 32px);
1456 .content h4 > .out-of-band {
1460 .toggle-wrapper > .collapse-toggle {
1472 .content .impl-items .method, .content .impl-items > .type, .impl-items > .associatedconstant,
1473 .impl-items > .associatedtype {
1478 display: none !important;
1487 h4 > .notable-traits {
1493 #titles > button > div.count {
1506 background-color: rgba(0,0,0,0);
1510 This allows to prevent the version text to overflow the sidebar title on mobile mode when the
1511 sidebar is displayed (after clicking on the "hamburger" button).
1513 .sidebar.mobile > div.version {
1518 width: calc(100% + 30px);
1526 .show-it > .block.items {
1530 .show-it > .block.items > ul {
1534 .show-it > .block.items > ul > li {
1539 .show-it > .block.items > ul > li > a {
1543 /* Because of ios, we need to actually have a full height sidebar title so the
1544 * actual sidebar can show up. But then we need to make it transparent so we don't
1545 * hide content. The filler just allows to create the background for the sidebar
1546 * title. But because of the absolute position, I had to lower the z-index.
1551 width: calc(100% - 45px);
1555 border-bottom: 1px solid;
1562 .impl > .collapse-toggle {
1566 .item-list > details.rustdoc-toggle > summary:not(.hideme)::before {
1586 #main > .line-numbers {
1590 .notable-traits .notable-traits-tooltiptext {
1595 /* We don't display the help button on mobile devices. */
1599 .search-container > div {
1600 width: calc(100% - 32px);
1605 nav.sub, .content .out-of-band, .collapse-toggle {
1610 @media (max-width: 464px) {
1611 #titles, #titles > button {
1615 /* This is to prevent the search bar from being underneath the <section>
1616 * element following it.
1622 #main > table:not(.table-display) td {
1623 word-break: break-word;
1627 .search-container > div {
1629 width: calc(100% - 37px);
1638 #crate-search + .search-input {
1639 width: calc(100% + 71px);
1643 #theme-picker, #settings-menu {
1664 margin-bottom: 13px;
1669 display: inline-block;
1671 font: 15px monospace;
1673 vertical-align: middle;
1676 box-shadow: inset 0 -1px 0;
1680 .hidden-by-impl-hider,
1681 .hidden-by-usual-hider {
1682 /* important because of conflicting rule for small screens */
1683 display: none !important;
1686 #implementations-list > h3 > span.in-band {
1693 border-collapse: collapse;
1698 .table-display tr td:first-child {
1702 .table-display tr td:last-child {
1705 .table-display .out-of-band {
1710 #implementors-list > .impl-items .table-display .out-of-band {
1714 .table-display td:hover .anchor {
1744 div.files > a:hover, div.name:hover {
1745 background-color: #a14b4b;
1747 div.name.expand + .children {
1758 div.name.expand::before {
1759 transform: rotate(90deg);
1764 /* The hideme class is used on summary tags that contain a span with
1765 placeholder text shown only when the toggle is closed. For instance,
1766 "Expand description" or "Show methods". */
1767 details.rustdoc-toggle > summary.hideme {
1771 details.rustdoc-toggle > summary::-webkit-details-marker,
1772 details.rustdoc-toggle > summary::marker,
1773 details.undocumented > summary::-webkit-details-marker,
1774 details.undocumented > summary::marker {
1778 details.rustdoc-toggle > summary.hideme > span {
1782 details.rustdoc-toggle > summary::before {
1786 letter-spacing: 1px;
1790 details.rustdoc-toggle.top-doc > summary,
1791 details.rustdoc-toggle.top-doc > summary::before,
1792 details.rustdoc-toggle.non-exhaustive > summary,
1793 details.rustdoc-toggle.non-exhaustive > summary::before {
1794 font-family: 'Fira Sans';
1798 details.non-exhaustive {
1802 details.rustdoc-toggle > summary.hideme::before {
1806 details.rustdoc-toggle > summary:not(.hideme)::before {
1812 .impl-items > details.rustdoc-toggle > summary:not(.hideme)::before,
1813 .undocumented > details.rustdoc-toggle > summary:not(.hideme)::before {
1819 /* When a "hideme" summary is open and the "Expand description" or "Show
1820 methods" text is hidden, we want the [-] toggle that remains to not
1821 affect the layout of the items to its right. To do that, we use
1822 absolute positioning. Note that we also set position: relative
1823 on the parent <details> to make this work properly. */
1824 details.rustdoc-toggle[open] > summary.hideme {
1828 details.rustdoc-toggle, details.undocumented {
1832 details.rustdoc-toggle[open] > summary.hideme > span {
1836 details.rustdoc-toggle[open] > summary::before {
1841 details.undocumented > summary::before {
1842 content: "[+] Show hidden undocumented items";
1848 details.undocumented[open] > summary::before {
1849 content: "[-] Hide undocumented items";