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'),
27 url("SourceSerif4-Regular.ttf.woff2") format("woff2"),
28 url("SourceSerif4-Regular.ttf.woff") format("woff");
32 font-family: 'Source Serif 4';
35 src: local('Source Serif 4 Italic'),
36 url("SourceSerif4-It.ttf.woff2") format("woff2"),
37 url("SourceSerif4-It.ttf.woff") format("woff");
41 font-family: 'Source Serif 4';
44 src: local('Source Serif 4 Bold'),
45 url("SourceSerif4-Bold.ttf.woff2") format("woff2"),
46 url("SourceSerif4-Bold.ttf.woff") format("woff");
50 /* See SourceCodePro-LICENSE.txt for the Source Code Pro license. */
52 font-family: 'Source Code Pro';
55 /* Avoid using locally installed font because bad versions are in circulation:
56 * see https://github.com/rust-lang/rust/issues/24355 */
57 src: url("SourceCodePro-Regular.ttf.woff2") format("woff2"),
58 url("SourceCodePro-Regular.ttf.woff") format("woff");
62 font-family: 'Source Code Pro';
65 src: url("SourceCodePro-It.ttf.woff2") format("woff2"),
66 url("SourceCodePro-It.ttf.woff") format("woff");
70 font-family: 'Source Code Pro';
73 src: url("SourceCodePro-Semibold.ttf.woff2") format("woff2"),
74 url("SourceCodePro-Semibold.ttf.woff") format("woff");
78 /* Avoid using legacy CJK serif fonts in Windows like Batang */
80 font-family: 'Noto Sans KR';
81 src: url("noto-sans-kr-v13-korean-regular.woff") format("woff");
83 unicode-range: U+A960-A97F, U+AC00-D7AF, U+D7B0-D7FF;
87 -webkit-box-sizing: border-box;
88 -moz-box-sizing: border-box;
89 box-sizing: border-box;
92 /* This part handles the "default" theme being used depending on the system one. */
96 @media (prefers-color-scheme: light) {
101 @media (prefers-color-scheme: dark) {
107 /* General structure and fonts */
110 font: 16px/1.4 "Source Serif 4", "Noto Sans KR", serif;
113 padding: 10px 15px 20px 15px;
115 -webkit-font-feature-settings: "kern", "liga";
116 -moz-font-feature-settings: "kern", "liga";
117 font-feature-settings: "kern", "liga";
129 h1, h2, h3, h4, h5, h6 {
131 margin: 20px 0 15px 0;
136 border-bottom: 1px dashed;
139 /* workaround to keep flex from breaking below 700 px width due to the float: right on the nav
143 h1.fqn > .in-band > a:hover {
144 text-decoration: underline;
147 border-bottom: 1px solid;
149 h3.code-header, h4.code-header {
161 .impl-items .associatedconstant,
162 .methods .associatedconstant,
163 .impl-items .associatedtype,
164 .methods .associatedtype {
171 .impl, .method.trait-impl,
173 .associatedconstant.trait-impl,
174 .associatedtype.trait-impl {
178 div.impl-items > div {
182 h1, h2, h3, h4, h5, h6,
183 .sidebar, a.source, .search-input, .search-results .result-name,
184 .content table td:first-child > a,
186 div.item-list .out-of-band, span.since,
187 #source-sidebar, #sidebar-toggle,
188 details.rustdoc-toggle > summary::before,
189 details.undocumented > summary::before,
190 div.impl-items > div:not(.docblock):not(.item-info),
191 .content ul.crate a.crate, a.srclink,
192 /* This selector is for the items listed in the "all items" page. */
193 #main > ul.docblock > li > a {
194 font-family: "Fira Sans", Arial, sans-serif;
197 .content ul.crate a.crate {
204 ul ul, ol ul, ul ol, ol ol {
216 /* Fix some style changes due to normalize.css 8 */
224 border-collapse: collapse;
237 /* end tweaks for normalize.css 8 */
239 details:not(.rustdoc-toggle) summary {
243 code, pre, a.test-arrow, .code-header {
244 font-family: "Source Code Pro", monospace;
246 .docblock code, .docblock-short code {
250 .docblock pre code, .docblock-short pre code {
260 .source .content pre {
281 text-transform: uppercase;
293 /* Improve the scrollbar display on firefox */
295 scrollbar-width: initial;
298 scrollbar-width: thin;
301 /* Improve the scrollbar display on webkit-based browsers */
302 ::-webkit-scrollbar {
305 .sidebar::-webkit-scrollbar {
308 ::-webkit-scrollbar-track {
309 -webkit-box-shadow: inset 0;
312 .sidebar .block > ul > li {
320 /* Everything else */
323 display: none !important;
335 .logo-container > img {
342 transform: translate(-50%, -50%);
349 margin: 30px 10px 20px 10px;
351 word-wrap: break-word;
352 font-weight: inherit;
359 border-bottom: 1px solid;
360 overflow-wrap: break-word;
361 word-wrap: break-word; /* deprecated */
362 word-break: break-word; /* Chrome, non-standard */
369 .location a:first-of-type {
373 text-decoration: underline;
380 .block h2, .block h3 {
383 .block ul, .block li {
391 text-overflow: ellipsis;
397 transition: border 500ms ease-out;
401 border-top: 1px solid;
402 border-bottom: 1px solid;
406 font-weight: inherit;
427 .source .content pre.rust {
433 .rustdoc .example-wrap {
434 display: inline-flex;
443 .example-wrap > pre.line-number {
448 border-top-left-radius: 5px;
449 border-bottom-left-radius: 5px;
452 .example-wrap > pre.rust a:hover {
453 text-decoration: underline;
456 .rustdoc:not(.source) .example-wrap > pre:not(.line-number) {
461 .rustdoc .example-wrap > pre {
475 .content > .example-wrap pre.line-numbers {
477 -webkit-user-select: none;
478 -moz-user-select: none;
479 -ms-user-select: none;
487 overflow-wrap: anywhere;
495 text-overflow: ellipsis;
498 /* Wrap non-pre code blocks (`text`) but not (```text```). */
499 .docblock > :not(pre) > code,
500 .docblock-short > :not(pre) > code {
501 white-space: pre-wrap;
504 .docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5, .docblock h6 {
505 border-bottom: 1px solid;
508 .top-doc .docblock h2 { font-size: 1.3em; }
509 .top-doc .docblock h3 { font-size: 1.15em; }
510 .top-doc .docblock h4,
511 .top-doc .docblock h5,
512 .top-doc .docblock h6 {
516 .docblock h5 { font-size: 1em; }
517 .docblock h6 { font-size: 0.95em; }
529 .content .out-of-band {
538 .method > .code-header, .trait-impl > .code-header, .invisible > .code-header {
539 max-width: calc(100% - 41px);
545 display: inline-block;
554 .in-band > code, .in-band > .code-header {
555 display: inline-block;
563 font-family: "Fira Sans", Arial, sans-serif;
566 .content table:not(.table-display) {
567 border-spacing: 0 5px;
569 .content td { vertical-align: top; }
570 .content td:first-child { padding-right: 20px; }
571 .content td p:first-child { margin-top: 0; }
572 .content td h1, .content td h2 { margin-left: 0; font-size: 1.1em; }
573 .content tr:first-child td { border-top: 0; }
577 width: calc(100% - 2px);
597 .content .item-list {
598 list-style-type: none;
602 .content .multi-column {
603 -moz-column-count: 5;
604 -moz-column-gap: 2.5em;
605 -webkit-column-count: 5;
606 -webkit-column-gap: 2.5em;
610 .content .multi-column li { width: 100%; display: inline-block; }
612 .content > .methods > .method {
616 /* Shift "where ..." part of method or fn definition down a line */
617 .content .method .where,
619 .content .where.fmt-newline {
624 .content .methods > div:not(.notable-traits):not(.method) {
629 .content .docblock > .impl-items {
633 .content .docblock >.impl-items .table-display {
636 .content .docblock >.impl-items table td {
639 .content .docblock > .impl-items .table-display, .impl-items table td {
643 .content .item-info code {
647 .content .item-info {
652 .sub-variant > div > .item-info {
656 .content .item-info::before {
664 .content .impl-items .method, .content .impl-items > .type, .impl-items > .associatedconstant,
665 .impl-items > .associatedtype, .content .impl-items details > summary > .type,
666 .impl-items details > summary > .associatedconstant,
667 .impl-items details > summary > .associatedtype {
671 .content .impl-items .docblock, .content .impl-items .item-info {
675 .content .impl-items > .item-info {
679 .methods > .item-info, .content .impl-items > .item-info {
692 border-bottom: 1px solid;
693 padding-bottom: 10px;
701 border-top: 1px solid;
702 border-bottom: 1px solid;
704 nav.main .separator {
706 display: inline-block;
710 nav.sum { text-align: right; }
711 nav.sub form { display: inline; }
718 text-decoration: none;
719 background: transparent;
722 .small-section-header {
724 justify-content: space-between;
728 .small-section-header:hover > .anchor {
732 .in-band:hover > .anchor, .impl:hover > .anchor, .method.trait-impl:hover > .anchor,
733 .type.trait-impl:hover > .anchor, .associatedconstant.trait-impl:hover > .anchor,
734 .associatedtype.trait-impl:hover > .anchor {
735 display: inline-block;
742 background: none !important;
747 .small-section-header > .anchor {
751 h2.small-section-header > .anchor {
758 .docblock a:not(.srclink):not(.test-arrow):hover,
759 .docblock-short a:not(.srclink):not(.test-arrow):hover, .item-info a {
760 text-decoration: underline;
763 .invisible > .srclink,
764 .method > .code-header + .srclink {
772 .block a.current.crate { font-weight: 500; }
780 .item-left, .item-right {
784 padding-right: 1.2rem;
790 .search-container > div {
791 display: inline-flex;
792 width: calc(100% - 63px);
802 border-radius: 4px 0 0 4px;
805 border-right: 1px solid;
806 -moz-appearance: none;
807 -webkit-appearance: none;
808 /* Removes default arrow from firefox */
811 background-repeat: no-repeat;
812 background-color: transparent;
813 background-size: 20px;
814 background-position: calc(100% - 1px) 56%;
816 .search-container > .top-button {
822 /* Override Normalize.css: we have margins and do
823 not want to overflow - the `moz` attribute is necessary
824 until Firefox 29, too early to drop at this point */
825 -moz-box-sizing: border-box !important;
826 box-sizing: border-box !important;
833 transition: border-color 300ms ease;
834 transition: border-radius 300ms ease-in-out;
835 transition: box-shadow 300ms ease-in-out;
839 #crate-search + .search-input {
840 border-radius: 0 1px 1px 0;
841 width: calc(100% - 32px);
844 .search-input:focus {
855 .search-results.active {
857 /* prevent overhanging tabs from moving the first result */
861 .search-results .desc > span {
863 text-overflow: ellipsis;
868 .search-results > a {
871 /* A little margin ensures the browser's outlining of focused links has room to display. */
874 border-bottom: 1px solid #aaa3;
877 .search-results > a > div {
882 .search-results .result-name, .search-results div.desc, .search-results .result-description {
885 .search-results .result-name {
889 .search-results .result-name > span {
890 display: inline-block;
895 body.blur > :not(#help) {
897 -webkit-filter: blur(8px);
908 justify-content: center;
913 box-shadow: 0 0 6px rgba(0,0,0,.2);
922 margin-right: 0.5rem;
924 #help span.top, #help span.bottom {
934 border-bottom: 1px solid;
940 border-top: 1px solid;
942 #help dd { margin: 5px 35px; }
943 #help .infos { padding-left: 0; }
944 #help h1, #help h2 { margin-top: 0; }
948 padding: 0 20px 20px 17px;;
970 /* Black one-pixel outline around emoji shapes */
982 display: inline-block;
988 vertical-align: text-bottom;
991 .module-item.unstable,
992 .import-item.unstable {
1001 .impl-items .since, .impl .since, .methods .since {
1007 .impl-items .srclink, .impl .srclink, .methods .srclink {
1008 /* Override header settings otherwise it's too bold */
1010 font-weight: normal;
1019 margin-bottom: 12px;
1020 /* Push the src link out to the right edge consistently */
1021 justify-content: space-between;
1028 .variants_table tbody tr td:first-child {
1029 width: 1%; /* make the variant name as small as possible */
1040 pre.rust .question-mark {
1045 display: inline-block;
1047 padding: 5px 10px 5px 10px;
1055 text-decoration: none;
1058 .section-header:hover a:before {
1061 padding-right: 10px; /* avoid gap that causes hover to disappear */
1062 content: '\2002\00a7\2002';
1065 .section-header:hover a {
1066 text-decoration: none;
1086 .out-of-band > span.since {
1092 .sub-variant, .sub-variant > h3 {
1093 margin-top: 0px !important;
1097 #main .sub-variant > h3 {
1103 .sub-variant > div {
1105 margin-bottom: 10px;
1108 .sub-variant > div > span {
1114 display: inline-block;
1119 .docblock > .section-header:first-child {
1124 .docblock > .section-header:first-child:hover > a:before {
1128 :target > code, :target > .code-header {
1145 display: inline-block;
1152 padding: 5px 3px 3px 3px;
1158 .tooltip.ignore::after {
1159 content: "This example is not tested";
1161 .tooltip.compile_fail::after {
1162 content: "This example deliberately fails to compile";
1164 .tooltip.should_panic::after {
1165 content: "This example panics";
1167 .tooltip.edition::after {
1168 content: "This code runs with edition " attr(data-edition);
1178 border-style: solid;
1182 .tooltip:hover::before, .tooltip:hover::after {
1186 .tooltip.compile_fail, .tooltip.should_panic, .tooltip.ignore {
1191 .notable-traits-tooltip {
1192 display: inline-block;
1196 .notable-traits:hover .notable-traits-tooltiptext,
1197 .notable-traits .notable-traits-tooltiptext.force-tooltip {
1198 display: inline-block;
1201 .notable-traits .notable-traits-tooltiptext {
1203 padding: 5px 3px 3px 3px;
1213 .notable-traits-tooltip::after {
1214 /* The margin on the tooltip does not capture hover events,
1215 this extends the area of hover enough so that mouse hover is not
1216 lost when moving the mouse to the tooltip */
1217 content: "\00a0\00a0\00a0";
1220 .notable-traits .notable, .notable-traits .docblock {
1224 .notable-traits .notable {
1226 margin-bottom: 13px;
1231 .notable-traits .docblock code.content{
1237 /* Example code has the "Run" button that needs to be positioned relative to the pre */
1238 pre.rust.rust-example-rendered {
1253 .search-failed.active {
1257 .search-failed > ul {
1275 border-top: 2px solid;
1278 #titles > button:not(:last-child) {
1280 width: calc(33.3% - 1px);
1283 #titles > button > div.count {
1284 display: inline-block;
1298 margin-bottom: 10px;
1312 border-top-right-radius: 3px;
1313 border-bottom-right-radius: 3px;
1316 transition: left .5s;
1329 transition: left .5s;
1330 border-right: 1px solid;
1332 #source-sidebar > .title {
1335 border-bottom: 1px solid;
1345 .theme-picker button {
1349 #settings-menu, #help-button {
1359 #theme-picker, #settings-menu, #help-button, #copy-path {
1370 font-family: "Fira Sans", Arial, sans-serif;
1377 background: initial;
1395 #theme-choices > button {
1400 background: rgba(0,0,0,0);
1403 #theme-choices > button:not(:first-child) {
1404 border-top: 1px solid;
1408 display: inline-block;
1410 font: 15px monospace;
1412 vertical-align: middle;
1415 box-shadow: inset 0 -1px 0;
1419 .hidden-by-impl-hider,
1420 .hidden-by-usual-hider {
1421 /* important because of conflicting rule for small screens */
1422 display: none !important;
1425 #implementations-list > h3 > span.in-band {
1432 border-collapse: collapse;
1437 .table-display tr td:first-child {
1441 .table-display tr td:last-child {
1444 .table-display .out-of-band {
1449 #implementors-list > .impl-items .table-display .out-of-band {
1453 .table-display td:hover .anchor {
1483 div.files > a:hover, div.name:hover {
1484 background-color: #a14b4b;
1486 div.name.expand + .children {
1497 div.name.expand::before {
1498 transform: rotate(90deg);
1503 /* The hideme class is used on summary tags that contain a span with
1504 placeholder text shown only when the toggle is closed. For instance,
1505 "Expand description" or "Show methods". */
1506 details.rustdoc-toggle > summary.hideme {
1510 details.rustdoc-toggle > summary, details.undocumented > summary {
1513 details.rustdoc-toggle > summary::-webkit-details-marker,
1514 details.rustdoc-toggle > summary::marker,
1515 details.undocumented > summary::-webkit-details-marker,
1516 details.undocumented > summary::marker {
1520 details.rustdoc-toggle > summary.hideme > span {
1524 details.rustdoc-toggle > summary::before {
1528 height: max(17px, 1.1em);
1529 background-repeat: no-repeat;
1530 background-position: top left;
1531 display: inline-block;
1532 vertical-align: middle;
1536 /* Screen readers see the text version at the end the line.
1537 Visual readers see the icon at the start of the line, but small and transparent. */
1538 details.rustdoc-toggle > summary::after {
1546 details.rustdoc-toggle > summary.hideme::after {
1547 /* "hideme" toggles already have a description when they're contracted */
1551 details.rustdoc-toggle > summary:focus::before,
1552 details.rustdoc-toggle > summary:hover::before {
1556 details.rustdoc-toggle.top-doc > summary,
1557 details.rustdoc-toggle.top-doc > summary::before,
1558 details.rustdoc-toggle.non-exhaustive > summary,
1559 details.rustdoc-toggle.non-exhaustive > summary::before {
1560 font-family: 'Fira Sans';
1564 details.non-exhaustive {
1568 details.rustdoc-toggle > summary.hideme::before {
1572 details.rustdoc-toggle > summary:not(.hideme)::before {
1578 .impl-items > details.rustdoc-toggle > summary:not(.hideme)::before,
1579 .undocumented > details.rustdoc-toggle > summary:not(.hideme)::before {
1584 /* When a "hideme" summary is open and the "Expand description" or "Show
1585 methods" text is hidden, we want the [-] toggle that remains to not
1586 affect the layout of the items to its right. To do that, we use
1587 absolute positioning. Note that we also set position: relative
1588 on the parent <details> to make this work properly. */
1589 details.rustdoc-toggle[open] > summary.hideme {
1593 details.rustdoc-toggle, details.undocumented {
1597 details.rustdoc-toggle[open] > summary.hideme > span {
1601 details.rustdoc-toggle[open] > summary::before,
1602 details.rustdoc-toggle[open] > summary.hideme::before {
1604 height: max(17px, 1.1em);
1605 background-repeat: no-repeat;
1606 background-position: top left;
1607 display: inline-block;
1611 details.rustdoc-toggle[open] > summary::after,
1612 details.rustdoc-toggle[open] > summary.hideme::after {
1613 content: "Collapse";
1616 details.undocumented > summary::before {
1618 height: max(17px, 1.1em);
1619 background-repeat: no-repeat;
1620 background-position: top left;
1621 content: "Show hidden undocumented items";
1628 details.undocumented > summary:focus::before,
1629 details.undocumented > summary:hover::before {
1633 details.undocumented[open] > summary::before {
1635 height: max(17px, 1.1em);
1636 background-repeat: no-repeat
1637 background-position: top left;
1638 content: "Hide undocumented items";
1643 @media (min-width: 701px) {
1644 /* In case there is no documentation before a code block, we need to add some margin at the top
1645 to prevent an overlay between the "collapse toggle" and the information tooltip.
1646 However, it's not needed with smaller screen width because the doc/code block is always put
1647 "one line" below. */
1648 .docblock > .information:first-child > .tooltip {
1653 @media (max-width: 700px) {
1658 .rustdoc > .sidebar {
1668 .sidebar > .location {
1672 padding: 3px 10px 1px 10px;
1674 background: inherit;
1679 .sidebar .location:empty {
1683 .sidebar .logo-container {
1692 .sidebar .logo-container > img {
1706 border-bottom: 1px solid;
1707 border-right: 1px solid;
1711 .rustdoc.source > .sidebar > .sidebar-menu {
1715 /* We do NOT hide this element so that alternative device readers still have this information
1723 /* We move the sidebar to the left by its own width so it doesn't appear. */
1726 border-right: 1px solid;
1729 .sidebar > .block.version {
1731 border-bottom: none;
1736 .sidebar > .block.version > div.narrow-helper {
1741 .sidebar > .block.version > p {
1742 /* hide Version text if too narrow */
1745 /* vertically center */
1747 align-items: center;
1752 width: calc(100% - 32px);
1770 display: none !important;
1785 #titles > button > div.count {
1798 background-color: rgba(0,0,0,0);
1802 This allows to prevent the version text to overflow the sidebar title on mobile mode when the
1803 sidebar is displayed (after clicking on the "hamburger" button).
1805 .sidebar.mobile > div.version {
1810 width: calc(100% + 30px);
1813 .show-it, .sidebar-elems:focus-within {
1818 .show-it > .block.items {
1822 .show-it > .block.items > ul {
1826 .show-it > .block.items > ul > li {
1831 .show-it > .block.items > ul > li > a {
1835 /* Because of ios, we need to actually have a full height sidebar title so the
1836 * actual sidebar can show up. But then we need to make it transparent so we don't
1837 * hide content. The filler just allows to create the background for the sidebar
1838 * title. But because of the absolute position, I had to lower the z-index.
1843 width: calc(100% - 45px);
1847 border-bottom: 1px solid;
1850 #main > details.rustdoc-toggle > summary::before,
1851 #main > div > details.rustdoc-toggle > summary::before {
1871 #main > .line-numbers {
1875 .notable-traits .notable-traits-tooltiptext {
1880 /* We don't display the help button on mobile devices. */
1885 /* Display an alternating layout on tablets and phones */
1891 flex-flow: column wrap;
1893 .item-left, .item-right {
1897 .search-container > div {
1898 width: calc(100% - 32px);
1901 /* Display an alternating layout on tablets and phones */
1902 .search-results > a {
1903 border-bottom: 1px solid #aaa9;
1906 .search-results .result-name, .search-results div.desc, .search-results .result-description {
1909 .search-results div.desc, .search-results .result-description, .item-right {
1915 nav.sub, .content .out-of-band {
1920 @media (max-width: 464px) {
1921 #titles, #titles > button {
1925 /* This is to prevent the search bar from being underneath the <section>
1926 * element following it.
1932 #main > table:not(.table-display) td {
1933 word-break: break-word;
1937 .search-container > div {
1939 width: calc(100% - 37px);
1948 #crate-search + .search-input {
1949 width: calc(100% + 71px);
1953 #theme-picker, #settings-menu {
1972 overflow-wrap: anywhere;