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-regular.woff2") format("woff2"),
82 url("noto-sans-kr-regular.woff") format("woff");
84 unicode-range: U+AC00-D7AF, U+3130-318F, U+1100-11FF, U+A960-A97F, U+D7B0-D7FF;
88 -webkit-box-sizing: border-box;
89 -moz-box-sizing: border-box;
90 box-sizing: border-box;
93 /* This part handles the "default" theme being used depending on the system one. */
97 @media (prefers-color-scheme: light) {
102 @media (prefers-color-scheme: dark) {
108 /* General structure and fonts */
111 font: 16px/1.4 "Source Serif 4", "Noto Sans KR", serif;
114 padding: 10px 15px 20px 15px;
116 -webkit-font-feature-settings: "kern", "liga";
117 -moz-font-feature-settings: "kern", "liga";
118 font-feature-settings: "kern", "liga";
130 h1, h2, h3, h4, h5, h6 {
132 margin: 20px 0 15px 0;
137 border-bottom: 1px dashed;
140 /* workaround to keep flex from breaking below 700 px width due to the float: right on the nav
144 h1.fqn > .in-band > a:hover {
145 text-decoration: underline;
148 border-bottom: 1px solid;
150 h3.code-header, h4.code-header {
162 .impl-items .associatedconstant,
163 .methods .associatedconstant,
164 .impl-items .associatedtype,
165 .methods .associatedtype {
172 .impl, .method.trait-impl,
174 .associatedconstant.trait-impl,
175 .associatedtype.trait-impl {
179 div.impl-items > div {
183 h1, h2, h3, h4, h5, h6,
184 .sidebar, a.source, .search-input, .search-results .result-name,
185 .content table td:first-child > a,
187 div.item-list .out-of-band, span.since,
188 #source-sidebar, #sidebar-toggle,
189 details.rustdoc-toggle > summary::before,
190 details.undocumented > summary::before,
191 div.impl-items > div:not(.docblock):not(.item-info),
192 .content ul.crate a.crate, a.srclink,
193 /* This selector is for the items listed in the "all items" page. */
194 #main > ul.docblock > li > a {
195 font-family: "Fira Sans", Arial, sans-serif;
198 .content ul.crate a.crate {
205 ul ul, ol ul, ul ol, ol ol {
217 /* Fix some style changes due to normalize.css 8 */
225 border-collapse: collapse;
238 /* end tweaks for normalize.css 8 */
240 details:not(.rustdoc-toggle) summary {
244 code, pre, a.test-arrow, .code-header {
245 font-family: "Source Code Pro", monospace;
247 .docblock code, .docblock-short code {
251 .docblock pre code, .docblock-short pre code {
257 .docblock.item-decl {
264 .source .content pre {
285 text-transform: uppercase;
297 /* Improve the scrollbar display on firefox */
299 scrollbar-width: initial;
302 scrollbar-width: thin;
305 /* Improve the scrollbar display on webkit-based browsers */
306 ::-webkit-scrollbar {
309 .sidebar::-webkit-scrollbar {
312 ::-webkit-scrollbar-track {
313 -webkit-box-shadow: inset 0;
316 .sidebar .block > ul > li {
324 /* Everything else */
327 display: none !important;
339 .logo-container > img {
346 transform: translate(-50%, -50%);
353 margin: 30px 10px 20px 10px;
355 word-wrap: break-word;
356 font-weight: inherit;
363 border-bottom: 1px solid;
364 overflow-wrap: break-word;
365 word-wrap: break-word; /* deprecated */
366 word-break: break-word; /* Chrome, non-standard */
373 .location a:first-of-type {
377 text-decoration: underline;
384 .block h2, .block h3 {
387 .block ul, .block li {
395 text-overflow: ellipsis;
401 transition: border 500ms ease-out;
405 border-top: 1px solid;
406 border-bottom: 1px solid;
410 font-weight: inherit;
431 .source .content pre.rust {
437 .rustdoc .example-wrap {
438 display: inline-flex;
447 .example-wrap > pre.line-number {
452 border-top-left-radius: 5px;
453 border-bottom-left-radius: 5px;
456 .example-wrap > pre.rust a:hover {
457 text-decoration: underline;
460 .rustdoc:not(.source) .example-wrap > pre:not(.line-number) {
465 .rustdoc .example-wrap > pre {
479 .content > .example-wrap pre.line-numbers {
481 -webkit-user-select: none;
482 -moz-user-select: none;
483 -ms-user-select: none;
491 overflow-wrap: anywhere;
499 text-overflow: ellipsis;
502 /* Wrap non-pre code blocks (`text`) but not (```text```). */
503 .docblock > :not(pre) > code,
504 .docblock-short > :not(pre) > code {
505 white-space: pre-wrap;
508 .docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5, .docblock h6 {
509 border-bottom: 1px solid;
512 .top-doc .docblock h2 { font-size: 1.3em; }
513 .top-doc .docblock h3 { font-size: 1.15em; }
514 .top-doc .docblock h4,
515 .top-doc .docblock h5,
516 .top-doc .docblock h6 {
520 .docblock h5 { font-size: 1em; }
521 .docblock h6 { font-size: 0.95em; }
533 .content .out-of-band {
542 .method > .code-header, .trait-impl > .code-header, .invisible > .code-header {
543 max-width: calc(100% - 41px);
549 display: inline-block;
556 overflow-wrap: anywhere;
559 .in-band > code, .in-band > .code-header {
560 display: inline-block;
568 font-family: "Fira Sans", Arial, sans-serif;
571 .content table:not(.table-display) {
572 border-spacing: 0 5px;
574 .content td { vertical-align: top; }
575 .content td:first-child { padding-right: 20px; }
576 .content td p:first-child { margin-top: 0; }
577 .content td h1, .content td h2 { margin-left: 0; font-size: 1.1em; }
578 .content tr:first-child td { border-top: 0; }
582 width: calc(100% - 2px);
602 .content .item-list {
603 list-style-type: none;
607 .content .multi-column {
608 -moz-column-count: 5;
609 -moz-column-gap: 2.5em;
610 -webkit-column-count: 5;
611 -webkit-column-gap: 2.5em;
615 .content .multi-column li { width: 100%; display: inline-block; }
617 .content > .methods > .method {
621 /* Shift "where ..." part of method or fn definition down a line */
622 .content .method .where,
624 .content .where.fmt-newline {
629 .content .methods > div:not(.notable-traits):not(.method) {
634 .content .docblock > .impl-items {
638 .content .docblock >.impl-items .table-display {
641 .content .docblock >.impl-items table td {
644 .content .docblock > .impl-items .table-display, .impl-items table td {
648 .content .item-info code {
652 .content .item-info {
657 .sub-variant > div > .item-info {
661 .content .item-info::before {
669 .content .impl-items .method, .content .impl-items > .type, .impl-items > .associatedconstant,
670 .impl-items > .associatedtype, .content .impl-items details > summary > .type,
671 .impl-items details > summary > .associatedconstant,
672 .impl-items details > summary > .associatedtype {
676 .content .impl-items .docblock, .content .impl-items .item-info {
680 .content .impl-items > .item-info {
684 .methods > .item-info, .content .impl-items > .item-info {
697 border-bottom: 1px solid;
698 padding-bottom: 10px;
706 border-top: 1px solid;
707 border-bottom: 1px solid;
709 nav.main .separator {
711 display: inline-block;
715 nav.sum { text-align: right; }
716 nav.sub form { display: inline; }
723 text-decoration: none;
724 background: transparent;
727 .small-section-header {
729 justify-content: space-between;
733 .small-section-header:hover > .anchor {
737 .in-band:hover > .anchor, .impl:hover > .anchor, .method.trait-impl:hover > .anchor,
738 .type.trait-impl:hover > .anchor, .associatedconstant.trait-impl:hover > .anchor,
739 .associatedtype.trait-impl:hover > .anchor {
740 display: inline-block;
747 background: none !important;
752 .small-section-header > .anchor {
756 h2.small-section-header > .anchor {
763 .docblock a:not(.srclink):not(.test-arrow):hover,
764 .docblock-short a:not(.srclink):not(.test-arrow):hover, .item-info a {
765 text-decoration: underline;
768 .invisible > .srclink,
769 .method > .code-header + .srclink {
777 .block a.current.crate { font-weight: 500; }
785 .item-left, .item-right {
789 padding-right: 1.2rem;
795 .search-container > div {
796 display: inline-flex;
797 width: calc(100% - 63px);
807 border-radius: 4px 0 0 4px;
810 border-right: 1px solid;
811 -moz-appearance: none;
812 -webkit-appearance: none;
813 /* Removes default arrow from firefox */
816 background-repeat: no-repeat;
817 background-color: transparent;
818 background-size: 20px;
819 background-position: calc(100% - 1px) 56%;
821 .search-container > .top-button {
827 /* Override Normalize.css: we have margins and do
828 not want to overflow - the `moz` attribute is necessary
829 until Firefox 29, too early to drop at this point */
830 -moz-box-sizing: border-box !important;
831 box-sizing: border-box !important;
838 transition: border-color 300ms ease;
839 transition: border-radius 300ms ease-in-out;
840 transition: box-shadow 300ms ease-in-out;
844 #crate-search + .search-input {
845 border-radius: 0 1px 1px 0;
846 width: calc(100% - 32px);
849 .search-input:focus {
860 .search-results.active {
862 /* prevent overhanging tabs from moving the first result */
866 .search-results .desc > span {
868 text-overflow: ellipsis;
873 .search-results > a {
876 /* A little margin ensures the browser's outlining of focused links has room to display. */
879 border-bottom: 1px solid #aaa3;
882 .search-results > a > div {
887 .search-results .result-name, .search-results div.desc, .search-results .result-description {
890 .search-results .result-name {
894 .search-results .result-name > span {
895 display: inline-block;
900 body.blur > :not(#help) {
902 -webkit-filter: blur(8px);
913 justify-content: center;
918 box-shadow: 0 0 6px rgba(0,0,0,.2);
927 margin-right: 0.5rem;
929 #help span.top, #help span.bottom {
939 border-bottom: 1px solid;
945 border-top: 1px solid;
947 #help dd { margin: 5px 35px; }
948 #help .infos { padding-left: 0; }
949 #help h1, #help h2 { margin-top: 0; }
953 padding: 0 20px 20px 17px;;
975 /* Black one-pixel outline around emoji shapes */
987 display: inline-block;
993 vertical-align: text-bottom;
996 .module-item.unstable,
997 .import-item.unstable {
1002 font-weight: normal;
1006 .impl-items .since, .impl .since, .methods .since {
1012 .impl-items .srclink, .impl .srclink, .methods .srclink {
1013 /* Override header settings otherwise it's too bold */
1015 font-weight: normal;
1024 margin-bottom: 12px;
1025 /* Push the src link out to the right edge consistently */
1026 justify-content: space-between;
1033 .variants_table tbody tr td:first-child {
1034 width: 1%; /* make the variant name as small as possible */
1045 pre.rust .question-mark {
1050 display: inline-block;
1052 padding: 5px 10px 5px 10px;
1060 text-decoration: none;
1063 .section-header:hover a:before {
1066 padding-right: 10px; /* avoid gap that causes hover to disappear */
1067 content: '\2002\00a7\2002';
1070 .section-header:hover a {
1071 text-decoration: none;
1091 .out-of-band > span.since {
1097 .sub-variant, .sub-variant > h3 {
1098 margin-top: 0px !important;
1102 #main .sub-variant > h3 {
1108 .sub-variant > div {
1110 margin-bottom: 10px;
1113 .sub-variant > div > span {
1119 display: inline-block;
1124 .docblock > .section-header:first-child {
1129 .docblock > .section-header:first-child:hover > a:before {
1133 :target > code, :target > .code-header {
1150 display: inline-block;
1157 padding: 5px 3px 3px 3px;
1163 .tooltip.ignore::after {
1164 content: "This example is not tested";
1166 .tooltip.compile_fail::after {
1167 content: "This example deliberately fails to compile";
1169 .tooltip.should_panic::after {
1170 content: "This example panics";
1172 .tooltip.edition::after {
1173 content: "This code runs with edition " attr(data-edition);
1183 border-style: solid;
1187 .tooltip:hover::before, .tooltip:hover::after {
1191 .tooltip.compile_fail, .tooltip.should_panic, .tooltip.ignore {
1196 .notable-traits-tooltip {
1197 display: inline-block;
1201 .notable-traits:hover .notable-traits-tooltiptext,
1202 .notable-traits .notable-traits-tooltiptext.force-tooltip {
1203 display: inline-block;
1206 .notable-traits .notable-traits-tooltiptext {
1208 padding: 5px 3px 3px 3px;
1218 .notable-traits-tooltip::after {
1219 /* The margin on the tooltip does not capture hover events,
1220 this extends the area of hover enough so that mouse hover is not
1221 lost when moving the mouse to the tooltip */
1222 content: "\00a0\00a0\00a0";
1225 .notable-traits .notable, .notable-traits .docblock {
1229 .notable-traits .notable {
1231 margin-bottom: 13px;
1236 .notable-traits .docblock code.content{
1242 /* Example code has the "Run" button that needs to be positioned relative to the pre */
1243 pre.rust.rust-example-rendered {
1258 .search-failed.active {
1262 .search-failed > ul {
1280 border-top: 2px solid;
1283 #titles > button:not(:last-child) {
1285 width: calc(33.3% - 1px);
1288 #titles > button > div.count {
1289 display: inline-block;
1303 margin-bottom: 10px;
1317 border-top-right-radius: 3px;
1318 border-bottom-right-radius: 3px;
1321 transition: left .5s;
1334 transition: left .5s;
1335 border-right: 1px solid;
1337 #source-sidebar > .title {
1340 border-bottom: 1px solid;
1350 .theme-picker button {
1354 #settings-menu, #help-button {
1364 #theme-picker, #settings-menu, #help-button, #copy-path {
1375 font-family: "Fira Sans", Arial, sans-serif;
1382 background: initial;
1400 #theme-choices > button {
1405 background: rgba(0,0,0,0);
1408 #theme-choices > button:not(:first-child) {
1409 border-top: 1px solid;
1413 display: inline-block;
1415 font: 15px monospace;
1417 vertical-align: middle;
1420 box-shadow: inset 0 -1px 0;
1424 .hidden-by-impl-hider,
1425 .hidden-by-usual-hider {
1426 /* important because of conflicting rule for small screens */
1427 display: none !important;
1430 #implementations-list > h3 > span.in-band {
1437 border-collapse: collapse;
1442 .table-display tr td:first-child {
1446 .table-display tr td:last-child {
1449 .table-display .out-of-band {
1454 #implementors-list > .impl-items .table-display .out-of-band {
1458 .table-display td:hover .anchor {
1488 div.files > a:hover, div.name:hover {
1489 background-color: #a14b4b;
1491 div.name.expand + .children {
1502 div.name.expand::before {
1503 transform: rotate(90deg);
1508 /* The hideme class is used on summary tags that contain a span with
1509 placeholder text shown only when the toggle is closed. For instance,
1510 "Expand description" or "Show methods". */
1511 details.rustdoc-toggle > summary.hideme {
1515 details.rustdoc-toggle > summary, details.undocumented > summary {
1518 details.rustdoc-toggle > summary::-webkit-details-marker,
1519 details.rustdoc-toggle > summary::marker,
1520 details.undocumented > summary::-webkit-details-marker,
1521 details.undocumented > summary::marker {
1525 details.rustdoc-toggle > summary.hideme > span {
1529 details.rustdoc-toggle > summary::before {
1533 height: max(17px, 1.1em);
1534 background-repeat: no-repeat;
1535 background-position: top left;
1536 display: inline-block;
1537 vertical-align: middle;
1541 /* Screen readers see the text version at the end the line.
1542 Visual readers see the icon at the start of the line, but small and transparent. */
1543 details.rustdoc-toggle > summary::after {
1551 details.rustdoc-toggle > summary.hideme::after {
1552 /* "hideme" toggles already have a description when they're contracted */
1556 details.rustdoc-toggle > summary:focus::before,
1557 details.rustdoc-toggle > summary:hover::before {
1561 details.rustdoc-toggle.top-doc > summary,
1562 details.rustdoc-toggle.top-doc > summary::before,
1563 details.rustdoc-toggle.non-exhaustive > summary,
1564 details.rustdoc-toggle.non-exhaustive > summary::before {
1565 font-family: 'Fira Sans';
1569 details.non-exhaustive {
1573 details.rustdoc-toggle > summary.hideme::before {
1577 details.rustdoc-toggle > summary:not(.hideme)::before {
1583 .impl-items > details.rustdoc-toggle > summary:not(.hideme)::before,
1584 .undocumented > details.rustdoc-toggle > summary:not(.hideme)::before {
1589 /* When a "hideme" summary is open and the "Expand description" or "Show
1590 methods" text is hidden, we want the [-] toggle that remains to not
1591 affect the layout of the items to its right. To do that, we use
1592 absolute positioning. Note that we also set position: relative
1593 on the parent <details> to make this work properly. */
1594 details.rustdoc-toggle[open] > summary.hideme {
1598 details.rustdoc-toggle, details.undocumented {
1602 details.rustdoc-toggle[open] > summary.hideme > span {
1606 details.rustdoc-toggle[open] > summary::before,
1607 details.rustdoc-toggle[open] > summary.hideme::before {
1609 height: max(17px, 1.1em);
1610 background-repeat: no-repeat;
1611 background-position: top left;
1612 display: inline-block;
1616 details.rustdoc-toggle[open] > summary::after,
1617 details.rustdoc-toggle[open] > summary.hideme::after {
1618 content: "Collapse";
1621 details.undocumented > summary::before {
1623 height: max(17px, 1.1em);
1624 background-repeat: no-repeat;
1625 background-position: top left;
1626 content: "Show hidden undocumented items";
1633 details.undocumented > summary:focus::before,
1634 details.undocumented > summary:hover::before {
1638 details.undocumented[open] > summary::before {
1640 height: max(17px, 1.1em);
1641 background-repeat: no-repeat
1642 background-position: top left;
1643 content: "Hide undocumented items";
1648 @media (min-width: 701px) {
1649 /* In case there is no documentation before a code block, we need to add some margin at the top
1650 to prevent an overlay between the "collapse toggle" and the information tooltip.
1651 However, it's not needed with smaller screen width because the doc/code block is always put
1652 "one line" below. */
1653 .docblock > .information:first-child > .tooltip {
1658 @media (max-width: 700px) {
1663 .rustdoc > .sidebar {
1673 .sidebar > .location {
1677 padding: 3px 10px 1px 10px;
1679 background: inherit;
1684 .sidebar .location:empty {
1688 .sidebar .logo-container {
1697 .sidebar .logo-container > img {
1711 border-bottom: 1px solid;
1712 border-right: 1px solid;
1716 .rustdoc.source > .sidebar > .sidebar-menu {
1720 /* We do NOT hide this element so that alternative device readers still have this information
1728 /* We move the sidebar to the left by its own width so it doesn't appear. */
1731 border-right: 1px solid;
1734 .sidebar > .block.version {
1736 border-bottom: none;
1741 .sidebar > .block.version > div.narrow-helper {
1746 .sidebar > .block.version > p {
1747 /* hide Version text if too narrow */
1750 /* vertically center */
1752 align-items: center;
1757 width: calc(100% - 32px);
1775 display: none !important;
1790 #titles > button > div.count {
1803 background-color: rgba(0,0,0,0);
1807 This allows to prevent the version text to overflow the sidebar title on mobile mode when the
1808 sidebar is displayed (after clicking on the "hamburger" button).
1810 .sidebar.mobile > div.version {
1815 width: calc(100% + 30px);
1818 .show-it, .sidebar-elems:focus-within {
1823 .show-it > .block.items {
1827 .show-it > .block.items > ul {
1831 .show-it > .block.items > ul > li {
1836 .show-it > .block.items > ul > li > a {
1840 /* Because of ios, we need to actually have a full height sidebar title so the
1841 * actual sidebar can show up. But then we need to make it transparent so we don't
1842 * hide content. The filler just allows to create the background for the sidebar
1843 * title. But because of the absolute position, I had to lower the z-index.
1848 width: calc(100% - 45px);
1852 border-bottom: 1px solid;
1855 #main > details.rustdoc-toggle > summary::before,
1856 #main > div > details.rustdoc-toggle > summary::before {
1876 #main > .line-numbers {
1880 .notable-traits .notable-traits-tooltiptext {
1885 /* We don't display the help button on mobile devices. */
1890 /* Display an alternating layout on tablets and phones */
1896 flex-flow: column wrap;
1898 .item-left, .item-right {
1902 .search-container > div {
1903 width: calc(100% - 32px);
1906 /* Display an alternating layout on tablets and phones */
1907 .search-results > a {
1908 border-bottom: 1px solid #aaa9;
1911 .search-results .result-name, .search-results div.desc, .search-results .result-description {
1914 .search-results div.desc, .search-results .result-description, .item-right {
1920 nav.sub, .content .out-of-band {
1925 @media (max-width: 464px) {
1926 #titles, #titles > button {
1930 /* This is to prevent the search bar from being underneath the <section>
1931 * element following it.
1937 #main > table:not(.table-display) td {
1938 word-break: break-word;
1942 .search-container > div {
1944 width: calc(100% - 37px);
1953 #crate-search + .search-input {
1954 width: calc(100% + 71px);
1958 #theme-picker, #settings-menu {
1977 overflow-wrap: anywhere;