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;
149 h3.code-header, h4.code-header {
161 .impl-items .associatedconstant,
162 .methods .associatedconstant,
163 .impl-items .associatedtype,
164 .methods .associatedtype {
171 .impl, .method.trait-impl,
173 .associatedconstant.trait-impl,
174 .associatedtype.trait-impl {
178 div.impl-items > div {
183 .sidebar, a.source, .search-input, .search-results .result-name,
184 .content table td:first-child > a,
186 div.item-list .out-of-band, span.since,
187 #source-sidebar, #sidebar-toggle,
188 details.rustdoc-toggle > summary::before,
189 details.undocumented > summary::before,
190 div.impl-items > div:not(.docblock):not(.item-info),
191 .content ul.crate a.crate, a.srclink,
192 /* This selector is for the items listed in the "all items" page. */
193 #main > ul.docblock > li > a {
194 font-family: "Fira Sans", Arial, sans-serif;
197 .content ul.crate a.crate {
204 ul ul, ol ul, ul ol, ol ol {
216 /* Fix some style changes due to normalize.css 8 */
224 border-collapse: collapse;
237 /* end tweaks for normalize.css 8 */
239 details:not(.rustdoc-toggle) summary {
243 code, pre, a.test-arrow, .code-header {
244 font-family: "Source Code Pro", monospace;
246 .docblock code, .docblock-short code {
250 .docblock pre code, .docblock-short pre code {
260 .source .content pre {
281 text-transform: uppercase;
293 /* Improve the scrollbar display on firefox */
295 scrollbar-width: initial;
298 scrollbar-width: thin;
301 /* Improve the scrollbar display on webkit-based browsers */
302 ::-webkit-scrollbar {
305 .sidebar::-webkit-scrollbar {
308 ::-webkit-scrollbar-track {
309 -webkit-box-shadow: inset 0;
312 .sidebar .block > ul > li {
320 /* Everything else */
323 display: none !important;
335 .logo-container > img {
342 transform: translate(-50%, -50%);
349 margin: 30px 10px 20px 10px;
351 word-wrap: break-word;
352 font-weight: inherit;
359 border-bottom: 1px solid;
360 overflow-wrap: break-word;
361 word-wrap: break-word; /* deprecated */
362 word-break: break-word; /* Chrome, non-standard */
369 .location a:first-of-type {
373 text-decoration: underline;
380 .block h2, .block h3 {
383 .block ul, .block li {
391 text-overflow: ellipsis;
397 transition: border 500ms ease-out;
401 border-top: 1px solid;
402 border-bottom: 1px solid;
406 font-weight: inherit;
427 .source .content pre.rust {
433 .rustdoc .example-wrap {
434 display: inline-flex;
443 .example-wrap > pre.line-number {
448 border-top-left-radius: 5px;
449 border-bottom-left-radius: 5px;
452 .example-wrap > pre.rust a:hover {
453 text-decoration: underline;
456 .rustdoc:not(.source) .example-wrap > pre:not(.line-number) {
461 .rustdoc .example-wrap > pre {
475 .content > .example-wrap pre.line-numbers {
477 -webkit-user-select: none;
478 -moz-user-select: none;
479 -ms-user-select: none;
487 overflow-wrap: anywhere;
495 text-overflow: ellipsis;
498 /* Wrap non-pre code blocks (`text`) but not (```text```). */
499 .docblock > :not(pre) > code,
500 .docblock-short > :not(pre) > code {
501 white-space: pre-wrap;
504 .docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5 {
505 border-bottom: 1px solid;
508 .top-doc .docblock h1 { font-size: 1.3em; }
509 .top-doc .docblock h2 { font-size: 1.15em; }
510 .top-doc .docblock h3,
511 .top-doc .docblock h4,
512 .top-doc .docblock h5 {
516 .docblock h1 { font-size: 1em; }
517 .docblock h2 { font-size: 0.95em; }
518 .docblock h3, .docblock h4, .docblock h5 { font-size: 0.9em; }
530 .content .out-of-band {
539 .method > .code-header, .trait-impl > .code-header, .invisible > .code-header {
540 max-width: calc(100% - 41px);
546 display: inline-block;
555 .in-band > code, .in-band > .code-header {
556 display: inline-block;
564 font-family: "Fira Sans", Arial, sans-serif;
567 .content table:not(.table-display) {
568 border-spacing: 0 5px;
570 .content td { vertical-align: top; }
571 .content td:first-child { padding-right: 20px; }
572 .content td p:first-child { margin-top: 0; }
573 .content td h1, .content td h2 { margin-left: 0; font-size: 1.1em; }
574 .content tr:first-child td { border-top: 0; }
578 width: calc(100% - 2px);
598 .content .item-list {
599 list-style-type: none;
603 .content .multi-column {
604 -moz-column-count: 5;
605 -moz-column-gap: 2.5em;
606 -webkit-column-count: 5;
607 -webkit-column-gap: 2.5em;
611 .content .multi-column li { width: 100%; display: inline-block; }
613 .content > .methods > .method {
617 /* Shift "where ..." part of method or fn definition down a line */
618 .content .method .where,
620 .content .where.fmt-newline {
625 .content .methods > div:not(.notable-traits):not(.method) {
630 .content .docblock > .impl-items {
634 .content .docblock >.impl-items .table-display {
637 .content .docblock >.impl-items table td {
640 .content .docblock > .impl-items .table-display, .impl-items table td {
644 .content .item-info code {
648 .content .item-info {
653 .sub-variant > div > .item-info {
657 .content .item-info::before {
665 .content .impl-items .method, .content .impl-items > .type, .impl-items > .associatedconstant,
666 .impl-items > .associatedtype, .content .impl-items details > summary > .type,
667 .impl-items details > summary > .associatedconstant,
668 .impl-items details > summary > .associatedtype {
672 .content .impl-items .docblock, .content .impl-items .item-info {
676 .content .impl-items > .item-info {
680 .methods > .item-info, .content .impl-items > .item-info {
693 border-bottom: 1px solid;
694 padding-bottom: 10px;
702 border-top: 1px solid;
703 border-bottom: 1px solid;
705 nav.main .separator {
707 display: inline-block;
711 nav.sum { text-align: right; }
712 nav.sub form { display: inline; }
719 text-decoration: none;
720 background: transparent;
723 .small-section-header {
725 justify-content: space-between;
729 .small-section-header:hover > .anchor {
733 .in-band:hover > .anchor, .impl:hover > .anchor, .method.trait-impl:hover > .anchor,
734 .type.trait-impl:hover > .anchor, .associatedconstant.trait-impl:hover > .anchor,
735 .associatedtype.trait-impl:hover > .anchor {
736 display: inline-block;
743 background: none !important;
748 .small-section-header > .anchor {
752 h2.small-section-header > .anchor {
759 .docblock a:not(.srclink):not(.test-arrow):hover,
760 .docblock-short a:not(.srclink):not(.test-arrow):hover, .item-info a {
761 text-decoration: underline;
764 .invisible > .srclink,
765 .method > .code-header + .srclink {
773 .block a.current.crate { font-weight: 500; }
777 /* align content left */
778 justify-items: start;
783 .item-left, .item-right {
787 padding-right: 1.2rem;
793 .search-container > div {
794 display: inline-flex;
795 width: calc(100% - 63px);
805 border-radius: 4px 0 0 4px;
808 border-right: 1px solid;
809 -moz-appearance: none;
810 -webkit-appearance: none;
811 /* Removes default arrow from firefox */
814 background-repeat: no-repeat;
815 background-color: transparent;
816 background-size: 20px;
817 background-position: calc(100% - 1px) 56%;
819 .search-container > .top-button {
825 /* Override Normalize.css: we have margins and do
826 not want to overflow - the `moz` attribute is necessary
827 until Firefox 29, too early to drop at this point */
828 -moz-box-sizing: border-box !important;
829 box-sizing: border-box !important;
836 transition: border-color 300ms ease;
837 transition: border-radius 300ms ease-in-out;
838 transition: box-shadow 300ms ease-in-out;
842 #crate-search + .search-input {
843 border-radius: 0 1px 1px 0;
844 width: calc(100% - 32px);
847 .search-input:focus {
858 .search-results.active {
860 /* prevent overhanging tabs from moving the first result */
864 .search-results .desc > span {
866 text-overflow: ellipsis;
871 .search-results > a {
874 /* A little margin ensures the browser's outlining of focused links has room to display. */
877 border-bottom: 1px solid #aaa3;
880 .search-results > a > div {
885 .search-results .result-name, .search-results div.desc, .search-results .result-description {
888 .search-results .result-name {
892 .search-results .result-name > span {
893 display: inline-block;
898 body.blur > :not(#help) {
900 -webkit-filter: blur(8px);
911 justify-content: center;
916 box-shadow: 0 0 6px rgba(0,0,0,.2);
925 margin-right: 0.5rem;
927 #help span.top, #help span.bottom {
937 border-bottom: 1px solid;
943 border-top: 1px solid;
945 #help dd { margin: 5px 35px; }
946 #help .infos { padding-left: 0; }
947 #help h1, #help h2 { margin-top: 0; }
951 padding: 0 20px 20px 17px;;
973 /* Black one-pixel outline around emoji shapes */
985 display: inline-block;
991 vertical-align: text-bottom;
994 .module-item.unstable,
995 .import-item.unstable {
1000 font-weight: normal;
1004 .impl-items .since, .impl .since, .methods .since {
1010 .impl-items .srclink, .impl .srclink, .methods .srclink {
1011 /* Override header settings otherwise it's too bold */
1013 font-weight: normal;
1022 margin-bottom: 12px;
1023 /* Push the src link out to the right edge consistently */
1024 justify-content: space-between;
1031 .variants_table tbody tr td:first-child {
1032 width: 1%; /* make the variant name as small as possible */
1043 pre.rust .question-mark {
1048 display: inline-block;
1050 padding: 5px 10px 5px 10px;
1058 text-decoration: none;
1061 .section-header:hover a:before {
1064 padding-right: 10px; /* avoid gap that causes hover to disappear */
1065 content: '\2002\00a7\2002';
1068 .section-header:hover a {
1069 text-decoration: none;
1089 .out-of-band > span.since {
1095 .sub-variant, .sub-variant > h3 {
1096 margin-top: 0px !important;
1100 #main .sub-variant > h3 {
1106 .sub-variant > div {
1108 margin-bottom: 10px;
1111 .sub-variant > div > span {
1117 display: inline-block;
1122 .docblock > .section-header:first-child {
1127 .docblock > .section-header:first-child:hover > a:before {
1131 :target > code, :target > .code-header {
1148 display: inline-block;
1155 padding: 5px 3px 3px 3px;
1161 .tooltip.ignore::after {
1162 content: "This example is not tested";
1164 .tooltip.compile_fail::after {
1165 content: "This example deliberately fails to compile";
1167 .tooltip.should_panic::after {
1168 content: "This example panics";
1170 .tooltip.edition::after {
1171 content: "This code runs with edition " attr(data-edition);
1181 border-style: solid;
1185 .tooltip:hover::before, .tooltip:hover::after {
1189 .tooltip.compile_fail, .tooltip.should_panic, .tooltip.ignore {
1194 .notable-traits-tooltip {
1195 display: inline-block;
1199 .notable-traits:hover .notable-traits-tooltiptext,
1200 .notable-traits .notable-traits-tooltiptext.force-tooltip {
1201 display: inline-block;
1204 .notable-traits .notable-traits-tooltiptext {
1206 padding: 5px 3px 3px 3px;
1216 .notable-traits-tooltip::after {
1217 /* The margin on the tooltip does not capture hover events,
1218 this extends the area of hover enough so that mouse hover is not
1219 lost when moving the mouse to the tooltip */
1220 content: "\00a0\00a0\00a0";
1223 .notable-traits .notable, .notable-traits .docblock {
1227 .notable-traits .notable {
1229 margin-bottom: 13px;
1234 .notable-traits .docblock code.content{
1240 /* Example code has the "Run" button that needs to be positioned relative to the pre */
1241 pre.rust.rust-example-rendered {
1256 .search-failed.active {
1260 .search-failed > ul {
1278 border-top: 2px solid;
1281 #titles > button:not(:last-child) {
1283 width: calc(33.3% - 1px);
1286 #titles > button > div.count {
1287 display: inline-block;
1301 margin-bottom: 10px;
1315 border-top-right-radius: 3px;
1316 border-bottom-right-radius: 3px;
1319 transition: left .5s;
1332 transition: left .5s;
1333 border-right: 1px solid;
1335 #source-sidebar > .title {
1338 border-bottom: 1px solid;
1348 .theme-picker button {
1352 #settings-menu, #help-button {
1362 #theme-picker, #settings-menu, #help-button, #copy-path {
1373 font-family: "Fira Sans", Arial, sans-serif;
1380 background: initial;
1398 #theme-choices > button {
1403 background: rgba(0,0,0,0);
1406 #theme-choices > button:not(:first-child) {
1407 border-top: 1px solid;
1411 display: inline-block;
1413 font: 15px monospace;
1415 vertical-align: middle;
1418 box-shadow: inset 0 -1px 0;
1422 .hidden-by-impl-hider,
1423 .hidden-by-usual-hider {
1424 /* important because of conflicting rule for small screens */
1425 display: none !important;
1428 #implementations-list > h3 > span.in-band {
1435 border-collapse: collapse;
1440 .table-display tr td:first-child {
1444 .table-display tr td:last-child {
1447 .table-display .out-of-band {
1452 #implementors-list > .impl-items .table-display .out-of-band {
1456 .table-display td:hover .anchor {
1486 div.files > a:hover, div.name:hover {
1487 background-color: #a14b4b;
1489 div.name.expand + .children {
1500 div.name.expand::before {
1501 transform: rotate(90deg);
1506 /* The hideme class is used on summary tags that contain a span with
1507 placeholder text shown only when the toggle is closed. For instance,
1508 "Expand description" or "Show methods". */
1509 details.rustdoc-toggle > summary.hideme {
1513 details.rustdoc-toggle > summary, details.undocumented > summary {
1516 details.rustdoc-toggle > summary::-webkit-details-marker,
1517 details.rustdoc-toggle > summary::marker,
1518 details.undocumented > summary::-webkit-details-marker,
1519 details.undocumented > summary::marker {
1523 details.rustdoc-toggle > summary.hideme > span {
1527 details.rustdoc-toggle > summary::before {
1531 height: max(17px, 1.1em);
1532 background-repeat: no-repeat;
1533 background-position: top left;
1534 display: inline-block;
1535 vertical-align: middle;
1539 /* Screen readers see the text version at the end the line.
1540 Visual readers see the icon at the start of the line, but small and transparent. */
1541 details.rustdoc-toggle > summary::after {
1549 details.rustdoc-toggle > summary.hideme::after {
1550 /* "hideme" toggles already have a description when they're contracted */
1554 details.rustdoc-toggle > summary:focus::before,
1555 details.rustdoc-toggle > summary:hover::before {
1559 details.rustdoc-toggle.top-doc > summary,
1560 details.rustdoc-toggle.top-doc > summary::before,
1561 details.rustdoc-toggle.non-exhaustive > summary,
1562 details.rustdoc-toggle.non-exhaustive > summary::before {
1563 font-family: 'Fira Sans';
1567 details.non-exhaustive {
1571 details.rustdoc-toggle > summary.hideme::before {
1575 details.rustdoc-toggle > summary:not(.hideme)::before {
1581 .impl-items > details.rustdoc-toggle > summary:not(.hideme)::before,
1582 .undocumented > details.rustdoc-toggle > summary:not(.hideme)::before {
1587 /* When a "hideme" summary is open and the "Expand description" or "Show
1588 methods" text is hidden, we want the [-] toggle that remains to not
1589 affect the layout of the items to its right. To do that, we use
1590 absolute positioning. Note that we also set position: relative
1591 on the parent <details> to make this work properly. */
1592 details.rustdoc-toggle[open] > summary.hideme {
1596 details.rustdoc-toggle, details.undocumented {
1600 details.rustdoc-toggle[open] > summary.hideme > span {
1604 details.rustdoc-toggle[open] > summary::before,
1605 details.rustdoc-toggle[open] > summary.hideme::before {
1607 height: max(17px, 1.1em);
1608 background-repeat: no-repeat;
1609 background-position: top left;
1610 display: inline-block;
1614 details.rustdoc-toggle[open] > summary::after,
1615 details.rustdoc-toggle[open] > summary.hideme::after {
1616 content: "Collapse";
1619 details.undocumented > summary::before {
1621 height: max(17px, 1.1em);
1622 background-repeat: no-repeat;
1623 background-position: top left;
1624 content: "Show hidden undocumented items";
1631 details.undocumented > summary:focus::before,
1632 details.undocumented > summary:hover::before {
1636 details.undocumented[open] > summary::before {
1638 height: max(17px, 1.1em);
1639 background-repeat: no-repeat
1640 background-position: top left;
1641 content: "Hide undocumented items";
1646 @media (min-width: 701px) {
1647 /* In case there is no documentation before a code block, we need to add some margin at the top
1648 to prevent an overlay between the "collapse toggle" and the information tooltip.
1649 However, it's not needed with smaller screen width because the doc/code block is always put
1650 "one line" below. */
1651 .docblock > .information:first-child > .tooltip {
1656 @media (max-width: 700px) {
1661 .rustdoc > .sidebar {
1671 .sidebar > .location {
1675 padding: 3px 10px 1px 10px;
1677 background: inherit;
1682 .sidebar .location:empty {
1686 .sidebar .logo-container {
1695 .sidebar .logo-container > img {
1709 border-bottom: 1px solid;
1710 border-right: 1px solid;
1714 .rustdoc.source > .sidebar > .sidebar-menu {
1718 /* We do NOT hide this element so that alternative device readers still have this information
1726 /* We move the sidebar to the left by its own width so it doesn't appear. */
1729 border-right: 1px solid;
1732 .sidebar > .block.version {
1734 border-bottom: none;
1739 .sidebar > .block.version > div.narrow-helper {
1744 .sidebar > .block.version > p {
1745 /* hide Version text if too narrow */
1748 /* vertically center */
1750 align-items: center;
1755 width: calc(100% - 32px);
1773 display: none !important;
1788 #titles > button > div.count {
1801 background-color: rgba(0,0,0,0);
1805 This allows to prevent the version text to overflow the sidebar title on mobile mode when the
1806 sidebar is displayed (after clicking on the "hamburger" button).
1808 .sidebar.mobile > div.version {
1813 width: calc(100% + 30px);
1816 .show-it, .sidebar-elems:focus-within {
1821 .show-it > .block.items {
1825 .show-it > .block.items > ul {
1829 .show-it > .block.items > ul > li {
1834 .show-it > .block.items > ul > li > a {
1838 /* Because of ios, we need to actually have a full height sidebar title so the
1839 * actual sidebar can show up. But then we need to make it transparent so we don't
1840 * hide content. The filler just allows to create the background for the sidebar
1841 * title. But because of the absolute position, I had to lower the z-index.
1846 width: calc(100% - 45px);
1850 border-bottom: 1px solid;
1853 #main > details.rustdoc-toggle > summary::before,
1854 #main > div > details.rustdoc-toggle > summary::before {
1874 #main > .line-numbers {
1878 .notable-traits .notable-traits-tooltiptext {
1883 /* We don't display the help button on mobile devices. */
1888 /* Display an alternating layout on tablets and phones */
1894 flex-flow: column wrap;
1896 .item-left, .item-right {
1900 .search-container > div {
1901 width: calc(100% - 32px);
1904 /* Display an alternating layout on tablets and phones */
1905 .search-results > a {
1906 border-bottom: 1px solid #aaa9;
1909 .search-results .result-name, .search-results div.desc, .search-results .result-description {
1912 .search-results div.desc, .search-results .result-description, .item-right {
1918 nav.sub, .content .out-of-band {
1923 @media (max-width: 464px) {
1924 #titles, #titles > button {
1928 /* This is to prevent the search bar from being underneath the <section>
1929 * element following it.
1935 #main > table:not(.table-display) td {
1936 word-break: break-word;
1940 .search-container > div {
1942 width: calc(100% - 37px);
1951 #crate-search + .search-input {
1952 width: calc(100% + 71px);
1956 #theme-picker, #settings-menu {