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;
350 border-bottom: 1px solid;
351 overflow-wrap: break-word;
352 word-wrap: break-word; /* deprecated */
353 word-break: break-word; /* Chrome, non-standard */
360 .location a:first-of-type {
364 text-decoration: underline;
371 .block h2, .block h3 {
374 .block ul, .block li {
382 text-overflow: ellipsis;
388 transition: border 500ms ease-out;
392 border-top: 1px solid;
393 border-bottom: 1px solid;
416 .source .content pre.rust {
422 .rustdoc .example-wrap {
423 display: inline-flex;
432 .example-wrap > pre.line-number {
437 border-top-left-radius: 5px;
438 border-bottom-left-radius: 5px;
441 .rustdoc:not(.source) .example-wrap > pre:not(.line-number) {
446 .rustdoc .example-wrap > pre {
460 .content > .example-wrap pre.line-numbers {
462 -webkit-user-select: none;
463 -moz-user-select: none;
464 -ms-user-select: none;
472 overflow-wrap: anywhere;
480 text-overflow: ellipsis;
483 /* Wrap non-pre code blocks (`text`) but not (```text```). */
484 .docblock > :not(pre) > code,
485 .docblock-short > :not(pre) > code {
486 white-space: pre-wrap;
489 .docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5 {
490 border-bottom: 1px solid;
493 .top-doc .docblock h1 { font-size: 1.3em; }
494 .top-doc .docblock h2 { font-size: 1.15em; }
495 .top-doc .docblock h3,
496 .top-doc .docblock h4,
497 .top-doc .docblock h5 {
501 .docblock h1 { font-size: 1em; }
502 .docblock h2 { font-size: 0.95em; }
503 .docblock h3, .docblock h4, .docblock h5 { font-size: 0.9em; }
510 .content .out-of-band {
519 .method > code, .trait-impl > code, .invisible > code {
520 max-width: calc(100% - 41px);
526 display: inline-block;
536 display: inline-block;
544 font-family: "Fira Sans", Arial, sans-serif;
547 .content table:not(.table-display) {
548 border-spacing: 0 5px;
550 .content td { vertical-align: top; }
551 .content td:first-child { padding-right: 20px; }
552 .content td p:first-child { margin-top: 0; }
553 .content td h1, .content td h2 { margin-left: 0; font-size: 1.1em; }
554 .content tr:first-child td { border-top: 0; }
558 width: calc(100% - 2px);
577 .content .item-list {
578 list-style-type: none;
582 .content .multi-column {
583 -moz-column-count: 5;
584 -moz-column-gap: 2.5em;
585 -webkit-column-count: 5;
586 -webkit-column-gap: 2.5em;
590 .content .multi-column li { width: 100%; display: inline-block; }
592 .content > .methods > .method {
596 /* Shift "where ..." part of method or fn definition down a line */
597 .content .method .where,
599 .content .where.fmt-newline {
604 .content .methods > div:not(.notable-traits):not(.method) {
609 .content .docblock > .impl-items {
613 .content .docblock >.impl-items .table-display {
616 .content .docblock >.impl-items table td {
619 .content .docblock > .impl-items .table-display, .impl-items table td {
623 .content .item-info code {
627 .content .item-info {
632 .sub-variant > div > .item-info {
636 .content .item-info::before {
644 .content .impl-items .method, .content .impl-items > .type, .impl-items > .associatedconstant,
645 .impl-items > .associatedtype, .content .impl-items details > summary > .type,
646 .impl-items details > summary > .associatedconstant,
647 .impl-items details > summary > .associatedtype {
651 .content .impl-items .docblock, .content .impl-items .item-info {
655 .content .impl-items > .item-info {
659 .methods > .item-info, .content .impl-items > .item-info {
672 border-bottom: 1px solid;
673 padding-bottom: 10px;
681 border-top: 1px solid;
682 border-bottom: 1px solid;
684 nav.main .separator {
686 display: inline-block;
690 nav.sum { text-align: right; }
691 nav.sub form { display: inline; }
698 text-decoration: none;
699 background: transparent;
702 .small-section-header {
704 justify-content: space-between;
708 .small-section-header:hover > .anchor {
712 .in-band:hover > .anchor, .impl:hover > .anchor, .method.trait-impl:hover > .anchor,
713 .type.trait-impl:hover > .anchor, .associatedconstant.trait-impl:hover > .anchor,
714 .associatedtype.trait-impl:hover > .anchor {
715 display: inline-block;
726 .small-section-header > .anchor {
728 padding-right: 10px; /* avoid gap that causes hover to disappear */
731 content: '\2002\00a7\2002';
734 .docblock a:not(.srclink):not(.test-arrow):hover,
735 .docblock-short a:not(.srclink):not(.test-arrow):hover, .item-info a {
736 text-decoration: underline;
739 .invisible > .srclink,
740 .method > code + .srclink {
748 .block a.current.crate { font-weight: 500; }
754 grid-template-columns: auto 1fr;
755 /* align content left */
756 justify-items: start;
759 .item-left, .item-right {
772 .search-container > div {
773 display: inline-flex;
774 width: calc(100% - 63px);
784 border-radius: 4px 0 0 4px;
787 border-right: 1px solid;
788 -moz-appearance: none;
789 -webkit-appearance: none;
790 /* Removes default arrow from firefox */
793 background-repeat: no-repeat;
794 background-color: transparent;
795 background-size: 20px;
796 background-position: calc(100% - 1px) 56%;
798 .search-container > .top-button {
804 /* Override Normalize.css: we have margins and do
805 not want to overflow - the `moz` attribute is necessary
806 until Firefox 29, too early to drop at this point */
807 -moz-box-sizing: border-box !important;
808 box-sizing: border-box !important;
815 transition: border-color 300ms ease;
816 transition: border-radius 300ms ease-in-out;
817 transition: box-shadow 300ms ease-in-out;
821 #crate-search + .search-input {
822 border-radius: 0 1px 1px 0;
823 width: calc(100% - 32px);
826 .search-input:focus {
837 .search-results.active {
839 /* prevent overhanging tabs from moving the first result */
843 .search-results .desc > span {
845 text-overflow: ellipsis;
850 .search-results > a {
853 /* A little margin ensures the browser's outlining of focused links has room to display. */
856 border-bottom: 1px solid #aaa3;
859 .search-results > a > div {
864 .search-results .result-name, .search-results div.desc, .search-results .result-description {
867 .search-results .result-name {
871 .search-results .result-name > span {
872 display: inline-block;
877 body.blur > :not(#help) {
879 -webkit-filter: blur(8px);
890 justify-content: center;
895 box-shadow: 0 0 6px rgba(0,0,0,.2);
904 margin-right: 0.5rem;
911 border-bottom: 1px solid #ccc;
915 #help dd { margin: 5px 35px; }
916 #help .infos { padding-left: 0; }
917 #help h1, #help h2 { margin-top: 0; }
921 padding: 0 20px 20px 17px;;
943 /* Black one-pixel outline around emoji shapes */
955 display: inline-block;
961 vertical-align: text-bottom;
964 .module-item.unstable,
965 .import-item.unstable {
974 .impl-items .since, .impl .since, .methods .since {
980 .impl-items .srclink, .impl .srclink, .methods .srclink {
981 /* Override header settings otherwise it's too bold */
993 /* Push the src link out to the right edge consistently */
994 justify-content: space-between;
1001 .variants_table tbody tr td:first-child {
1002 width: 1%; /* make the variant name as small as possible */
1013 pre.rust .question-mark {
1018 display: inline-block;
1020 padding: 5px 10px 5px 10px;
1028 text-decoration: none;
1031 .section-header:hover a:before {
1034 padding-right: 10px; /* avoid gap that causes hover to disappear */
1035 content: '\2002\00a7\2002';
1038 .section-header:hover a {
1039 text-decoration: none;
1059 .out-of-band > span.since {
1065 .sub-variant, .sub-variant > h3 {
1066 margin-top: 0px !important;
1070 #main > details > .sub-variant > h3 {
1076 .sub-variant > div {
1078 margin-bottom: 10px;
1081 .sub-variant > div > span {
1087 display: inline-block;
1092 .docblock > .section-header:first-child {
1097 .docblock > .section-header:first-child:hover > a:before {
1118 display: inline-block;
1125 padding: 5px 3px 3px 3px;
1131 .tooltip.ignore::after {
1132 content: "This example is not tested";
1134 .tooltip.compile_fail::after {
1135 content: "This example deliberately fails to compile";
1137 .tooltip.should_panic::after {
1138 content: "This example panics";
1140 .tooltip.edition::after {
1141 content: "This code runs with edition " attr(data-edition);
1151 border-style: solid;
1155 .tooltip:hover::before, .tooltip:hover::after {
1159 .tooltip.compile_fail, .tooltip.should_panic, .tooltip.ignore {
1164 .notable-traits-tooltip {
1165 display: inline-block;
1169 .notable-traits:hover .notable-traits-tooltiptext,
1170 .notable-traits .notable-traits-tooltiptext.force-tooltip {
1171 display: inline-block;
1174 .notable-traits .notable-traits-tooltiptext {
1176 padding: 5px 3px 3px 3px;
1186 .notable-traits-tooltip::after {
1187 /* The margin on the tooltip does not capture hover events,
1188 this extends the area of hover enough so that mouse hover is not
1189 lost when moving the mouse to the tooltip */
1190 content: "\00a0\00a0\00a0";
1193 .notable-traits .notable, .notable-traits .docblock {
1197 .notable-traits .notable {
1199 margin-bottom: 13px;
1204 .notable-traits .docblock code.content{
1210 /* Example code has the "Run" button that needs to be positioned relative to the pre */
1211 pre.rust.rust-example-rendered {
1226 .search-failed.active {
1230 .search-failed > ul {
1248 border-top: 2px solid;
1251 #titles > button:not(:last-child) {
1253 width: calc(33.3% - 1px);
1256 #titles > button > div.count {
1257 display: inline-block;
1271 margin-bottom: 10px;
1285 border-top-right-radius: 3px;
1286 border-bottom-right-radius: 3px;
1289 transition: left .5s;
1302 transition: left .5s;
1303 border-right: 1px solid;
1305 #source-sidebar > .title {
1308 border-bottom: 1px solid;
1318 .theme-picker button {
1322 #settings-menu, #help-button {
1332 #theme-picker, #settings-menu, #help-button, #copy-path {
1343 font-family: "Fira Sans", Arial, sans-serif;
1350 background: initial;
1368 #theme-choices > button {
1373 background: rgba(0,0,0,0);
1376 #theme-choices > button:not(:first-child) {
1377 border-top: 1px solid;
1381 display: inline-block;
1383 font: 15px monospace;
1385 vertical-align: middle;
1388 box-shadow: inset 0 -1px 0;
1392 .hidden-by-impl-hider,
1393 .hidden-by-usual-hider {
1394 /* important because of conflicting rule for small screens */
1395 display: none !important;
1398 #implementations-list > h3 > span.in-band {
1405 border-collapse: collapse;
1410 .table-display tr td:first-child {
1414 .table-display tr td:last-child {
1417 .table-display .out-of-band {
1422 #implementors-list > .impl-items .table-display .out-of-band {
1426 .table-display td:hover .anchor {
1456 div.files > a:hover, div.name:hover {
1457 background-color: #a14b4b;
1459 div.name.expand + .children {
1470 div.name.expand::before {
1471 transform: rotate(90deg);
1476 /* The hideme class is used on summary tags that contain a span with
1477 placeholder text shown only when the toggle is closed. For instance,
1478 "Expand description" or "Show methods". */
1479 details.rustdoc-toggle > summary.hideme {
1483 details.rustdoc-toggle > summary, details.undocumented > summary {
1486 details.rustdoc-toggle > summary::-webkit-details-marker,
1487 details.rustdoc-toggle > summary::marker,
1488 details.undocumented > summary::-webkit-details-marker,
1489 details.undocumented > summary::marker {
1493 details.rustdoc-toggle > summary.hideme > span {
1497 details.rustdoc-toggle > summary::before {
1501 letter-spacing: 1px;
1505 details.rustdoc-toggle.top-doc > summary,
1506 details.rustdoc-toggle.top-doc > summary::before,
1507 details.rustdoc-toggle.non-exhaustive > summary,
1508 details.rustdoc-toggle.non-exhaustive > summary::before {
1509 font-family: 'Fira Sans';
1513 details.non-exhaustive {
1517 details.rustdoc-toggle > summary.hideme::before {
1521 details.rustdoc-toggle > summary:not(.hideme)::before {
1527 .impl-items > details.rustdoc-toggle > summary:not(.hideme)::before,
1528 .undocumented > details.rustdoc-toggle > summary:not(.hideme)::before {
1533 /* When a "hideme" summary is open and the "Expand description" or "Show
1534 methods" text is hidden, we want the [-] toggle that remains to not
1535 affect the layout of the items to its right. To do that, we use
1536 absolute positioning. Note that we also set position: relative
1537 on the parent <details> to make this work properly. */
1538 details.rustdoc-toggle[open] > summary.hideme {
1542 details.rustdoc-toggle, details.undocumented {
1546 details.rustdoc-toggle[open] > summary.hideme > span {
1550 details.rustdoc-toggle[open] > summary::before {
1555 details.undocumented > summary::before {
1556 content: "[+] Show hidden undocumented items";
1562 details.undocumented[open] > summary::before {
1563 content: "[−] Hide undocumented items";
1568 @media (min-width: 701px) {
1569 /* In case there is no documentation before a code block, we need to add some margin at the top
1570 to prevent an overlay between the "collapse toggle" and the information tooltip.
1571 However, it's not needed with smaller screen width because the doc/code block is always put
1572 "one line" below. */
1573 .docblock > .information:first-child > .tooltip {
1578 @media (max-width: 700px) {
1583 .rustdoc > .sidebar {
1593 .sidebar > .location {
1597 padding: 3px 10px 1px 10px;
1599 background: inherit;
1604 .sidebar .location:empty {
1608 .sidebar .logo-container {
1617 .sidebar .logo-container > img {
1631 border-bottom: 1px solid;
1632 border-right: 1px solid;
1636 .rustdoc.source > .sidebar > .sidebar-menu {
1640 /* We do NOT hide this element so that alternative device readers still have this information
1648 /* We move the sidebar to the left by its own width so it doesn't appear. */
1651 border-right: 1px solid;
1654 .sidebar > .block.version {
1656 border-bottom: none;
1661 .sidebar > .block.version > div.narrow-helper {
1666 .sidebar > .block.version > p {
1667 /* hide Version text if too narrow */
1670 /* vertically center */
1672 align-items: center;
1677 width: calc(100% - 32px);
1695 display: none !important;
1710 #titles > button > div.count {
1723 background-color: rgba(0,0,0,0);
1727 This allows to prevent the version text to overflow the sidebar title on mobile mode when the
1728 sidebar is displayed (after clicking on the "hamburger" button).
1730 .sidebar.mobile > div.version {
1735 width: calc(100% + 30px);
1738 .show-it, .sidebar-elems:focus-within {
1743 .show-it > .block.items {
1747 .show-it > .block.items > ul {
1751 .show-it > .block.items > ul > li {
1756 .show-it > .block.items > ul > li > a {
1760 /* Because of ios, we need to actually have a full height sidebar title so the
1761 * actual sidebar can show up. But then we need to make it transparent so we don't
1762 * hide content. The filler just allows to create the background for the sidebar
1763 * title. But because of the absolute position, I had to lower the z-index.
1768 width: calc(100% - 45px);
1772 border-bottom: 1px solid;
1775 #main > details.rustdoc-toggle > summary::before,
1776 #main > div > details.rustdoc-toggle > summary::before {
1796 #main > .line-numbers {
1800 .notable-traits .notable-traits-tooltiptext {
1805 /* We don't display the help button on mobile devices. */
1810 /* Display an alternating layout on tablets and phones */
1813 flex-flow: column wrap;
1815 .item-left, .item-right {
1819 .search-container > div {
1820 width: calc(100% - 32px);
1823 /* Display an alternating layout on tablets and phones */
1824 .search-results > a {
1825 border-bottom: 1px solid #aaa9;
1828 .search-results .result-name, .search-results div.desc, .search-results .result-description {
1831 .search-results div.desc, .search-results .result-description, .item-right {
1837 nav.sub, .content .out-of-band {
1842 @media (max-width: 464px) {
1843 #titles, #titles > button {
1847 /* This is to prevent the search bar from being underneath the <section>
1848 * element following it.
1854 #main > table:not(.table-display) td {
1855 word-break: break-word;
1859 .search-container > div {
1861 width: calc(100% - 37px);
1870 #crate-search + .search-input {
1871 width: calc(100% + 71px);
1875 #theme-picker, #settings-menu {