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; }
776 /* align content left */
777 justify-items: start;
782 .item-left, .item-right {
786 padding-right: 1.2rem;
792 .search-container > div {
793 display: inline-flex;
794 width: calc(100% - 63px);
804 border-radius: 4px 0 0 4px;
807 border-right: 1px solid;
808 -moz-appearance: none;
809 -webkit-appearance: none;
810 /* Removes default arrow from firefox */
813 background-repeat: no-repeat;
814 background-color: transparent;
815 background-size: 20px;
816 background-position: calc(100% - 1px) 56%;
818 .search-container > .top-button {
824 /* Override Normalize.css: we have margins and do
825 not want to overflow - the `moz` attribute is necessary
826 until Firefox 29, too early to drop at this point */
827 -moz-box-sizing: border-box !important;
828 box-sizing: border-box !important;
835 transition: border-color 300ms ease;
836 transition: border-radius 300ms ease-in-out;
837 transition: box-shadow 300ms ease-in-out;
841 #crate-search + .search-input {
842 border-radius: 0 1px 1px 0;
843 width: calc(100% - 32px);
846 .search-input:focus {
857 .search-results.active {
859 /* prevent overhanging tabs from moving the first result */
863 .search-results .desc > span {
865 text-overflow: ellipsis;
870 .search-results > a {
873 /* A little margin ensures the browser's outlining of focused links has room to display. */
876 border-bottom: 1px solid #aaa3;
879 .search-results > a > div {
884 .search-results .result-name, .search-results div.desc, .search-results .result-description {
887 .search-results .result-name {
891 .search-results .result-name > span {
892 display: inline-block;
897 body.blur > :not(#help) {
899 -webkit-filter: blur(8px);
910 justify-content: center;
915 box-shadow: 0 0 6px rgba(0,0,0,.2);
924 margin-right: 0.5rem;
926 #help span.top, #help span.bottom {
936 border-bottom: 1px solid;
942 border-top: 1px solid;
944 #help dd { margin: 5px 35px; }
945 #help .infos { padding-left: 0; }
946 #help h1, #help h2 { margin-top: 0; }
950 padding: 0 20px 20px 17px;;
972 /* Black one-pixel outline around emoji shapes */
984 display: inline-block;
990 vertical-align: text-bottom;
993 .module-item.unstable,
994 .import-item.unstable {
1003 .impl-items .since, .impl .since, .methods .since {
1009 .impl-items .srclink, .impl .srclink, .methods .srclink {
1010 /* Override header settings otherwise it's too bold */
1012 font-weight: normal;
1021 margin-bottom: 12px;
1022 /* Push the src link out to the right edge consistently */
1023 justify-content: space-between;
1030 .variants_table tbody tr td:first-child {
1031 width: 1%; /* make the variant name as small as possible */
1042 pre.rust .question-mark {
1047 display: inline-block;
1049 padding: 5px 10px 5px 10px;
1057 text-decoration: none;
1060 .section-header:hover a:before {
1063 padding-right: 10px; /* avoid gap that causes hover to disappear */
1064 content: '\2002\00a7\2002';
1067 .section-header:hover a {
1068 text-decoration: none;
1088 .out-of-band > span.since {
1094 .sub-variant, .sub-variant > h3 {
1095 margin-top: 0px !important;
1099 #main .sub-variant > h3 {
1105 .sub-variant > div {
1107 margin-bottom: 10px;
1110 .sub-variant > div > span {
1116 display: inline-block;
1121 .docblock > .section-header:first-child {
1126 .docblock > .section-header:first-child:hover > a:before {
1130 :target > code, :target > .code-header {
1147 display: inline-block;
1154 padding: 5px 3px 3px 3px;
1160 .tooltip.ignore::after {
1161 content: "This example is not tested";
1163 .tooltip.compile_fail::after {
1164 content: "This example deliberately fails to compile";
1166 .tooltip.should_panic::after {
1167 content: "This example panics";
1169 .tooltip.edition::after {
1170 content: "This code runs with edition " attr(data-edition);
1180 border-style: solid;
1184 .tooltip:hover::before, .tooltip:hover::after {
1188 .tooltip.compile_fail, .tooltip.should_panic, .tooltip.ignore {
1193 .notable-traits-tooltip {
1194 display: inline-block;
1198 .notable-traits:hover .notable-traits-tooltiptext,
1199 .notable-traits .notable-traits-tooltiptext.force-tooltip {
1200 display: inline-block;
1203 .notable-traits .notable-traits-tooltiptext {
1205 padding: 5px 3px 3px 3px;
1215 .notable-traits-tooltip::after {
1216 /* The margin on the tooltip does not capture hover events,
1217 this extends the area of hover enough so that mouse hover is not
1218 lost when moving the mouse to the tooltip */
1219 content: "\00a0\00a0\00a0";
1222 .notable-traits .notable, .notable-traits .docblock {
1226 .notable-traits .notable {
1228 margin-bottom: 13px;
1233 .notable-traits .docblock code.content{
1239 /* Example code has the "Run" button that needs to be positioned relative to the pre */
1240 pre.rust.rust-example-rendered {
1255 .search-failed.active {
1259 .search-failed > ul {
1277 border-top: 2px solid;
1280 #titles > button:not(:last-child) {
1282 width: calc(33.3% - 1px);
1285 #titles > button > div.count {
1286 display: inline-block;
1300 margin-bottom: 10px;
1314 border-top-right-radius: 3px;
1315 border-bottom-right-radius: 3px;
1318 transition: left .5s;
1331 transition: left .5s;
1332 border-right: 1px solid;
1334 #source-sidebar > .title {
1337 border-bottom: 1px solid;
1347 .theme-picker button {
1351 #settings-menu, #help-button {
1361 #theme-picker, #settings-menu, #help-button, #copy-path {
1372 font-family: "Fira Sans", Arial, sans-serif;
1379 background: initial;
1397 #theme-choices > button {
1402 background: rgba(0,0,0,0);
1405 #theme-choices > button:not(:first-child) {
1406 border-top: 1px solid;
1410 display: inline-block;
1412 font: 15px monospace;
1414 vertical-align: middle;
1417 box-shadow: inset 0 -1px 0;
1421 .hidden-by-impl-hider,
1422 .hidden-by-usual-hider {
1423 /* important because of conflicting rule for small screens */
1424 display: none !important;
1427 #implementations-list > h3 > span.in-band {
1434 border-collapse: collapse;
1439 .table-display tr td:first-child {
1443 .table-display tr td:last-child {
1446 .table-display .out-of-band {
1451 #implementors-list > .impl-items .table-display .out-of-band {
1455 .table-display td:hover .anchor {
1485 div.files > a:hover, div.name:hover {
1486 background-color: #a14b4b;
1488 div.name.expand + .children {
1499 div.name.expand::before {
1500 transform: rotate(90deg);
1505 /* The hideme class is used on summary tags that contain a span with
1506 placeholder text shown only when the toggle is closed. For instance,
1507 "Expand description" or "Show methods". */
1508 details.rustdoc-toggle > summary.hideme {
1512 details.rustdoc-toggle > summary, details.undocumented > summary {
1515 details.rustdoc-toggle > summary::-webkit-details-marker,
1516 details.rustdoc-toggle > summary::marker,
1517 details.undocumented > summary::-webkit-details-marker,
1518 details.undocumented > summary::marker {
1522 details.rustdoc-toggle > summary.hideme > span {
1526 details.rustdoc-toggle > summary::before {
1530 height: max(17px, 1.1em);
1531 background-repeat: no-repeat;
1532 background-position: top left;
1533 display: inline-block;
1534 vertical-align: middle;
1538 /* Screen readers see the text version at the end the line.
1539 Visual readers see the icon at the start of the line, but small and transparent. */
1540 details.rustdoc-toggle > summary::after {
1548 details.rustdoc-toggle > summary.hideme::after {
1549 /* "hideme" toggles already have a description when they're contracted */
1553 details.rustdoc-toggle > summary:focus::before,
1554 details.rustdoc-toggle > summary:hover::before {
1558 details.rustdoc-toggle.top-doc > summary,
1559 details.rustdoc-toggle.top-doc > summary::before,
1560 details.rustdoc-toggle.non-exhaustive > summary,
1561 details.rustdoc-toggle.non-exhaustive > summary::before {
1562 font-family: 'Fira Sans';
1566 details.non-exhaustive {
1570 details.rustdoc-toggle > summary.hideme::before {
1574 details.rustdoc-toggle > summary:not(.hideme)::before {
1580 .impl-items > details.rustdoc-toggle > summary:not(.hideme)::before,
1581 .undocumented > details.rustdoc-toggle > summary:not(.hideme)::before {
1586 /* When a "hideme" summary is open and the "Expand description" or "Show
1587 methods" text is hidden, we want the [-] toggle that remains to not
1588 affect the layout of the items to its right. To do that, we use
1589 absolute positioning. Note that we also set position: relative
1590 on the parent <details> to make this work properly. */
1591 details.rustdoc-toggle[open] > summary.hideme {
1595 details.rustdoc-toggle, details.undocumented {
1599 details.rustdoc-toggle[open] > summary.hideme > span {
1603 details.rustdoc-toggle[open] > summary::before,
1604 details.rustdoc-toggle[open] > summary.hideme::before {
1606 height: max(17px, 1.1em);
1607 background-repeat: no-repeat;
1608 background-position: top left;
1609 display: inline-block;
1613 details.rustdoc-toggle[open] > summary::after,
1614 details.rustdoc-toggle[open] > summary.hideme::after {
1615 content: "Collapse";
1618 details.undocumented > summary::before {
1620 height: max(17px, 1.1em);
1621 background-repeat: no-repeat;
1622 background-position: top left;
1623 content: "Show hidden undocumented items";
1630 details.undocumented > summary:focus::before,
1631 details.undocumented > summary:hover::before {
1635 details.undocumented[open] > summary::before {
1637 height: max(17px, 1.1em);
1638 background-repeat: no-repeat
1639 background-position: top left;
1640 content: "Hide undocumented items";
1645 @media (min-width: 701px) {
1646 /* In case there is no documentation before a code block, we need to add some margin at the top
1647 to prevent an overlay between the "collapse toggle" and the information tooltip.
1648 However, it's not needed with smaller screen width because the doc/code block is always put
1649 "one line" below. */
1650 .docblock > .information:first-child > .tooltip {
1655 @media (max-width: 700px) {
1660 .rustdoc > .sidebar {
1670 .sidebar > .location {
1674 padding: 3px 10px 1px 10px;
1676 background: inherit;
1681 .sidebar .location:empty {
1685 .sidebar .logo-container {
1694 .sidebar .logo-container > img {
1708 border-bottom: 1px solid;
1709 border-right: 1px solid;
1713 .rustdoc.source > .sidebar > .sidebar-menu {
1717 /* We do NOT hide this element so that alternative device readers still have this information
1725 /* We move the sidebar to the left by its own width so it doesn't appear. */
1728 border-right: 1px solid;
1731 .sidebar > .block.version {
1733 border-bottom: none;
1738 .sidebar > .block.version > div.narrow-helper {
1743 .sidebar > .block.version > p {
1744 /* hide Version text if too narrow */
1747 /* vertically center */
1749 align-items: center;
1754 width: calc(100% - 32px);
1772 display: none !important;
1787 #titles > button > div.count {
1800 background-color: rgba(0,0,0,0);
1804 This allows to prevent the version text to overflow the sidebar title on mobile mode when the
1805 sidebar is displayed (after clicking on the "hamburger" button).
1807 .sidebar.mobile > div.version {
1812 width: calc(100% + 30px);
1815 .show-it, .sidebar-elems:focus-within {
1820 .show-it > .block.items {
1824 .show-it > .block.items > ul {
1828 .show-it > .block.items > ul > li {
1833 .show-it > .block.items > ul > li > a {
1837 /* Because of ios, we need to actually have a full height sidebar title so the
1838 * actual sidebar can show up. But then we need to make it transparent so we don't
1839 * hide content. The filler just allows to create the background for the sidebar
1840 * title. But because of the absolute position, I had to lower the z-index.
1845 width: calc(100% - 45px);
1849 border-bottom: 1px solid;
1852 #main > details.rustdoc-toggle > summary::before,
1853 #main > div > details.rustdoc-toggle > summary::before {
1873 #main > .line-numbers {
1877 .notable-traits .notable-traits-tooltiptext {
1882 /* We don't display the help button on mobile devices. */
1887 /* Display an alternating layout on tablets and phones */
1893 flex-flow: column wrap;
1895 .item-left, .item-right {
1899 .search-container > div {
1900 width: calc(100% - 32px);
1903 /* Display an alternating layout on tablets and phones */
1904 .search-results > a {
1905 border-bottom: 1px solid #aaa9;
1908 .search-results .result-name, .search-results div.desc, .search-results .result-description {
1911 .search-results div.desc, .search-results .result-description, .item-right {
1917 nav.sub, .content .out-of-band {
1922 @media (max-width: 464px) {
1923 #titles, #titles > button {
1927 /* This is to prevent the search bar from being underneath the <section>
1928 * element following it.
1934 #main > table:not(.table-display) td {
1935 word-break: break-word;
1939 .search-container > div {
1941 width: calc(100% - 37px);
1950 #crate-search + .search-input {
1951 width: calc(100% + 71px);
1955 #theme-picker, #settings-menu {