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 .top-doc .docblock h2 { font-size: 1.3em; }
506 .top-doc .docblock h3 { font-size: 1.15em; }
507 .top-doc .docblock h4,
508 .top-doc .docblock h5,
509 .top-doc .docblock h6 {
513 .docblock h5 { font-size: 1em; }
514 .docblock h6 { font-size: 0.95em; }
526 .content .out-of-band {
535 .method > .code-header, .trait-impl > .code-header, .invisible > .code-header {
536 max-width: calc(100% - 41px);
542 display: inline-block;
551 .in-band > code, .in-band > .code-header {
552 display: inline-block;
560 font-family: "Fira Sans", Arial, sans-serif;
563 .content table:not(.table-display) {
564 border-spacing: 0 5px;
566 .content td { vertical-align: top; }
567 .content td:first-child { padding-right: 20px; }
568 .content td p:first-child { margin-top: 0; }
569 .content td h1, .content td h2 { margin-left: 0; font-size: 1.1em; }
570 .content tr:first-child td { border-top: 0; }
574 width: calc(100% - 2px);
594 .content .item-list {
595 list-style-type: none;
599 .content .multi-column {
600 -moz-column-count: 5;
601 -moz-column-gap: 2.5em;
602 -webkit-column-count: 5;
603 -webkit-column-gap: 2.5em;
607 .content .multi-column li { width: 100%; display: inline-block; }
609 .content > .methods > .method {
613 /* Shift "where ..." part of method or fn definition down a line */
614 .content .method .where,
616 .content .where.fmt-newline {
621 .content .methods > div:not(.notable-traits):not(.method) {
626 .content .docblock > .impl-items {
630 .content .docblock >.impl-items .table-display {
633 .content .docblock >.impl-items table td {
636 .content .docblock > .impl-items .table-display, .impl-items table td {
640 .content .item-info code {
644 .content .item-info {
649 .sub-variant > div > .item-info {
653 .content .item-info::before {
661 .content .impl-items .method, .content .impl-items > .type, .impl-items > .associatedconstant,
662 .impl-items > .associatedtype, .content .impl-items details > summary > .type,
663 .impl-items details > summary > .associatedconstant,
664 .impl-items details > summary > .associatedtype {
668 .content .impl-items .docblock, .content .impl-items .item-info {
672 .content .impl-items > .item-info {
676 .methods > .item-info, .content .impl-items > .item-info {
689 border-bottom: 1px solid;
690 padding-bottom: 10px;
698 border-top: 1px solid;
699 border-bottom: 1px solid;
701 nav.main .separator {
703 display: inline-block;
707 nav.sum { text-align: right; }
708 nav.sub form { display: inline; }
715 text-decoration: none;
716 background: transparent;
719 .small-section-header {
721 justify-content: space-between;
725 .small-section-header:hover > .anchor {
729 .in-band:hover > .anchor, .impl:hover > .anchor, .method.trait-impl:hover > .anchor,
730 .type.trait-impl:hover > .anchor, .associatedconstant.trait-impl:hover > .anchor,
731 .associatedtype.trait-impl:hover > .anchor {
732 display: inline-block;
739 background: none !important;
744 .small-section-header > .anchor {
748 h2.small-section-header > .anchor {
755 .docblock a:not(.srclink):not(.test-arrow):hover,
756 .docblock-short a:not(.srclink):not(.test-arrow):hover, .item-info a {
757 text-decoration: underline;
760 .invisible > .srclink,
761 .method > .code-header + .srclink {
769 .block a.current.crate { font-weight: 500; }
777 .item-left, .item-right {
781 padding-right: 1.2rem;
787 .search-container > div {
788 display: inline-flex;
789 width: calc(100% - 63px);
799 border-radius: 4px 0 0 4px;
802 border-right: 1px solid;
803 -moz-appearance: none;
804 -webkit-appearance: none;
805 /* Removes default arrow from firefox */
808 background-repeat: no-repeat;
809 background-color: transparent;
810 background-size: 20px;
811 background-position: calc(100% - 1px) 56%;
813 .search-container > .top-button {
819 /* Override Normalize.css: we have margins and do
820 not want to overflow - the `moz` attribute is necessary
821 until Firefox 29, too early to drop at this point */
822 -moz-box-sizing: border-box !important;
823 box-sizing: border-box !important;
830 transition: border-color 300ms ease;
831 transition: border-radius 300ms ease-in-out;
832 transition: box-shadow 300ms ease-in-out;
836 #crate-search + .search-input {
837 border-radius: 0 1px 1px 0;
838 width: calc(100% - 32px);
841 .search-input:focus {
852 .search-results.active {
854 /* prevent overhanging tabs from moving the first result */
858 .search-results .desc > span {
860 text-overflow: ellipsis;
865 .search-results > a {
868 /* A little margin ensures the browser's outlining of focused links has room to display. */
871 border-bottom: 1px solid #aaa3;
874 .search-results > a > div {
879 .search-results .result-name, .search-results div.desc, .search-results .result-description {
882 .search-results .result-name {
886 .search-results .result-name > span {
887 display: inline-block;
892 body.blur > :not(#help) {
894 -webkit-filter: blur(8px);
905 justify-content: center;
910 box-shadow: 0 0 6px rgba(0,0,0,.2);
919 margin-right: 0.5rem;
921 #help span.top, #help span.bottom {
931 border-bottom: 1px solid;
937 border-top: 1px solid;
939 #help dd { margin: 5px 35px; }
940 #help .infos { padding-left: 0; }
941 #help h1, #help h2 { margin-top: 0; }
945 padding: 0 20px 20px 17px;;
967 /* Black one-pixel outline around emoji shapes */
979 display: inline-block;
985 vertical-align: text-bottom;
988 .module-item.unstable,
989 .import-item.unstable {
998 .impl-items .since, .impl .since, .methods .since {
1004 .impl-items .srclink, .impl .srclink, .methods .srclink {
1005 /* Override header settings otherwise it's too bold */
1007 font-weight: normal;
1016 margin-bottom: 12px;
1017 /* Push the src link out to the right edge consistently */
1018 justify-content: space-between;
1025 .variants_table tbody tr td:first-child {
1026 width: 1%; /* make the variant name as small as possible */
1037 pre.rust .question-mark {
1042 display: inline-block;
1044 padding: 5px 10px 5px 10px;
1052 text-decoration: none;
1055 .section-header:hover a:before {
1058 padding-right: 10px; /* avoid gap that causes hover to disappear */
1059 content: '\2002\00a7\2002';
1062 .section-header:hover a {
1063 text-decoration: none;
1083 .out-of-band > span.since {
1089 .sub-variant, .sub-variant > h3 {
1090 margin-top: 0px !important;
1094 #main .sub-variant > h3 {
1100 .sub-variant > div {
1102 margin-bottom: 10px;
1105 .sub-variant > div > span {
1111 display: inline-block;
1116 .docblock > .section-header:first-child {
1121 .docblock > .section-header:first-child:hover > a:before {
1125 :target > code, :target > .code-header {
1142 display: inline-block;
1149 padding: 5px 3px 3px 3px;
1155 .tooltip.ignore::after {
1156 content: "This example is not tested";
1158 .tooltip.compile_fail::after {
1159 content: "This example deliberately fails to compile";
1161 .tooltip.should_panic::after {
1162 content: "This example panics";
1164 .tooltip.edition::after {
1165 content: "This code runs with edition " attr(data-edition);
1175 border-style: solid;
1179 .tooltip:hover::before, .tooltip:hover::after {
1183 .tooltip.compile_fail, .tooltip.should_panic, .tooltip.ignore {
1188 .notable-traits-tooltip {
1189 display: inline-block;
1193 .notable-traits:hover .notable-traits-tooltiptext,
1194 .notable-traits .notable-traits-tooltiptext.force-tooltip {
1195 display: inline-block;
1198 .notable-traits .notable-traits-tooltiptext {
1200 padding: 5px 3px 3px 3px;
1210 .notable-traits-tooltip::after {
1211 /* The margin on the tooltip does not capture hover events,
1212 this extends the area of hover enough so that mouse hover is not
1213 lost when moving the mouse to the tooltip */
1214 content: "\00a0\00a0\00a0";
1217 .notable-traits .notable, .notable-traits .docblock {
1221 .notable-traits .notable {
1223 margin-bottom: 13px;
1228 .notable-traits .docblock code.content{
1234 /* Example code has the "Run" button that needs to be positioned relative to the pre */
1235 pre.rust.rust-example-rendered {
1250 .search-failed.active {
1254 .search-failed > ul {
1272 border-top: 2px solid;
1275 #titles > button:not(:last-child) {
1277 width: calc(33.3% - 1px);
1280 #titles > button > div.count {
1281 display: inline-block;
1295 margin-bottom: 10px;
1309 border-top-right-radius: 3px;
1310 border-bottom-right-radius: 3px;
1313 transition: left .5s;
1326 transition: left .5s;
1327 border-right: 1px solid;
1329 #source-sidebar > .title {
1332 border-bottom: 1px solid;
1342 .theme-picker button {
1346 #settings-menu, #help-button {
1356 #theme-picker, #settings-menu, #help-button, #copy-path {
1367 font-family: "Fira Sans", Arial, sans-serif;
1374 background: initial;
1392 #theme-choices > button {
1397 background: rgba(0,0,0,0);
1400 #theme-choices > button:not(:first-child) {
1401 border-top: 1px solid;
1405 display: inline-block;
1407 font: 15px monospace;
1409 vertical-align: middle;
1412 box-shadow: inset 0 -1px 0;
1416 .hidden-by-impl-hider,
1417 .hidden-by-usual-hider {
1418 /* important because of conflicting rule for small screens */
1419 display: none !important;
1422 #implementations-list > h3 > span.in-band {
1429 border-collapse: collapse;
1434 .table-display tr td:first-child {
1438 .table-display tr td:last-child {
1441 .table-display .out-of-band {
1446 #implementors-list > .impl-items .table-display .out-of-band {
1450 .table-display td:hover .anchor {
1480 div.files > a:hover, div.name:hover {
1481 background-color: #a14b4b;
1483 div.name.expand + .children {
1494 div.name.expand::before {
1495 transform: rotate(90deg);
1500 /* The hideme class is used on summary tags that contain a span with
1501 placeholder text shown only when the toggle is closed. For instance,
1502 "Expand description" or "Show methods". */
1503 details.rustdoc-toggle > summary.hideme {
1507 details.rustdoc-toggle > summary, details.undocumented > summary {
1510 details.rustdoc-toggle > summary::-webkit-details-marker,
1511 details.rustdoc-toggle > summary::marker,
1512 details.undocumented > summary::-webkit-details-marker,
1513 details.undocumented > summary::marker {
1517 details.rustdoc-toggle > summary.hideme > span {
1521 details.rustdoc-toggle > summary::before {
1525 height: max(17px, 1.1em);
1526 background-repeat: no-repeat;
1527 background-position: top left;
1528 display: inline-block;
1529 vertical-align: middle;
1533 /* Screen readers see the text version at the end the line.
1534 Visual readers see the icon at the start of the line, but small and transparent. */
1535 details.rustdoc-toggle > summary::after {
1543 details.rustdoc-toggle > summary.hideme::after {
1544 /* "hideme" toggles already have a description when they're contracted */
1548 details.rustdoc-toggle > summary:focus::before,
1549 details.rustdoc-toggle > summary:hover::before {
1553 details.rustdoc-toggle.top-doc > summary,
1554 details.rustdoc-toggle.top-doc > summary::before,
1555 details.rustdoc-toggle.non-exhaustive > summary,
1556 details.rustdoc-toggle.non-exhaustive > summary::before {
1557 font-family: 'Fira Sans';
1561 details.non-exhaustive {
1565 details.rustdoc-toggle > summary.hideme::before {
1569 details.rustdoc-toggle > summary:not(.hideme)::before {
1575 .impl-items > details.rustdoc-toggle > summary:not(.hideme)::before,
1576 .undocumented > details.rustdoc-toggle > summary:not(.hideme)::before {
1581 /* When a "hideme" summary is open and the "Expand description" or "Show
1582 methods" text is hidden, we want the [-] toggle that remains to not
1583 affect the layout of the items to its right. To do that, we use
1584 absolute positioning. Note that we also set position: relative
1585 on the parent <details> to make this work properly. */
1586 details.rustdoc-toggle[open] > summary.hideme {
1590 details.rustdoc-toggle, details.undocumented {
1594 details.rustdoc-toggle[open] > summary.hideme > span {
1598 details.rustdoc-toggle[open] > summary::before,
1599 details.rustdoc-toggle[open] > summary.hideme::before {
1601 height: max(17px, 1.1em);
1602 background-repeat: no-repeat;
1603 background-position: top left;
1604 display: inline-block;
1608 details.rustdoc-toggle[open] > summary::after,
1609 details.rustdoc-toggle[open] > summary.hideme::after {
1610 content: "Collapse";
1613 details.undocumented > summary::before {
1615 height: max(17px, 1.1em);
1616 background-repeat: no-repeat;
1617 background-position: top left;
1618 content: "Show hidden undocumented items";
1625 details.undocumented > summary:focus::before,
1626 details.undocumented > summary:hover::before {
1630 details.undocumented[open] > summary::before {
1632 height: max(17px, 1.1em);
1633 background-repeat: no-repeat
1634 background-position: top left;
1635 content: "Hide undocumented items";
1640 @media (min-width: 701px) {
1641 /* In case there is no documentation before a code block, we need to add some margin at the top
1642 to prevent an overlay between the "collapse toggle" and the information tooltip.
1643 However, it's not needed with smaller screen width because the doc/code block is always put
1644 "one line" below. */
1645 .docblock > .information:first-child > .tooltip {
1650 @media (max-width: 700px) {
1655 .rustdoc > .sidebar {
1665 .sidebar > .location {
1669 padding: 3px 10px 1px 10px;
1671 background: inherit;
1676 .sidebar .location:empty {
1680 .sidebar .logo-container {
1689 .sidebar .logo-container > img {
1703 border-bottom: 1px solid;
1704 border-right: 1px solid;
1708 .rustdoc.source > .sidebar > .sidebar-menu {
1712 /* We do NOT hide this element so that alternative device readers still have this information
1720 /* We move the sidebar to the left by its own width so it doesn't appear. */
1723 border-right: 1px solid;
1726 .sidebar > .block.version {
1728 border-bottom: none;
1733 .sidebar > .block.version > div.narrow-helper {
1738 .sidebar > .block.version > p {
1739 /* hide Version text if too narrow */
1742 /* vertically center */
1744 align-items: center;
1749 width: calc(100% - 32px);
1767 display: none !important;
1782 #titles > button > div.count {
1795 background-color: rgba(0,0,0,0);
1799 This allows to prevent the version text to overflow the sidebar title on mobile mode when the
1800 sidebar is displayed (after clicking on the "hamburger" button).
1802 .sidebar.mobile > div.version {
1807 width: calc(100% + 30px);
1810 .show-it, .sidebar-elems:focus-within {
1815 .show-it > .block.items {
1819 .show-it > .block.items > ul {
1823 .show-it > .block.items > ul > li {
1828 .show-it > .block.items > ul > li > a {
1832 /* Because of ios, we need to actually have a full height sidebar title so the
1833 * actual sidebar can show up. But then we need to make it transparent so we don't
1834 * hide content. The filler just allows to create the background for the sidebar
1835 * title. But because of the absolute position, I had to lower the z-index.
1840 width: calc(100% - 45px);
1844 border-bottom: 1px solid;
1847 #main > details.rustdoc-toggle > summary::before,
1848 #main > div > details.rustdoc-toggle > summary::before {
1868 #main > .line-numbers {
1872 .notable-traits .notable-traits-tooltiptext {
1877 /* We don't display the help button on mobile devices. */
1882 /* Display an alternating layout on tablets and phones */
1888 flex-flow: column wrap;
1890 .item-left, .item-right {
1894 .search-container > div {
1895 width: calc(100% - 32px);
1898 /* Display an alternating layout on tablets and phones */
1899 .search-results > a {
1900 border-bottom: 1px solid #aaa9;
1903 .search-results .result-name, .search-results div.desc, .search-results .result-description {
1906 .search-results div.desc, .search-results .result-description, .item-right {
1912 nav.sub, .content .out-of-band {
1917 @media (max-width: 464px) {
1918 #titles, #titles > button {
1922 /* This is to prevent the search bar from being underneath the <section>
1923 * element following it.
1929 #main > table:not(.table-display) td {
1930 word-break: break-word;
1934 .search-container > div {
1936 width: calc(100% - 37px);
1945 #crate-search + .search-input {
1946 width: calc(100% + 71px);
1950 #theme-picker, #settings-menu {
1969 overflow-wrap: anywhere;