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";
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;
154 .impl-items .associatedconstant,
155 .methods .associatedconstant,
156 .impl-items .associatedtype,
157 .methods .associatedtype {
164 .impl, .method.trait-impl,
166 .associatedconstant.trait-impl,
167 .associatedtype.trait-impl {
171 div.impl-items > div {
176 .sidebar, a.source, .search-input, .search-results .result-name,
177 .content table td:first-child > a,
179 div.item-list .out-of-band, span.since,
180 #source-sidebar, #sidebar-toggle,
181 details.rustdoc-toggle > summary::before,
182 details.undocumented > summary::before,
183 div.impl-items > div:not(.docblock):not(.item-info),
184 .content ul.crate a.crate, a.srclink,
185 /* This selector is for the items listed in the "all items" page. */
186 #main > ul.docblock > li > a {
187 font-family: "Fira Sans", Arial, sans-serif;
190 .content ul.crate a.crate {
197 ul ul, ol ul, ul ol, ol ol {
209 /* Fix some style changes due to normalize.css 8 */
217 border-collapse: collapse;
230 /* end tweaks for normalize.css 8 */
232 details:not(.rustdoc-toggle) summary {
236 code, pre, a.test-arrow {
237 font-family: "Source Code Pro", monospace;
239 .docblock code, .docblock-short code {
243 .docblock pre code, .docblock-short pre code {
254 .source .content pre {
275 text-transform: uppercase;
287 /* Improve the scrollbar display on firefox */
289 scrollbar-width: initial;
292 scrollbar-width: thin;
295 /* Improve the scrollbar display on webkit-based browsers */
296 ::-webkit-scrollbar {
299 .sidebar::-webkit-scrollbar {
302 ::-webkit-scrollbar-track {
303 -webkit-box-shadow: inset 0;
306 .sidebar .block > ul > li {
314 /* Everything else */
317 display: none !important;
329 .logo-container > img {
335 transform: translate(-50%, -50%);
342 margin: 30px 10px 20px 10px;
344 word-wrap: break-word;
345 font-weight: inherit;
352 border-bottom: 1px solid;
353 overflow-wrap: break-word;
354 word-wrap: break-word; /* deprecated */
355 word-break: break-word; /* Chrome, non-standard */
362 .location a:first-of-type {
366 text-decoration: underline;
373 .block h2, .block h3 {
376 .block ul, .block li {
384 text-overflow: ellipsis;
390 transition: border 500ms ease-out;
394 border-top: 1px solid;
395 border-bottom: 1px solid;
399 font-weight: inherit;
420 .source .content pre.rust {
426 .rustdoc .example-wrap {
427 display: inline-flex;
436 .example-wrap > pre.line-number {
441 border-top-left-radius: 5px;
442 border-bottom-left-radius: 5px;
445 .rustdoc:not(.source) .example-wrap > pre:not(.line-number) {
450 .rustdoc .example-wrap > pre {
464 .content > .example-wrap pre.line-numbers {
466 -webkit-user-select: none;
467 -moz-user-select: none;
468 -ms-user-select: none;
476 overflow-wrap: anywhere;
484 text-overflow: ellipsis;
487 /* Wrap non-pre code blocks (`text`) but not (```text```). */
488 .docblock > :not(pre) > code,
489 .docblock-short > :not(pre) > code {
490 white-space: pre-wrap;
493 .docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5 {
494 border-bottom: 1px solid;
497 .top-doc .docblock h1 { font-size: 1.3em; }
498 .top-doc .docblock h2 { font-size: 1.15em; }
499 .top-doc .docblock h3,
500 .top-doc .docblock h4,
501 .top-doc .docblock h5 {
505 .docblock h1 { font-size: 1em; }
506 .docblock h2 { font-size: 0.95em; }
507 .docblock h3, .docblock h4, .docblock h5 { font-size: 0.9em; }
514 .content .out-of-band {
523 .method > code, .trait-impl > code, .invisible > code {
524 max-width: calc(100% - 41px);
530 display: inline-block;
540 display: inline-block;
548 font-family: "Fira Sans", Arial, sans-serif;
551 .content table:not(.table-display) {
552 border-spacing: 0 5px;
554 .content td { vertical-align: top; }
555 .content td:first-child { padding-right: 20px; }
556 .content td p:first-child { margin-top: 0; }
557 .content td h1, .content td h2 { margin-left: 0; font-size: 1.1em; }
558 .content tr:first-child td { border-top: 0; }
562 width: calc(100% - 2px);
581 .content .item-list {
582 list-style-type: none;
586 .content .multi-column {
587 -moz-column-count: 5;
588 -moz-column-gap: 2.5em;
589 -webkit-column-count: 5;
590 -webkit-column-gap: 2.5em;
594 .content .multi-column li { width: 100%; display: inline-block; }
596 .content > .methods > .method {
600 /* Shift "where ..." part of method or fn definition down a line */
601 .content .method .where,
603 .content .where.fmt-newline {
608 .content .methods > div:not(.notable-traits):not(.method) {
613 .content .docblock > .impl-items {
617 .content .docblock >.impl-items .table-display {
620 .content .docblock >.impl-items table td {
623 .content .docblock > .impl-items .table-display, .impl-items table td {
627 .content .item-info code {
631 .content .item-info {
636 .sub-variant > div > .item-info {
640 .content .item-info::before {
648 .content .impl-items .method, .content .impl-items > .type, .impl-items > .associatedconstant,
649 .impl-items > .associatedtype, .content .impl-items details > summary > .type,
650 .impl-items details > summary > .associatedconstant,
651 .impl-items details > summary > .associatedtype {
655 .content .impl-items .docblock, .content .impl-items .item-info {
659 .content .impl-items > .item-info {
663 .methods > .item-info, .content .impl-items > .item-info {
676 border-bottom: 1px solid;
677 padding-bottom: 10px;
685 border-top: 1px solid;
686 border-bottom: 1px solid;
688 nav.main .separator {
690 display: inline-block;
694 nav.sum { text-align: right; }
695 nav.sub form { display: inline; }
702 text-decoration: none;
703 background: transparent;
706 .small-section-header {
708 justify-content: space-between;
712 .small-section-header:hover > .anchor {
716 .in-band:hover > .anchor, .impl:hover > .anchor, .method.trait-impl:hover > .anchor,
717 .type.trait-impl:hover > .anchor, .associatedconstant.trait-impl:hover > .anchor,
718 .associatedtype.trait-impl:hover > .anchor {
719 display: inline-block;
730 .small-section-header > .anchor {
732 padding-right: 10px; /* avoid gap that causes hover to disappear */
735 content: '\2002\00a7\2002';
738 .docblock a:not(.srclink):not(.test-arrow):hover,
739 .docblock-short a:not(.srclink):not(.test-arrow):hover, .item-info a {
740 text-decoration: underline;
743 .invisible > .srclink,
744 .method > code + .srclink {
752 .block a.current.crate { font-weight: 500; }
758 grid-template-columns: auto 1fr;
759 /* align content left */
760 justify-items: start;
763 .item-left, .item-right {
776 .search-container > div {
777 display: inline-flex;
778 width: calc(100% - 63px);
788 border-radius: 4px 0 0 4px;
791 border-right: 1px solid;
792 -moz-appearance: none;
793 -webkit-appearance: none;
794 /* Removes default arrow from firefox */
797 background-repeat: no-repeat;
798 background-color: transparent;
799 background-size: 20px;
800 background-position: calc(100% - 1px) 56%;
802 .search-container > .top-button {
808 /* Override Normalize.css: we have margins and do
809 not want to overflow - the `moz` attribute is necessary
810 until Firefox 29, too early to drop at this point */
811 -moz-box-sizing: border-box !important;
812 box-sizing: border-box !important;
819 transition: border-color 300ms ease;
820 transition: border-radius 300ms ease-in-out;
821 transition: box-shadow 300ms ease-in-out;
825 #crate-search + .search-input {
826 border-radius: 0 1px 1px 0;
827 width: calc(100% - 32px);
830 .search-input:focus {
841 .search-results.active {
843 /* prevent overhanging tabs from moving the first result */
847 .search-results .desc > span {
849 text-overflow: ellipsis;
854 .search-results > a {
857 /* A little margin ensures the browser's outlining of focused links has room to display. */
860 border-bottom: 1px solid #aaa3;
863 .search-results > a > div {
868 .search-results .result-name, .search-results div.desc, .search-results .result-description {
871 .search-results .result-name {
875 .search-results .result-name > span {
876 display: inline-block;
881 body.blur > :not(#help) {
883 -webkit-filter: blur(8px);
894 justify-content: center;
899 box-shadow: 0 0 6px rgba(0,0,0,.2);
908 margin-right: 0.5rem;
915 border-bottom: 1px solid #ccc;
919 #help dd { margin: 5px 35px; }
920 #help .infos { padding-left: 0; }
921 #help h1, #help h2 { margin-top: 0; }
925 padding: 0 20px 20px 17px;;
947 /* Black one-pixel outline around emoji shapes */
959 display: inline-block;
965 vertical-align: text-bottom;
968 .module-item.unstable,
969 .import-item.unstable {
978 .impl-items .since, .impl .since, .methods .since {
984 .impl-items .srclink, .impl .srclink, .methods .srclink {
985 /* Override header settings otherwise it's too bold */
997 /* Push the src link out to the right edge consistently */
998 justify-content: space-between;
1005 .variants_table tbody tr td:first-child {
1006 width: 1%; /* make the variant name as small as possible */
1017 pre.rust .question-mark {
1022 display: inline-block;
1024 padding: 5px 10px 5px 10px;
1032 text-decoration: none;
1035 .section-header:hover a:before {
1038 padding-right: 10px; /* avoid gap that causes hover to disappear */
1039 content: '\2002\00a7\2002';
1042 .section-header:hover a {
1043 text-decoration: none;
1063 .out-of-band > span.since {
1069 .sub-variant, .sub-variant > h3 {
1070 margin-top: 0px !important;
1074 #main > details > .sub-variant > h3 {
1080 .sub-variant > div {
1082 margin-bottom: 10px;
1085 .sub-variant > div > span {
1091 display: inline-block;
1096 .docblock > .section-header:first-child {
1101 .docblock > .section-header:first-child:hover > a:before {
1122 display: inline-block;
1129 padding: 5px 3px 3px 3px;
1135 .tooltip.ignore::after {
1136 content: "This example is not tested";
1138 .tooltip.compile_fail::after {
1139 content: "This example deliberately fails to compile";
1141 .tooltip.should_panic::after {
1142 content: "This example panics";
1144 .tooltip.edition::after {
1145 content: "This code runs with edition " attr(data-edition);
1155 border-style: solid;
1159 .tooltip:hover::before, .tooltip:hover::after {
1163 .tooltip.compile_fail, .tooltip.should_panic, .tooltip.ignore {
1168 .notable-traits-tooltip {
1169 display: inline-block;
1173 .notable-traits:hover .notable-traits-tooltiptext,
1174 .notable-traits .notable-traits-tooltiptext.force-tooltip {
1175 display: inline-block;
1178 .notable-traits .notable-traits-tooltiptext {
1180 padding: 5px 3px 3px 3px;
1190 .notable-traits-tooltip::after {
1191 /* The margin on the tooltip does not capture hover events,
1192 this extends the area of hover enough so that mouse hover is not
1193 lost when moving the mouse to the tooltip */
1194 content: "\00a0\00a0\00a0";
1197 .notable-traits .notable, .notable-traits .docblock {
1201 .notable-traits .notable {
1203 margin-bottom: 13px;
1208 .notable-traits .docblock code.content{
1214 /* Example code has the "Run" button that needs to be positioned relative to the pre */
1215 pre.rust.rust-example-rendered {
1230 .search-failed.active {
1234 .search-failed > ul {
1252 border-top: 2px solid;
1255 #titles > button:not(:last-child) {
1257 width: calc(33.3% - 1px);
1260 #titles > button > div.count {
1261 display: inline-block;
1275 margin-bottom: 10px;
1289 border-top-right-radius: 3px;
1290 border-bottom-right-radius: 3px;
1293 transition: left .5s;
1306 transition: left .5s;
1307 border-right: 1px solid;
1309 #source-sidebar > .title {
1312 border-bottom: 1px solid;
1322 .theme-picker button {
1326 #settings-menu, #help-button {
1336 #theme-picker, #settings-menu, #help-button, #copy-path {
1347 font-family: "Fira Sans", Arial, sans-serif;
1354 background: initial;
1372 #theme-choices > button {
1377 background: rgba(0,0,0,0);
1380 #theme-choices > button:not(:first-child) {
1381 border-top: 1px solid;
1385 display: inline-block;
1387 font: 15px monospace;
1389 vertical-align: middle;
1392 box-shadow: inset 0 -1px 0;
1396 .hidden-by-impl-hider,
1397 .hidden-by-usual-hider {
1398 /* important because of conflicting rule for small screens */
1399 display: none !important;
1402 #implementations-list > h3 > span.in-band {
1409 border-collapse: collapse;
1414 .table-display tr td:first-child {
1418 .table-display tr td:last-child {
1421 .table-display .out-of-band {
1426 #implementors-list > .impl-items .table-display .out-of-band {
1430 .table-display td:hover .anchor {
1460 div.files > a:hover, div.name:hover {
1461 background-color: #a14b4b;
1463 div.name.expand + .children {
1474 div.name.expand::before {
1475 transform: rotate(90deg);
1480 /* The hideme class is used on summary tags that contain a span with
1481 placeholder text shown only when the toggle is closed. For instance,
1482 "Expand description" or "Show methods". */
1483 details.rustdoc-toggle > summary.hideme {
1487 details.rustdoc-toggle > summary, details.undocumented > summary {
1490 details.rustdoc-toggle > summary::-webkit-details-marker,
1491 details.rustdoc-toggle > summary::marker,
1492 details.undocumented > summary::-webkit-details-marker,
1493 details.undocumented > summary::marker {
1497 details.rustdoc-toggle > summary.hideme > span {
1501 details.rustdoc-toggle > summary::before {
1505 letter-spacing: 1px;
1509 details.rustdoc-toggle.top-doc > summary,
1510 details.rustdoc-toggle.top-doc > summary::before,
1511 details.rustdoc-toggle.non-exhaustive > summary,
1512 details.rustdoc-toggle.non-exhaustive > summary::before {
1513 font-family: 'Fira Sans';
1517 details.non-exhaustive {
1521 details.rustdoc-toggle > summary.hideme::before {
1525 details.rustdoc-toggle > summary:not(.hideme)::before {
1531 .impl-items > details.rustdoc-toggle > summary:not(.hideme)::before,
1532 .undocumented > details.rustdoc-toggle > summary:not(.hideme)::before {
1537 /* When a "hideme" summary is open and the "Expand description" or "Show
1538 methods" text is hidden, we want the [-] toggle that remains to not
1539 affect the layout of the items to its right. To do that, we use
1540 absolute positioning. Note that we also set position: relative
1541 on the parent <details> to make this work properly. */
1542 details.rustdoc-toggle[open] > summary.hideme {
1546 details.rustdoc-toggle, details.undocumented {
1550 details.rustdoc-toggle[open] > summary.hideme > span {
1554 details.rustdoc-toggle[open] > summary::before {
1559 details.undocumented > summary::before {
1560 content: "[+] Show hidden undocumented items";
1566 details.undocumented[open] > summary::before {
1567 content: "[−] Hide undocumented items";
1572 @media (min-width: 701px) {
1573 /* In case there is no documentation before a code block, we need to add some margin at the top
1574 to prevent an overlay between the "collapse toggle" and the information tooltip.
1575 However, it's not needed with smaller screen width because the doc/code block is always put
1576 "one line" below. */
1577 .docblock > .information:first-child > .tooltip {
1582 @media (max-width: 700px) {
1587 .rustdoc > .sidebar {
1597 .sidebar > .location {
1601 padding: 3px 10px 1px 10px;
1603 background: inherit;
1608 .sidebar .location:empty {
1612 .sidebar .logo-container {
1621 .sidebar .logo-container > img {
1635 border-bottom: 1px solid;
1636 border-right: 1px solid;
1640 .rustdoc.source > .sidebar > .sidebar-menu {
1644 /* We do NOT hide this element so that alternative device readers still have this information
1652 /* We move the sidebar to the left by its own width so it doesn't appear. */
1655 border-right: 1px solid;
1658 .sidebar > .block.version {
1660 border-bottom: none;
1665 .sidebar > .block.version > div.narrow-helper {
1670 .sidebar > .block.version > p {
1671 /* hide Version text if too narrow */
1674 /* vertically center */
1676 align-items: center;
1681 width: calc(100% - 32px);
1699 display: none !important;
1714 #titles > button > div.count {
1727 background-color: rgba(0,0,0,0);
1731 This allows to prevent the version text to overflow the sidebar title on mobile mode when the
1732 sidebar is displayed (after clicking on the "hamburger" button).
1734 .sidebar.mobile > div.version {
1739 width: calc(100% + 30px);
1742 .show-it, .sidebar-elems:focus-within {
1747 .show-it > .block.items {
1751 .show-it > .block.items > ul {
1755 .show-it > .block.items > ul > li {
1760 .show-it > .block.items > ul > li > a {
1764 /* Because of ios, we need to actually have a full height sidebar title so the
1765 * actual sidebar can show up. But then we need to make it transparent so we don't
1766 * hide content. The filler just allows to create the background for the sidebar
1767 * title. But because of the absolute position, I had to lower the z-index.
1772 width: calc(100% - 45px);
1776 border-bottom: 1px solid;
1779 #main > details.rustdoc-toggle > summary::before,
1780 #main > div > details.rustdoc-toggle > summary::before {
1800 #main > .line-numbers {
1804 .notable-traits .notable-traits-tooltiptext {
1809 /* We don't display the help button on mobile devices. */
1814 /* Display an alternating layout on tablets and phones */
1817 flex-flow: column wrap;
1819 .item-left, .item-right {
1823 .search-container > div {
1824 width: calc(100% - 32px);
1827 /* Display an alternating layout on tablets and phones */
1828 .search-results > a {
1829 border-bottom: 1px solid #aaa9;
1832 .search-results .result-name, .search-results div.desc, .search-results .result-description {
1835 .search-results div.desc, .search-results .result-description, .item-right {
1841 nav.sub, .content .out-of-band {
1846 @media (max-width: 464px) {
1847 #titles, #titles > button {
1851 /* This is to prevent the search bar from being underneath the <section>
1852 * element following it.
1858 #main > table:not(.table-display) td {
1859 word-break: break-word;
1863 .search-container > div {
1865 width: calc(100% - 37px);
1874 #crate-search + .search-input {
1875 width: calc(100% + 71px);
1879 #theme-picker, #settings-menu {