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 {
261 .source .content pre {
282 text-transform: uppercase;
294 /* Improve the scrollbar display on firefox */
296 scrollbar-width: initial;
299 scrollbar-width: thin;
302 /* Improve the scrollbar display on webkit-based browsers */
303 ::-webkit-scrollbar {
306 .sidebar::-webkit-scrollbar {
309 ::-webkit-scrollbar-track {
310 -webkit-box-shadow: inset 0;
313 .sidebar .block > ul > li {
321 /* Everything else */
324 display: none !important;
336 .logo-container > img {
343 transform: translate(-50%, -50%);
350 margin: 30px 10px 20px 10px;
352 word-wrap: break-word;
353 font-weight: inherit;
360 border-bottom: 1px solid;
361 overflow-wrap: break-word;
362 word-wrap: break-word; /* deprecated */
363 word-break: break-word; /* Chrome, non-standard */
370 .location a:first-of-type {
374 text-decoration: underline;
381 .block h2, .block h3 {
384 .block ul, .block li {
392 text-overflow: ellipsis;
398 transition: border 500ms ease-out;
402 border-top: 1px solid;
403 border-bottom: 1px solid;
407 font-weight: inherit;
428 .source .content pre.rust {
434 .rustdoc .example-wrap {
435 display: inline-flex;
444 .example-wrap > pre.line-number {
449 border-top-left-radius: 5px;
450 border-bottom-left-radius: 5px;
453 .example-wrap > pre.rust a:hover {
454 text-decoration: underline;
457 .rustdoc:not(.source) .example-wrap > pre:not(.line-number) {
462 .rustdoc .example-wrap > pre {
476 .content > .example-wrap pre.line-numbers {
478 -webkit-user-select: none;
479 -moz-user-select: none;
480 -ms-user-select: none;
488 overflow-wrap: anywhere;
496 text-overflow: ellipsis;
499 /* Wrap non-pre code blocks (`text`) but not (```text```). */
500 .docblock > :not(pre) > code,
501 .docblock-short > :not(pre) > code {
502 white-space: pre-wrap;
505 .docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5, .docblock h6 {
506 border-bottom: 1px solid;
509 .top-doc .docblock h2 { font-size: 1.3em; }
510 .top-doc .docblock h3 { font-size: 1.15em; }
511 .top-doc .docblock h4,
512 .top-doc .docblock h5,
513 .top-doc .docblock h6 {
517 .docblock h5 { font-size: 1em; }
518 .docblock h6 { font-size: 0.95em; }
530 .content .out-of-band {
539 .method > .code-header, .trait-impl > .code-header, .invisible > .code-header {
540 max-width: calc(100% - 41px);
546 display: inline-block;
555 .in-band > code, .in-band > .code-header {
556 display: inline-block;
564 font-family: "Fira Sans", Arial, sans-serif;
567 .content table:not(.table-display) {
568 border-spacing: 0 5px;
570 .content td { vertical-align: top; }
571 .content td:first-child { padding-right: 20px; }
572 .content td p:first-child { margin-top: 0; }
573 .content td h1, .content td h2 { margin-left: 0; font-size: 1.1em; }
574 .content tr:first-child td { border-top: 0; }
578 width: calc(100% - 2px);
598 .content .item-list {
599 list-style-type: none;
603 .content .multi-column {
604 -moz-column-count: 5;
605 -moz-column-gap: 2.5em;
606 -webkit-column-count: 5;
607 -webkit-column-gap: 2.5em;
611 .content .multi-column li { width: 100%; display: inline-block; }
613 .content > .methods > .method {
617 /* Shift "where ..." part of method or fn definition down a line */
618 .content .method .where,
620 .content .where.fmt-newline {
625 .content .methods > div:not(.notable-traits):not(.method) {
630 .content .docblock > .impl-items {
634 .content .docblock >.impl-items .table-display {
637 .content .docblock >.impl-items table td {
640 .content .docblock > .impl-items .table-display, .impl-items table td {
644 .content .item-info code {
648 .content .item-info {
653 .sub-variant > div > .item-info {
657 .content .item-info::before {
665 .content .impl-items .method, .content .impl-items > .type, .impl-items > .associatedconstant,
666 .impl-items > .associatedtype, .content .impl-items details > summary > .type,
667 .impl-items details > summary > .associatedconstant,
668 .impl-items details > summary > .associatedtype {
672 .content .impl-items .docblock, .content .impl-items .item-info {
676 .content .impl-items > .item-info {
680 .methods > .item-info, .content .impl-items > .item-info {
693 border-bottom: 1px solid;
694 padding-bottom: 10px;
702 border-top: 1px solid;
703 border-bottom: 1px solid;
705 nav.main .separator {
707 display: inline-block;
711 nav.sum { text-align: right; }
712 nav.sub form { display: inline; }
719 text-decoration: none;
720 background: transparent;
723 .small-section-header {
725 justify-content: space-between;
729 .small-section-header:hover > .anchor {
733 .in-band:hover > .anchor, .impl:hover > .anchor, .method.trait-impl:hover > .anchor,
734 .type.trait-impl:hover > .anchor, .associatedconstant.trait-impl:hover > .anchor,
735 .associatedtype.trait-impl:hover > .anchor {
736 display: inline-block;
743 background: none !important;
748 .small-section-header > .anchor {
752 h2.small-section-header > .anchor {
759 .docblock a:not(.srclink):not(.test-arrow):hover,
760 .docblock-short a:not(.srclink):not(.test-arrow):hover, .item-info a {
761 text-decoration: underline;
764 .invisible > .srclink,
765 .method > .code-header + .srclink {
773 .block a.current.crate { font-weight: 500; }
781 .item-left, .item-right {
785 padding-right: 1.2rem;
791 .search-container > div {
792 display: inline-flex;
793 width: calc(100% - 63px);
803 border-radius: 4px 0 0 4px;
806 border-right: 1px solid;
807 -moz-appearance: none;
808 -webkit-appearance: none;
809 /* Removes default arrow from firefox */
812 background-repeat: no-repeat;
813 background-color: transparent;
814 background-size: 20px;
815 background-position: calc(100% - 1px) 56%;
817 .search-container > .top-button {
823 /* Override Normalize.css: we have margins and do
824 not want to overflow - the `moz` attribute is necessary
825 until Firefox 29, too early to drop at this point */
826 -moz-box-sizing: border-box !important;
827 box-sizing: border-box !important;
834 transition: border-color 300ms ease;
835 transition: border-radius 300ms ease-in-out;
836 transition: box-shadow 300ms ease-in-out;
840 #crate-search + .search-input {
841 border-radius: 0 1px 1px 0;
842 width: calc(100% - 32px);
845 .search-input:focus {
856 .search-results.active {
858 /* prevent overhanging tabs from moving the first result */
862 .search-results .desc > span {
864 text-overflow: ellipsis;
869 .search-results > a {
872 /* A little margin ensures the browser's outlining of focused links has room to display. */
875 border-bottom: 1px solid #aaa3;
878 .search-results > a > div {
883 .search-results .result-name, .search-results div.desc, .search-results .result-description {
886 .search-results .result-name {
890 .search-results .result-name > span {
891 display: inline-block;
896 body.blur > :not(#help) {
898 -webkit-filter: blur(8px);
909 justify-content: center;
914 box-shadow: 0 0 6px rgba(0,0,0,.2);
923 margin-right: 0.5rem;
925 #help span.top, #help span.bottom {
935 border-bottom: 1px solid;
941 border-top: 1px solid;
943 #help dd { margin: 5px 35px; }
944 #help .infos { padding-left: 0; }
945 #help h1, #help h2 { margin-top: 0; }
949 padding: 0 20px 20px 17px;;
971 /* Black one-pixel outline around emoji shapes */
983 display: inline-block;
989 vertical-align: text-bottom;
992 .module-item.unstable,
993 .import-item.unstable {
1002 .impl-items .since, .impl .since, .methods .since {
1008 .impl-items .srclink, .impl .srclink, .methods .srclink {
1009 /* Override header settings otherwise it's too bold */
1011 font-weight: normal;
1020 margin-bottom: 12px;
1021 /* Push the src link out to the right edge consistently */
1022 justify-content: space-between;
1029 .variants_table tbody tr td:first-child {
1030 width: 1%; /* make the variant name as small as possible */
1041 pre.rust .question-mark {
1046 display: inline-block;
1048 padding: 5px 10px 5px 10px;
1056 text-decoration: none;
1059 .section-header:hover a:before {
1062 padding-right: 10px; /* avoid gap that causes hover to disappear */
1063 content: '\2002\00a7\2002';
1066 .section-header:hover a {
1067 text-decoration: none;
1087 .out-of-band > span.since {
1093 .sub-variant, .sub-variant > h3 {
1094 margin-top: 0px !important;
1098 #main .sub-variant > h3 {
1104 .sub-variant > div {
1106 margin-bottom: 10px;
1109 .sub-variant > div > span {
1115 display: inline-block;
1120 .docblock > .section-header:first-child {
1125 .docblock > .section-header:first-child:hover > a:before {
1129 :target > code, :target > .code-header {
1146 display: inline-block;
1153 padding: 5px 3px 3px 3px;
1159 .tooltip.ignore::after {
1160 content: "This example is not tested";
1162 .tooltip.compile_fail::after {
1163 content: "This example deliberately fails to compile";
1165 .tooltip.should_panic::after {
1166 content: "This example panics";
1168 .tooltip.edition::after {
1169 content: "This code runs with edition " attr(data-edition);
1179 border-style: solid;
1183 .tooltip:hover::before, .tooltip:hover::after {
1187 .tooltip.compile_fail, .tooltip.should_panic, .tooltip.ignore {
1192 .notable-traits-tooltip {
1193 display: inline-block;
1197 .notable-traits:hover .notable-traits-tooltiptext,
1198 .notable-traits .notable-traits-tooltiptext.force-tooltip {
1199 display: inline-block;
1202 .notable-traits .notable-traits-tooltiptext {
1204 padding: 5px 3px 3px 3px;
1214 .notable-traits-tooltip::after {
1215 /* The margin on the tooltip does not capture hover events,
1216 this extends the area of hover enough so that mouse hover is not
1217 lost when moving the mouse to the tooltip */
1218 content: "\00a0\00a0\00a0";
1221 .notable-traits .notable, .notable-traits .docblock {
1225 .notable-traits .notable {
1227 margin-bottom: 13px;
1232 .notable-traits .docblock code.content{
1238 /* Example code has the "Run" button that needs to be positioned relative to the pre */
1239 pre.rust.rust-example-rendered {
1254 .search-failed.active {
1258 .search-failed > ul {
1276 border-top: 2px solid;
1279 #titles > button:not(:last-child) {
1281 width: calc(33.3% - 1px);
1284 #titles > button > div.count {
1285 display: inline-block;
1299 margin-bottom: 10px;
1313 border-top-right-radius: 3px;
1314 border-bottom-right-radius: 3px;
1317 transition: left .5s;
1330 transition: left .5s;
1331 border-right: 1px solid;
1333 #source-sidebar > .title {
1336 border-bottom: 1px solid;
1346 .theme-picker button {
1350 #settings-menu, #help-button {
1360 #theme-picker, #settings-menu, #help-button, #copy-path {
1371 font-family: "Fira Sans", Arial, sans-serif;
1378 background: initial;
1396 #theme-choices > button {
1401 background: rgba(0,0,0,0);
1404 #theme-choices > button:not(:first-child) {
1405 border-top: 1px solid;
1409 display: inline-block;
1411 font: 15px monospace;
1413 vertical-align: middle;
1416 box-shadow: inset 0 -1px 0;
1420 .hidden-by-impl-hider,
1421 .hidden-by-usual-hider {
1422 /* important because of conflicting rule for small screens */
1423 display: none !important;
1426 #implementations-list > h3 > span.in-band {
1433 border-collapse: collapse;
1438 .table-display tr td:first-child {
1442 .table-display tr td:last-child {
1445 .table-display .out-of-band {
1450 #implementors-list > .impl-items .table-display .out-of-band {
1454 .table-display td:hover .anchor {
1484 div.files > a:hover, div.name:hover {
1485 background-color: #a14b4b;
1487 div.name.expand + .children {
1498 div.name.expand::before {
1499 transform: rotate(90deg);
1504 /* The hideme class is used on summary tags that contain a span with
1505 placeholder text shown only when the toggle is closed. For instance,
1506 "Expand description" or "Show methods". */
1507 details.rustdoc-toggle > summary.hideme {
1511 details.rustdoc-toggle > summary, details.undocumented > summary {
1514 details.rustdoc-toggle > summary::-webkit-details-marker,
1515 details.rustdoc-toggle > summary::marker,
1516 details.undocumented > summary::-webkit-details-marker,
1517 details.undocumented > summary::marker {
1521 details.rustdoc-toggle > summary.hideme > span {
1525 details.rustdoc-toggle > summary::before {
1529 height: max(17px, 1.1em);
1530 background-repeat: no-repeat;
1531 background-position: top left;
1532 display: inline-block;
1533 vertical-align: middle;
1537 /* Screen readers see the text version at the end the line.
1538 Visual readers see the icon at the start of the line, but small and transparent. */
1539 details.rustdoc-toggle > summary::after {
1547 details.rustdoc-toggle > summary.hideme::after {
1548 /* "hideme" toggles already have a description when they're contracted */
1552 details.rustdoc-toggle > summary:focus::before,
1553 details.rustdoc-toggle > summary:hover::before {
1557 details.rustdoc-toggle.top-doc > summary,
1558 details.rustdoc-toggle.top-doc > summary::before,
1559 details.rustdoc-toggle.non-exhaustive > summary,
1560 details.rustdoc-toggle.non-exhaustive > summary::before {
1561 font-family: 'Fira Sans';
1565 details.non-exhaustive {
1569 details.rustdoc-toggle > summary.hideme::before {
1573 details.rustdoc-toggle > summary:not(.hideme)::before {
1579 .impl-items > details.rustdoc-toggle > summary:not(.hideme)::before,
1580 .undocumented > details.rustdoc-toggle > summary:not(.hideme)::before {
1585 /* When a "hideme" summary is open and the "Expand description" or "Show
1586 methods" text is hidden, we want the [-] toggle that remains to not
1587 affect the layout of the items to its right. To do that, we use
1588 absolute positioning. Note that we also set position: relative
1589 on the parent <details> to make this work properly. */
1590 details.rustdoc-toggle[open] > summary.hideme {
1594 details.rustdoc-toggle, details.undocumented {
1598 details.rustdoc-toggle[open] > summary.hideme > span {
1602 details.rustdoc-toggle[open] > summary::before,
1603 details.rustdoc-toggle[open] > summary.hideme::before {
1605 height: max(17px, 1.1em);
1606 background-repeat: no-repeat;
1607 background-position: top left;
1608 display: inline-block;
1612 details.rustdoc-toggle[open] > summary::after,
1613 details.rustdoc-toggle[open] > summary.hideme::after {
1614 content: "Collapse";
1617 details.undocumented > summary::before {
1619 height: max(17px, 1.1em);
1620 background-repeat: no-repeat;
1621 background-position: top left;
1622 content: "Show hidden undocumented items";
1629 details.undocumented > summary:focus::before,
1630 details.undocumented > summary:hover::before {
1634 details.undocumented[open] > summary::before {
1636 height: max(17px, 1.1em);
1637 background-repeat: no-repeat
1638 background-position: top left;
1639 content: "Hide undocumented items";
1644 @media (min-width: 701px) {
1645 /* In case there is no documentation before a code block, we need to add some margin at the top
1646 to prevent an overlay between the "collapse toggle" and the information tooltip.
1647 However, it's not needed with smaller screen width because the doc/code block is always put
1648 "one line" below. */
1649 .docblock > .information:first-child > .tooltip {
1654 @media (max-width: 700px) {
1659 .rustdoc > .sidebar {
1669 .sidebar > .location {
1673 padding: 3px 10px 1px 10px;
1675 background: inherit;
1680 .sidebar .location:empty {
1684 .sidebar .logo-container {
1693 .sidebar .logo-container > img {
1707 border-bottom: 1px solid;
1708 border-right: 1px solid;
1712 .rustdoc.source > .sidebar > .sidebar-menu {
1716 /* We do NOT hide this element so that alternative device readers still have this information
1724 /* We move the sidebar to the left by its own width so it doesn't appear. */
1727 border-right: 1px solid;
1730 .sidebar > .block.version {
1732 border-bottom: none;
1737 .sidebar > .block.version > div.narrow-helper {
1742 .sidebar > .block.version > p {
1743 /* hide Version text if too narrow */
1746 /* vertically center */
1748 align-items: center;
1753 width: calc(100% - 32px);
1771 display: none !important;
1786 #titles > button > div.count {
1799 background-color: rgba(0,0,0,0);
1803 This allows to prevent the version text to overflow the sidebar title on mobile mode when the
1804 sidebar is displayed (after clicking on the "hamburger" button).
1806 .sidebar.mobile > div.version {
1811 width: calc(100% + 30px);
1814 .show-it, .sidebar-elems:focus-within {
1819 .show-it > .block.items {
1823 .show-it > .block.items > ul {
1827 .show-it > .block.items > ul > li {
1832 .show-it > .block.items > ul > li > a {
1836 /* Because of ios, we need to actually have a full height sidebar title so the
1837 * actual sidebar can show up. But then we need to make it transparent so we don't
1838 * hide content. The filler just allows to create the background for the sidebar
1839 * title. But because of the absolute position, I had to lower the z-index.
1844 width: calc(100% - 45px);
1848 border-bottom: 1px solid;
1851 #main > details.rustdoc-toggle > summary::before,
1852 #main > div > details.rustdoc-toggle > summary::before {
1872 #main > .line-numbers {
1876 .notable-traits .notable-traits-tooltiptext {
1881 /* We don't display the help button on mobile devices. */
1886 /* Display an alternating layout on tablets and phones */
1892 flex-flow: column wrap;
1894 .item-left, .item-right {
1898 .search-container > div {
1899 width: calc(100% - 32px);
1902 /* Display an alternating layout on tablets and phones */
1903 .search-results > a {
1904 border-bottom: 1px solid #aaa9;
1907 .search-results .result-name, .search-results div.desc, .search-results .result-description {
1910 .search-results div.desc, .search-results .result-description, .item-right {
1916 nav.sub, .content .out-of-band {
1921 @media (max-width: 464px) {
1922 #titles, #titles > button {
1926 /* This is to prevent the search bar from being underneath the <section>
1927 * element following it.
1933 #main > table:not(.table-display) td {
1934 word-break: break-word;
1938 .search-container > div {
1940 width: calc(100% - 37px);
1949 #crate-search + .search-input {
1950 width: calc(100% + 71px);
1954 #theme-picker, #settings-menu {
1973 overflow-wrap: anywhere;