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);
582 .content .item-list {
583 list-style-type: none;
587 .content .multi-column {
588 -moz-column-count: 5;
589 -moz-column-gap: 2.5em;
590 -webkit-column-count: 5;
591 -webkit-column-gap: 2.5em;
595 .content .multi-column li { width: 100%; display: inline-block; }
597 .content > .methods > .method {
601 /* Shift "where ..." part of method or fn definition down a line */
602 .content .method .where,
604 .content .where.fmt-newline {
609 .content .methods > div:not(.notable-traits):not(.method) {
614 .content .docblock > .impl-items {
618 .content .docblock >.impl-items .table-display {
621 .content .docblock >.impl-items table td {
624 .content .docblock > .impl-items .table-display, .impl-items table td {
628 .content .item-info code {
632 .content .item-info {
637 .sub-variant > div > .item-info {
641 .content .item-info::before {
649 .content .impl-items .method, .content .impl-items > .type, .impl-items > .associatedconstant,
650 .impl-items > .associatedtype, .content .impl-items details > summary > .type,
651 .impl-items details > summary > .associatedconstant,
652 .impl-items details > summary > .associatedtype {
656 .content .impl-items .docblock, .content .impl-items .item-info {
660 .content .impl-items > .item-info {
664 .methods > .item-info, .content .impl-items > .item-info {
677 border-bottom: 1px solid;
678 padding-bottom: 10px;
686 border-top: 1px solid;
687 border-bottom: 1px solid;
689 nav.main .separator {
691 display: inline-block;
695 nav.sum { text-align: right; }
696 nav.sub form { display: inline; }
703 text-decoration: none;
704 background: transparent;
707 .small-section-header {
709 justify-content: space-between;
713 .small-section-header:hover > .anchor {
717 .in-band:hover > .anchor, .impl:hover > .anchor, .method.trait-impl:hover > .anchor,
718 .type.trait-impl:hover > .anchor, .associatedconstant.trait-impl:hover > .anchor,
719 .associatedtype.trait-impl:hover > .anchor {
720 display: inline-block;
731 .small-section-header > .anchor {
733 padding-right: 10px; /* avoid gap that causes hover to disappear */
736 content: '\2002\00a7\2002';
739 .docblock a:not(.srclink):not(.test-arrow):hover,
740 .docblock-short a:not(.srclink):not(.test-arrow):hover, .item-info a {
741 text-decoration: underline;
744 .invisible > .srclink,
745 .method > code + .srclink {
753 .block a.current.crate { font-weight: 500; }
759 grid-template-columns: auto 1fr;
760 /* align content left */
761 justify-items: start;
764 .item-left, .item-right {
777 .search-container > div {
778 display: inline-flex;
779 width: calc(100% - 63px);
789 border-radius: 4px 0 0 4px;
792 border-right: 1px solid;
793 -moz-appearance: none;
794 -webkit-appearance: none;
795 /* Removes default arrow from firefox */
798 background-repeat: no-repeat;
799 background-color: transparent;
800 background-size: 20px;
801 background-position: calc(100% - 1px) 56%;
803 .search-container > .top-button {
809 /* Override Normalize.css: we have margins and do
810 not want to overflow - the `moz` attribute is necessary
811 until Firefox 29, too early to drop at this point */
812 -moz-box-sizing: border-box !important;
813 box-sizing: border-box !important;
820 transition: border-color 300ms ease;
821 transition: border-radius 300ms ease-in-out;
822 transition: box-shadow 300ms ease-in-out;
826 #crate-search + .search-input {
827 border-radius: 0 1px 1px 0;
828 width: calc(100% - 32px);
831 .search-input:focus {
842 .search-results.active {
844 /* prevent overhanging tabs from moving the first result */
848 .search-results .desc > span {
850 text-overflow: ellipsis;
855 .search-results > a {
858 /* A little margin ensures the browser's outlining of focused links has room to display. */
861 border-bottom: 1px solid #aaa3;
864 .search-results > a > div {
869 .search-results .result-name, .search-results div.desc, .search-results .result-description {
872 .search-results .result-name {
876 .search-results .result-name > span {
877 display: inline-block;
882 body.blur > :not(#help) {
884 -webkit-filter: blur(8px);
895 justify-content: center;
900 box-shadow: 0 0 6px rgba(0,0,0,.2);
909 margin-right: 0.5rem;
916 border-bottom: 1px solid #ccc;
920 #help dd { margin: 5px 35px; }
921 #help .infos { padding-left: 0; }
922 #help h1, #help h2 { margin-top: 0; }
926 padding: 0 20px 20px 17px;;
948 /* Black one-pixel outline around emoji shapes */
960 display: inline-block;
966 vertical-align: text-bottom;
969 .module-item.unstable,
970 .import-item.unstable {
979 .impl-items .since, .impl .since, .methods .since {
985 .impl-items .srclink, .impl .srclink, .methods .srclink {
986 /* Override header settings otherwise it's too bold */
998 /* Push the src link out to the right edge consistently */
999 justify-content: space-between;
1006 .variants_table tbody tr td:first-child {
1007 width: 1%; /* make the variant name as small as possible */
1018 pre.rust .question-mark {
1023 display: inline-block;
1025 padding: 5px 10px 5px 10px;
1033 text-decoration: none;
1036 .section-header:hover a:before {
1039 padding-right: 10px; /* avoid gap that causes hover to disappear */
1040 content: '\2002\00a7\2002';
1043 .section-header:hover a {
1044 text-decoration: none;
1064 .out-of-band > span.since {
1070 .sub-variant, .sub-variant > h3 {
1071 margin-top: 0px !important;
1075 #main > details > .sub-variant > h3 {
1081 .sub-variant > div {
1083 margin-bottom: 10px;
1086 .sub-variant > div > span {
1092 display: inline-block;
1097 .docblock > .section-header:first-child {
1102 .docblock > .section-header:first-child:hover > a:before {
1123 display: inline-block;
1130 padding: 5px 3px 3px 3px;
1136 .tooltip.ignore::after {
1137 content: "This example is not tested";
1139 .tooltip.compile_fail::after {
1140 content: "This example deliberately fails to compile";
1142 .tooltip.should_panic::after {
1143 content: "This example panics";
1145 .tooltip.edition::after {
1146 content: "This code runs with edition " attr(data-edition);
1156 border-style: solid;
1160 .tooltip:hover::before, .tooltip:hover::after {
1164 .tooltip.compile_fail, .tooltip.should_panic, .tooltip.ignore {
1169 .notable-traits-tooltip {
1170 display: inline-block;
1174 .notable-traits:hover .notable-traits-tooltiptext,
1175 .notable-traits .notable-traits-tooltiptext.force-tooltip {
1176 display: inline-block;
1179 .notable-traits .notable-traits-tooltiptext {
1181 padding: 5px 3px 3px 3px;
1191 .notable-traits-tooltip::after {
1192 /* The margin on the tooltip does not capture hover events,
1193 this extends the area of hover enough so that mouse hover is not
1194 lost when moving the mouse to the tooltip */
1195 content: "\00a0\00a0\00a0";
1198 .notable-traits .notable, .notable-traits .docblock {
1202 .notable-traits .notable {
1204 margin-bottom: 13px;
1209 .notable-traits .docblock code.content{
1215 /* Example code has the "Run" button that needs to be positioned relative to the pre */
1216 pre.rust.rust-example-rendered {
1231 .search-failed.active {
1235 .search-failed > ul {
1253 border-top: 2px solid;
1256 #titles > button:not(:last-child) {
1258 width: calc(33.3% - 1px);
1261 #titles > button > div.count {
1262 display: inline-block;
1276 margin-bottom: 10px;
1290 border-top-right-radius: 3px;
1291 border-bottom-right-radius: 3px;
1294 transition: left .5s;
1307 transition: left .5s;
1308 border-right: 1px solid;
1310 #source-sidebar > .title {
1313 border-bottom: 1px solid;
1323 .theme-picker button {
1327 #settings-menu, #help-button {
1337 #theme-picker, #settings-menu, #help-button, #copy-path {
1348 font-family: "Fira Sans", Arial, sans-serif;
1355 background: initial;
1373 #theme-choices > button {
1378 background: rgba(0,0,0,0);
1381 #theme-choices > button:not(:first-child) {
1382 border-top: 1px solid;
1386 display: inline-block;
1388 font: 15px monospace;
1390 vertical-align: middle;
1393 box-shadow: inset 0 -1px 0;
1397 .hidden-by-impl-hider,
1398 .hidden-by-usual-hider {
1399 /* important because of conflicting rule for small screens */
1400 display: none !important;
1403 #implementations-list > h3 > span.in-band {
1410 border-collapse: collapse;
1415 .table-display tr td:first-child {
1419 .table-display tr td:last-child {
1422 .table-display .out-of-band {
1427 #implementors-list > .impl-items .table-display .out-of-band {
1431 .table-display td:hover .anchor {
1461 div.files > a:hover, div.name:hover {
1462 background-color: #a14b4b;
1464 div.name.expand + .children {
1475 div.name.expand::before {
1476 transform: rotate(90deg);
1481 /* The hideme class is used on summary tags that contain a span with
1482 placeholder text shown only when the toggle is closed. For instance,
1483 "Expand description" or "Show methods". */
1484 details.rustdoc-toggle > summary.hideme {
1488 details.rustdoc-toggle > summary, details.undocumented > summary {
1491 details.rustdoc-toggle > summary::-webkit-details-marker,
1492 details.rustdoc-toggle > summary::marker,
1493 details.undocumented > summary::-webkit-details-marker,
1494 details.undocumented > summary::marker {
1498 details.rustdoc-toggle > summary.hideme > span {
1502 details.rustdoc-toggle > summary::before {
1506 letter-spacing: 1px;
1510 details.rustdoc-toggle.top-doc > summary,
1511 details.rustdoc-toggle.top-doc > summary::before,
1512 details.rustdoc-toggle.non-exhaustive > summary,
1513 details.rustdoc-toggle.non-exhaustive > summary::before {
1514 font-family: 'Fira Sans';
1518 details.non-exhaustive {
1522 details.rustdoc-toggle > summary.hideme::before {
1526 details.rustdoc-toggle > summary:not(.hideme)::before {
1532 .impl-items > details.rustdoc-toggle > summary:not(.hideme)::before,
1533 .undocumented > details.rustdoc-toggle > summary:not(.hideme)::before {
1538 /* When a "hideme" summary is open and the "Expand description" or "Show
1539 methods" text is hidden, we want the [-] toggle that remains to not
1540 affect the layout of the items to its right. To do that, we use
1541 absolute positioning. Note that we also set position: relative
1542 on the parent <details> to make this work properly. */
1543 details.rustdoc-toggle[open] > summary.hideme {
1547 details.rustdoc-toggle, details.undocumented {
1551 details.rustdoc-toggle[open] > summary.hideme > span {
1555 details.rustdoc-toggle[open] > summary::before {
1560 details.undocumented > summary::before {
1561 content: "[+] Show hidden undocumented items";
1567 details.undocumented[open] > summary::before {
1568 content: "[−] Hide undocumented items";
1573 @media (min-width: 701px) {
1574 /* In case there is no documentation before a code block, we need to add some margin at the top
1575 to prevent an overlay between the "collapse toggle" and the information tooltip.
1576 However, it's not needed with smaller screen width because the doc/code block is always put
1577 "one line" below. */
1578 .docblock > .information:first-child > .tooltip {
1583 @media (max-width: 700px) {
1588 .rustdoc > .sidebar {
1598 .sidebar > .location {
1602 padding: 3px 10px 1px 10px;
1604 background: inherit;
1609 .sidebar .location:empty {
1613 .sidebar .logo-container {
1622 .sidebar .logo-container > img {
1636 border-bottom: 1px solid;
1637 border-right: 1px solid;
1641 .rustdoc.source > .sidebar > .sidebar-menu {
1645 /* We do NOT hide this element so that alternative device readers still have this information
1653 /* We move the sidebar to the left by its own width so it doesn't appear. */
1656 border-right: 1px solid;
1659 .sidebar > .block.version {
1661 border-bottom: none;
1666 .sidebar > .block.version > div.narrow-helper {
1671 .sidebar > .block.version > p {
1672 /* hide Version text if too narrow */
1675 /* vertically center */
1677 align-items: center;
1682 width: calc(100% - 32px);
1700 display: none !important;
1715 #titles > button > div.count {
1728 background-color: rgba(0,0,0,0);
1732 This allows to prevent the version text to overflow the sidebar title on mobile mode when the
1733 sidebar is displayed (after clicking on the "hamburger" button).
1735 .sidebar.mobile > div.version {
1740 width: calc(100% + 30px);
1743 .show-it, .sidebar-elems:focus-within {
1748 .show-it > .block.items {
1752 .show-it > .block.items > ul {
1756 .show-it > .block.items > ul > li {
1761 .show-it > .block.items > ul > li > a {
1765 /* Because of ios, we need to actually have a full height sidebar title so the
1766 * actual sidebar can show up. But then we need to make it transparent so we don't
1767 * hide content. The filler just allows to create the background for the sidebar
1768 * title. But because of the absolute position, I had to lower the z-index.
1773 width: calc(100% - 45px);
1777 border-bottom: 1px solid;
1780 #main > details.rustdoc-toggle > summary::before,
1781 #main > div > details.rustdoc-toggle > summary::before {
1801 #main > .line-numbers {
1805 .notable-traits .notable-traits-tooltiptext {
1810 /* We don't display the help button on mobile devices. */
1815 /* Display an alternating layout on tablets and phones */
1818 flex-flow: column wrap;
1820 .item-left, .item-right {
1824 .search-container > div {
1825 width: calc(100% - 32px);
1828 /* Display an alternating layout on tablets and phones */
1829 .search-results > a {
1830 border-bottom: 1px solid #aaa9;
1833 .search-results .result-name, .search-results div.desc, .search-results .result-description {
1836 .search-results div.desc, .search-results .result-description, .item-right {
1842 nav.sub, .content .out-of-band {
1847 @media (max-width: 464px) {
1848 #titles, #titles > button {
1852 /* This is to prevent the search bar from being underneath the <section>
1853 * element following it.
1859 #main > table:not(.table-display) td {
1860 word-break: break-word;
1864 .search-container > div {
1866 width: calc(100% - 37px);
1875 #crate-search + .search-input {
1876 width: calc(100% + 71px);
1880 #theme-picker, #settings-menu {