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;;
940 /* Black one-pixel outline around emoji shapes */
952 display: inline-block;
958 vertical-align: text-bottom;
961 .module-item.unstable,
962 .import-item.unstable {
971 .impl-items .since, .impl .since, .methods .since {
977 .impl-items .srclink, .impl .srclink, .methods .srclink {
978 /* Override header settings otherwise it's too bold */
990 /* Push the src link out to the right edge consistently */
991 justify-content: space-between;
998 .variants_table tbody tr td:first-child {
999 width: 1%; /* make the variant name as small as possible */
1010 pre.rust .question-mark {
1015 display: inline-block;
1017 padding: 5px 10px 5px 10px;
1025 text-decoration: none;
1028 .section-header:hover a:before {
1031 padding-right: 10px; /* avoid gap that causes hover to disappear */
1032 content: '\2002\00a7\2002';
1035 .section-header:hover a {
1036 text-decoration: none;
1056 .out-of-band > span.since {
1062 .sub-variant, .sub-variant > h3 {
1063 margin-top: 0px !important;
1067 #main > details > .sub-variant > h3 {
1073 .sub-variant > div {
1075 margin-bottom: 10px;
1078 .sub-variant > div > span {
1084 display: inline-block;
1089 .docblock > .section-header:first-child {
1094 .docblock > .section-header:first-child:hover > a:before {
1115 display: inline-block;
1122 padding: 5px 3px 3px 3px;
1128 .tooltip.ignore::after {
1129 content: "This example is not tested";
1131 .tooltip.compile_fail::after {
1132 content: "This example deliberately fails to compile";
1134 .tooltip.should_panic::after {
1135 content: "This example panics";
1137 .tooltip.edition::after {
1138 content: "This code runs with edition " attr(data-edition);
1148 border-style: solid;
1152 .tooltip:hover::before, .tooltip:hover::after {
1156 .tooltip.compile_fail, .tooltip.should_panic, .tooltip.ignore {
1161 .notable-traits-tooltip {
1162 display: inline-block;
1166 .notable-traits:hover .notable-traits-tooltiptext,
1167 .notable-traits .notable-traits-tooltiptext.force-tooltip {
1168 display: inline-block;
1171 .notable-traits .notable-traits-tooltiptext {
1173 padding: 5px 3px 3px 3px;
1183 .notable-traits-tooltip::after {
1184 /* The margin on the tooltip does not capture hover events,
1185 this extends the area of hover enough so that mouse hover is not
1186 lost when moving the mouse to the tooltip */
1187 content: "\00a0\00a0\00a0";
1190 .notable-traits .notable, .notable-traits .docblock {
1194 .notable-traits .notable {
1196 margin-bottom: 13px;
1201 .notable-traits .docblock code.content{
1207 /* Example code has the "Run" button that needs to be positioned relative to the pre */
1208 pre.rust.rust-example-rendered {
1223 .search-failed.active {
1227 .search-failed > ul {
1245 border-top: 2px solid;
1248 #titles > button:not(:last-child) {
1250 width: calc(33.3% - 1px);
1253 #titles > button > div.count {
1254 display: inline-block;
1268 margin-bottom: 10px;
1282 border-top-right-radius: 3px;
1283 border-bottom-right-radius: 3px;
1286 transition: left .5s;
1299 transition: left .5s;
1300 border-right: 1px solid;
1302 #source-sidebar > .title {
1305 border-bottom: 1px solid;
1315 .theme-picker button {
1319 #settings-menu, #help-button {
1329 #theme-picker, #settings-menu, #help-button, #copy-path {
1340 font-family: "Fira Sans", Arial, sans-serif;
1347 background: initial;
1365 #theme-choices > button {
1370 background: rgba(0,0,0,0);
1373 #theme-choices > button:not(:first-child) {
1374 border-top: 1px solid;
1378 display: inline-block;
1380 font: 15px monospace;
1382 vertical-align: middle;
1385 box-shadow: inset 0 -1px 0;
1389 .hidden-by-impl-hider,
1390 .hidden-by-usual-hider {
1391 /* important because of conflicting rule for small screens */
1392 display: none !important;
1395 #implementations-list > h3 > span.in-band {
1402 border-collapse: collapse;
1407 .table-display tr td:first-child {
1411 .table-display tr td:last-child {
1414 .table-display .out-of-band {
1419 #implementors-list > .impl-items .table-display .out-of-band {
1423 .table-display td:hover .anchor {
1453 div.files > a:hover, div.name:hover {
1454 background-color: #a14b4b;
1456 div.name.expand + .children {
1467 div.name.expand::before {
1468 transform: rotate(90deg);
1473 /* The hideme class is used on summary tags that contain a span with
1474 placeholder text shown only when the toggle is closed. For instance,
1475 "Expand description" or "Show methods". */
1476 details.rustdoc-toggle > summary.hideme {
1480 details.rustdoc-toggle > summary, details.undocumented > summary {
1483 details.rustdoc-toggle > summary::-webkit-details-marker,
1484 details.rustdoc-toggle > summary::marker,
1485 details.undocumented > summary::-webkit-details-marker,
1486 details.undocumented > summary::marker {
1490 details.rustdoc-toggle > summary.hideme > span {
1494 details.rustdoc-toggle > summary::before {
1498 letter-spacing: 1px;
1502 details.rustdoc-toggle.top-doc > summary,
1503 details.rustdoc-toggle.top-doc > summary::before,
1504 details.rustdoc-toggle.non-exhaustive > summary,
1505 details.rustdoc-toggle.non-exhaustive > summary::before {
1506 font-family: 'Fira Sans';
1510 details.non-exhaustive {
1514 details.rustdoc-toggle > summary.hideme::before {
1518 details.rustdoc-toggle > summary:not(.hideme)::before {
1524 .impl-items > details.rustdoc-toggle > summary:not(.hideme)::before,
1525 .undocumented > details.rustdoc-toggle > summary:not(.hideme)::before {
1530 /* When a "hideme" summary is open and the "Expand description" or "Show
1531 methods" text is hidden, we want the [-] toggle that remains to not
1532 affect the layout of the items to its right. To do that, we use
1533 absolute positioning. Note that we also set position: relative
1534 on the parent <details> to make this work properly. */
1535 details.rustdoc-toggle[open] > summary.hideme {
1539 details.rustdoc-toggle, details.undocumented {
1543 details.rustdoc-toggle[open] > summary.hideme > span {
1547 details.rustdoc-toggle[open] > summary::before {
1552 details.undocumented > summary::before {
1553 content: "[+] Show hidden undocumented items";
1559 details.undocumented[open] > summary::before {
1560 content: "[−] Hide undocumented items";
1565 @media (min-width: 701px) {
1566 /* In case there is no documentation before a code block, we need to add some margin at the top
1567 to prevent an overlay between the "collapse toggle" and the information tooltip.
1568 However, it's not needed with smaller screen width because the doc/code block is always put
1569 "one line" below. */
1570 .docblock > .information:first-child > .tooltip {
1575 @media (max-width: 700px) {
1580 .rustdoc > .sidebar {
1590 .sidebar > .location {
1594 padding: 3px 10px 1px 10px;
1596 background: inherit;
1601 .sidebar .location:empty {
1605 .sidebar .logo-container {
1614 .sidebar .logo-container > img {
1628 border-bottom: 1px solid;
1629 border-right: 1px solid;
1633 .rustdoc.source > .sidebar > .sidebar-menu {
1637 /* We do NOT hide this element so that alternative device readers still have this information
1645 /* We move the sidebar to the left by its own width so it doesn't appear. */
1648 border-right: 1px solid;
1651 .sidebar > .block.version {
1653 border-bottom: none;
1658 .sidebar > .block.version > div.narrow-helper {
1663 .sidebar > .block.version > p {
1664 /* hide Version text if too narrow */
1667 /* vertically center */
1669 align-items: center;
1674 width: calc(100% - 32px);
1692 display: none !important;
1707 #titles > button > div.count {
1720 background-color: rgba(0,0,0,0);
1724 This allows to prevent the version text to overflow the sidebar title on mobile mode when the
1725 sidebar is displayed (after clicking on the "hamburger" button).
1727 .sidebar.mobile > div.version {
1732 width: calc(100% + 30px);
1735 .show-it, .sidebar-elems:focus-within {
1740 .show-it > .block.items {
1744 .show-it > .block.items > ul {
1748 .show-it > .block.items > ul > li {
1753 .show-it > .block.items > ul > li > a {
1757 /* Because of ios, we need to actually have a full height sidebar title so the
1758 * actual sidebar can show up. But then we need to make it transparent so we don't
1759 * hide content. The filler just allows to create the background for the sidebar
1760 * title. But because of the absolute position, I had to lower the z-index.
1765 width: calc(100% - 45px);
1769 border-bottom: 1px solid;
1772 #main > details.rustdoc-toggle > summary::before,
1773 #main > div > details.rustdoc-toggle > summary::before {
1793 #main > .line-numbers {
1797 .notable-traits .notable-traits-tooltiptext {
1802 /* We don't display the help button on mobile devices. */
1807 /* Display an alternating layout on tablets and phones */
1810 flex-flow: column wrap;
1812 .item-left, .item-right {
1816 .search-container > div {
1817 width: calc(100% - 32px);
1820 /* Display an alternating layout on tablets and phones */
1821 .search-results > a {
1822 border-bottom: 1px solid #aaa9;
1825 .search-results .result-name, .search-results div.desc, .search-results .result-description {
1828 .search-results div.desc, .search-results .result-description, .item-right {
1834 nav.sub, .content .out-of-band {
1839 @media (max-width: 464px) {
1840 #titles, #titles > button {
1844 /* This is to prevent the search bar from being underneath the <section>
1845 * element following it.
1851 #main > table:not(.table-display) td {
1852 word-break: break-word;
1856 .search-container > div {
1858 width: calc(100% - 37px);
1867 #crate-search + .search-input {
1868 width: calc(100% + 71px);
1872 #theme-picker, #settings-menu {