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-regular.woff2") format("woff2"),
82 url("noto-sans-kr-regular.woff") format("woff");
84 unicode-range: U+AC00-D7AF, U+3130-318F, U+1100-11FF, U+A960-A97F, U+D7B0-D7FF;
88 -webkit-box-sizing: border-box;
89 -moz-box-sizing: border-box;
90 box-sizing: border-box;
93 /* This part handles the "default" theme being used depending on the system one. */
97 @media (prefers-color-scheme: light) {
102 @media (prefers-color-scheme: dark) {
108 /* General structure and fonts */
111 font: 16px/1.4 "Source Serif 4", "Noto Sans KR", serif;
114 padding: 10px 15px 20px 15px;
116 -webkit-font-feature-settings: "kern", "liga";
117 -moz-font-feature-settings: "kern", "liga";
118 font-feature-settings: "kern", "liga";
130 h1, h2, h3, h4, h5, h6 {
134 margin: 20px 0 15px 0;
138 margin: 15px 0 5px 0;
142 border-bottom: 1px dashed;
145 /* workaround to keep flex from breaking below 700 px width due to the float: right on the nav
149 h1.fqn > .in-band > a:hover {
150 text-decoration: underline;
153 border-bottom: 1px solid;
155 h3.code-header, h4.code-header {
167 .impl-items .associatedconstant,
168 .methods .associatedconstant,
169 .impl-items .associatedtype,
170 .methods .associatedtype {
177 .impl, .method.trait-impl,
179 .associatedconstant.trait-impl,
180 .associatedtype.trait-impl {
184 div.impl-items > div {
188 h1, h2, h3, h4, h5, h6,
189 .sidebar, a.source, .search-input, .search-results .result-name,
190 .content table td:first-child > a,
192 div.item-list .out-of-band, span.since,
193 #source-sidebar, #sidebar-toggle,
194 details.rustdoc-toggle > summary::before,
195 details.undocumented > summary::before,
196 div.impl-items > div:not(.docblock):not(.item-info),
197 .content ul.crate a.crate, a.srclink,
198 /* This selector is for the items listed in the "all items" page. */
199 #main > ul.docblock > li > a {
200 font-family: "Fira Sans", Arial, sans-serif;
203 .content ul.crate a.crate {
210 ul ul, ol ul, ul ol, ol ol {
222 /* Fix some style changes due to normalize.css 8 */
230 border-collapse: collapse;
243 /* end tweaks for normalize.css 8 */
245 details:not(.rustdoc-toggle) summary {
249 code, pre, a.test-arrow, .code-header {
250 font-family: "Source Code Pro", monospace;
252 .docblock code, .docblock-short code {
256 .docblock pre code, .docblock-short pre code {
262 .docblock.item-decl {
269 .source .content pre {
290 text-transform: uppercase;
302 /* Improve the scrollbar display on firefox */
304 scrollbar-width: initial;
307 scrollbar-width: thin;
310 /* Improve the scrollbar display on webkit-based browsers */
311 ::-webkit-scrollbar {
314 .sidebar::-webkit-scrollbar {
317 ::-webkit-scrollbar-track {
318 -webkit-box-shadow: inset 0;
321 .sidebar .block > ul > li {
329 /* Everything else */
332 display: none !important;
344 .logo-container > img {
351 transform: translate(-50%, -50%);
358 margin: 30px 10px 20px 10px;
360 word-wrap: break-word;
361 font-weight: inherit;
368 border-bottom: 1px solid;
369 overflow-wrap: break-word;
370 word-wrap: break-word; /* deprecated */
371 word-break: break-word; /* Chrome, non-standard */
378 .location a:first-of-type {
382 text-decoration: underline;
389 .block h2, .block h3 {
392 .block ul, .block li {
400 text-overflow: ellipsis;
406 transition: border 500ms ease-out;
410 border-top: 1px solid;
411 border-bottom: 1px solid;
415 font-weight: inherit;
436 .source .content pre.rust {
442 .rustdoc .example-wrap {
443 display: inline-flex;
452 .example-wrap > pre.line-number {
457 border-top-left-radius: 5px;
458 border-bottom-left-radius: 5px;
461 .example-wrap > pre.rust a:hover {
462 text-decoration: underline;
465 .rustdoc:not(.source) .example-wrap > pre:not(.line-number) {
470 .rustdoc .example-wrap > pre {
484 .content > .example-wrap pre.line-numbers {
486 -webkit-user-select: none;
487 -moz-user-select: none;
488 -ms-user-select: none;
496 overflow-wrap: anywhere;
504 text-overflow: ellipsis;
507 /* Wrap non-pre code blocks (`text`) but not (```text```). */
508 .docblock > :not(pre) > code,
509 .docblock-short > :not(pre) > code {
510 white-space: pre-wrap;
513 .top-doc .docblock h2 { font-size: 1.3em; }
514 .top-doc .docblock h3 { font-size: 1.15em; }
515 .top-doc .docblock h4,
516 .top-doc .docblock h5 {
519 .top-doc .docblock h6 {
523 .docblock h5 { font-size: 1em; }
524 .docblock h6 { font-size: 0.95em; }
536 .content .out-of-band {
545 .method > .code-header, .trait-impl > .code-header, .invisible > .code-header {
546 max-width: calc(100% - 41px);
552 display: inline-block;
559 overflow-wrap: anywhere;
562 .in-band > code, .in-band > .code-header {
563 display: inline-block;
571 font-family: "Fira Sans", Arial, sans-serif;
574 .content table:not(.table-display) {
575 border-spacing: 0 5px;
577 .content td { vertical-align: top; }
578 .content td:first-child { padding-right: 20px; }
579 .content td p:first-child { margin-top: 0; }
580 .content td h1, .content td h2 { margin-left: 0; font-size: 1.1em; }
581 .content tr:first-child td { border-top: 0; }
585 width: calc(100% - 2px);
605 .content .item-list {
606 list-style-type: none;
610 .content .multi-column {
611 -moz-column-count: 5;
612 -moz-column-gap: 2.5em;
613 -webkit-column-count: 5;
614 -webkit-column-gap: 2.5em;
618 .content .multi-column li { width: 100%; display: inline-block; }
620 .content > .methods > .method {
624 /* Shift "where ..." part of method or fn definition down a line */
625 .content .method .where,
627 .content .where.fmt-newline {
632 .content .methods > div:not(.notable-traits):not(.method) {
637 .content .docblock > .impl-items {
641 .content .docblock >.impl-items .table-display {
644 .content .docblock >.impl-items table td {
647 .content .docblock > .impl-items .table-display, .impl-items table td {
651 .content .item-info code {
655 .content .item-info {
660 .sub-variant > div > .item-info {
664 .content .item-info::before {
672 .content .impl-items .method, .content .impl-items > .type, .impl-items > .associatedconstant,
673 .impl-items > .associatedtype, .content .impl-items details > summary > .type,
674 .impl-items details > summary > .associatedconstant,
675 .impl-items details > summary > .associatedtype {
679 .content .impl-items .docblock, .content .impl-items .item-info {
683 .content .impl-items > .item-info {
687 .methods > .item-info, .content .impl-items > .item-info {
700 border-bottom: 1px solid;
701 padding-bottom: 10px;
709 border-top: 1px solid;
710 border-bottom: 1px solid;
712 nav.main .separator {
714 display: inline-block;
718 nav.sum { text-align: right; }
719 nav.sub form { display: inline; }
726 text-decoration: none;
727 background: transparent;
730 .small-section-header {
732 justify-content: space-between;
736 .small-section-header:hover > .anchor {
740 .in-band:hover > .anchor, .impl:hover > .anchor, .method.trait-impl:hover > .anchor,
741 .type.trait-impl:hover > .anchor, .associatedconstant.trait-impl:hover > .anchor,
742 .associatedtype.trait-impl:hover > .anchor {
743 display: inline-block;
750 background: none !important;
755 .small-section-header > .anchor {
759 h2.small-section-header > .anchor {
766 .docblock a:not(.srclink):not(.test-arrow):hover,
767 .docblock-short a:not(.srclink):not(.test-arrow):hover, .item-info a {
768 text-decoration: underline;
771 .invisible > .srclink,
772 .method > .code-header + .srclink {
780 .block a.current.crate { font-weight: 500; }
788 .item-left, .item-right {
792 padding-right: 1.2rem;
798 .search-container > div {
799 display: inline-flex;
800 width: calc(100% - 63px);
810 border-radius: 4px 0 0 4px;
813 border-right: 1px solid;
814 -moz-appearance: none;
815 -webkit-appearance: none;
816 /* Removes default arrow from firefox */
819 background-repeat: no-repeat;
820 background-color: transparent;
821 background-size: 20px;
822 background-position: calc(100% - 1px) 56%;
824 .search-container > .top-button {
830 /* Override Normalize.css: we have margins and do
831 not want to overflow - the `moz` attribute is necessary
832 until Firefox 29, too early to drop at this point */
833 -moz-box-sizing: border-box !important;
834 box-sizing: border-box !important;
841 transition: border-color 300ms ease;
842 transition: border-radius 300ms ease-in-out;
843 transition: box-shadow 300ms ease-in-out;
847 #crate-search + .search-input {
848 border-radius: 0 1px 1px 0;
849 width: calc(100% - 32px);
852 .search-input:focus {
863 .search-results.active {
865 /* prevent overhanging tabs from moving the first result */
869 .search-results .desc > span {
871 text-overflow: ellipsis;
876 .search-results > a {
879 /* A little margin ensures the browser's outlining of focused links has room to display. */
882 border-bottom: 1px solid #aaa3;
885 .search-results > a > div {
890 .search-results .result-name, .search-results div.desc, .search-results .result-description {
893 .search-results .result-name {
897 .search-results .result-name > span {
898 display: inline-block;
903 body.blur > :not(#help) {
905 -webkit-filter: blur(8px);
916 justify-content: center;
921 box-shadow: 0 0 6px rgba(0,0,0,.2);
930 margin-right: 0.5rem;
932 #help span.top, #help span.bottom {
942 border-bottom: 1px solid;
948 border-top: 1px solid;
950 #help dd { margin: 5px 35px; }
951 #help .infos { padding-left: 0; }
952 #help h1, #help h2 { margin-top: 0; }
956 padding: 0 20px 20px 17px;;
978 /* Black one-pixel outline around emoji shapes */
990 display: inline-block;
996 vertical-align: text-bottom;
999 .module-item.unstable,
1000 .import-item.unstable {
1005 font-weight: normal;
1009 .impl-items .since, .impl .since, .methods .since {
1015 .impl-items .srclink, .impl .srclink, .methods .srclink {
1016 /* Override header settings otherwise it's too bold */
1018 font-weight: normal;
1027 margin-bottom: 12px;
1028 /* Push the src link out to the right edge consistently */
1029 justify-content: space-between;
1036 .variants_table tbody tr td:first-child {
1037 width: 1%; /* make the variant name as small as possible */
1048 pre.rust .question-mark {
1053 display: inline-block;
1055 padding: 5px 10px 5px 10px;
1063 text-decoration: none;
1066 .section-header:hover a:before {
1069 padding-right: 10px; /* avoid gap that causes hover to disappear */
1070 content: '\2002\00a7\2002';
1073 .section-header:hover a {
1074 text-decoration: none;
1094 .out-of-band > span.since {
1100 .sub-variant, .sub-variant > h3 {
1101 margin-top: 0px !important;
1105 #main .sub-variant > h3 {
1111 .sub-variant > div {
1113 margin-bottom: 10px;
1116 .sub-variant > div > span {
1122 display: inline-block;
1127 .docblock > .section-header:first-child {
1132 .docblock > .section-header:first-child:hover > a:before {
1136 :target > code, :target > .code-header {
1153 display: inline-block;
1160 padding: 5px 3px 3px 3px;
1166 .tooltip.ignore::after {
1167 content: "This example is not tested";
1169 .tooltip.compile_fail::after {
1170 content: "This example deliberately fails to compile";
1172 .tooltip.should_panic::after {
1173 content: "This example panics";
1175 .tooltip.edition::after {
1176 content: "This code runs with edition " attr(data-edition);
1186 border-style: solid;
1190 .tooltip:hover::before, .tooltip:hover::after {
1194 .tooltip.compile_fail, .tooltip.should_panic, .tooltip.ignore {
1199 .notable-traits-tooltip {
1200 display: inline-block;
1204 .notable-traits:hover .notable-traits-tooltiptext,
1205 .notable-traits .notable-traits-tooltiptext.force-tooltip {
1206 display: inline-block;
1209 .notable-traits .notable-traits-tooltiptext {
1211 padding: 5px 3px 3px 3px;
1221 .notable-traits-tooltip::after {
1222 /* The margin on the tooltip does not capture hover events,
1223 this extends the area of hover enough so that mouse hover is not
1224 lost when moving the mouse to the tooltip */
1225 content: "\00a0\00a0\00a0";
1228 .notable-traits .notable, .notable-traits .docblock {
1232 .notable-traits .notable {
1234 margin-bottom: 13px;
1239 .notable-traits .docblock code.content{
1245 /* Example code has the "Run" button that needs to be positioned relative to the pre */
1246 pre.rust.rust-example-rendered {
1261 .search-failed.active {
1265 .search-failed > ul {
1283 border-top: 2px solid;
1286 #titles > button:not(:last-child) {
1288 width: calc(33.3% - 1px);
1291 #titles > button > div.count {
1292 display: inline-block;
1306 margin-bottom: 10px;
1320 border-top-right-radius: 3px;
1321 border-bottom-right-radius: 3px;
1324 transition: left .5s;
1337 transition: left .5s;
1338 border-right: 1px solid;
1340 #source-sidebar > .title {
1343 border-bottom: 1px solid;
1353 .theme-picker button {
1357 #settings-menu, #help-button {
1367 #theme-picker, #settings-menu, #help-button, #copy-path {
1378 font-family: "Fira Sans", Arial, sans-serif;
1385 background: initial;
1403 #theme-choices > button {
1408 background: rgba(0,0,0,0);
1411 #theme-choices > button:not(:first-child) {
1412 border-top: 1px solid;
1416 display: inline-block;
1418 font: 15px monospace;
1420 vertical-align: middle;
1423 box-shadow: inset 0 -1px 0;
1427 .hidden-by-impl-hider,
1428 .hidden-by-usual-hider {
1429 /* important because of conflicting rule for small screens */
1430 display: none !important;
1433 #implementations-list > h3 > span.in-band {
1440 border-collapse: collapse;
1445 .table-display tr td:first-child {
1449 .table-display tr td:last-child {
1452 .table-display .out-of-band {
1457 #implementors-list > .impl-items .table-display .out-of-band {
1461 .table-display td:hover .anchor {
1491 div.files > a:hover, div.name:hover {
1492 background-color: #a14b4b;
1494 div.name.expand + .children {
1505 div.name.expand::before {
1506 transform: rotate(90deg);
1511 /* The hideme class is used on summary tags that contain a span with
1512 placeholder text shown only when the toggle is closed. For instance,
1513 "Expand description" or "Show methods". */
1514 details.rustdoc-toggle > summary.hideme {
1518 details.rustdoc-toggle > summary, details.undocumented > summary {
1521 details.rustdoc-toggle > summary::-webkit-details-marker,
1522 details.rustdoc-toggle > summary::marker,
1523 details.undocumented > summary::-webkit-details-marker,
1524 details.undocumented > summary::marker {
1528 details.rustdoc-toggle > summary.hideme > span {
1532 details.rustdoc-toggle > summary::before {
1536 height: max(17px, 1.1em);
1537 background-repeat: no-repeat;
1538 background-position: top left;
1539 display: inline-block;
1540 vertical-align: middle;
1544 /* Screen readers see the text version at the end the line.
1545 Visual readers see the icon at the start of the line, but small and transparent. */
1546 details.rustdoc-toggle > summary::after {
1554 details.rustdoc-toggle > summary.hideme::after {
1555 /* "hideme" toggles already have a description when they're contracted */
1559 details.rustdoc-toggle > summary:focus::before,
1560 details.rustdoc-toggle > summary:hover::before {
1564 details.rustdoc-toggle.top-doc > summary,
1565 details.rustdoc-toggle.top-doc > summary::before,
1566 details.rustdoc-toggle.non-exhaustive > summary,
1567 details.rustdoc-toggle.non-exhaustive > summary::before {
1568 font-family: 'Fira Sans';
1572 details.non-exhaustive {
1576 details.rustdoc-toggle > summary.hideme::before {
1580 details.rustdoc-toggle > summary:not(.hideme)::before {
1586 .impl-items > details.rustdoc-toggle > summary:not(.hideme)::before,
1587 .undocumented > details.rustdoc-toggle > summary:not(.hideme)::before {
1592 /* When a "hideme" summary is open and the "Expand description" or "Show
1593 methods" text is hidden, we want the [-] toggle that remains to not
1594 affect the layout of the items to its right. To do that, we use
1595 absolute positioning. Note that we also set position: relative
1596 on the parent <details> to make this work properly. */
1597 details.rustdoc-toggle[open] > summary.hideme {
1601 details.rustdoc-toggle, details.undocumented {
1605 details.rustdoc-toggle[open] > summary.hideme > span {
1609 details.rustdoc-toggle[open] > summary::before,
1610 details.rustdoc-toggle[open] > summary.hideme::before {
1612 height: max(17px, 1.1em);
1613 background-repeat: no-repeat;
1614 background-position: top left;
1615 display: inline-block;
1619 details.rustdoc-toggle[open] > summary::after,
1620 details.rustdoc-toggle[open] > summary.hideme::after {
1621 content: "Collapse";
1624 details.undocumented > summary::before {
1626 height: max(17px, 1.1em);
1627 background-repeat: no-repeat;
1628 background-position: top left;
1629 content: "Show hidden undocumented items";
1636 details.undocumented > summary:focus::before,
1637 details.undocumented > summary:hover::before {
1641 details.undocumented[open] > summary::before {
1643 height: max(17px, 1.1em);
1644 background-repeat: no-repeat
1645 background-position: top left;
1646 content: "Hide undocumented items";
1651 @media (min-width: 701px) {
1652 /* In case there is no documentation before a code block, we need to add some margin at the top
1653 to prevent an overlay between the "collapse toggle" and the information tooltip.
1654 However, it's not needed with smaller screen width because the doc/code block is always put
1655 "one line" below. */
1656 .docblock > .information:first-child > .tooltip {
1661 @media (max-width: 700px) {
1666 .rustdoc > .sidebar {
1676 .sidebar > .location {
1680 padding: 3px 10px 1px 10px;
1682 background: inherit;
1687 .sidebar .location:empty {
1691 .sidebar .logo-container {
1700 .sidebar .logo-container > img {
1714 border-bottom: 1px solid;
1715 border-right: 1px solid;
1719 .rustdoc.source > .sidebar > .sidebar-menu {
1723 /* We do NOT hide this element so that alternative device readers still have this information
1731 /* We move the sidebar to the left by its own width so it doesn't appear. */
1734 border-right: 1px solid;
1737 .sidebar > .block.version {
1739 border-bottom: none;
1744 .sidebar > .block.version > div.narrow-helper {
1749 .sidebar > .block.version > p {
1750 /* hide Version text if too narrow */
1753 /* vertically center */
1755 align-items: center;
1760 width: calc(100% - 32px);
1778 display: none !important;
1793 #titles > button > div.count {
1806 background-color: rgba(0,0,0,0);
1810 This allows to prevent the version text to overflow the sidebar title on mobile mode when the
1811 sidebar is displayed (after clicking on the "hamburger" button).
1813 .sidebar.mobile > div.version {
1818 width: calc(100% + 30px);
1821 .show-it, .sidebar-elems:focus-within {
1826 .show-it > .block.items {
1830 .show-it > .block.items > ul {
1834 .show-it > .block.items > ul > li {
1839 .show-it > .block.items > ul > li > a {
1843 /* Because of ios, we need to actually have a full height sidebar title so the
1844 * actual sidebar can show up. But then we need to make it transparent so we don't
1845 * hide content. The filler just allows to create the background for the sidebar
1846 * title. But because of the absolute position, I had to lower the z-index.
1851 width: calc(100% - 45px);
1855 border-bottom: 1px solid;
1858 #main > details.rustdoc-toggle > summary::before,
1859 #main > div > details.rustdoc-toggle > summary::before {
1879 #main > .line-numbers {
1883 .notable-traits .notable-traits-tooltiptext {
1888 /* We don't display the help button on mobile devices. */
1893 /* Display an alternating layout on tablets and phones */
1899 flex-flow: column wrap;
1901 .item-left, .item-right {
1905 .search-container > div {
1906 width: calc(100% - 32px);
1909 /* Display an alternating layout on tablets and phones */
1910 .search-results > a {
1911 border-bottom: 1px solid #aaa9;
1914 .search-results .result-name, .search-results div.desc, .search-results .result-description {
1917 .search-results div.desc, .search-results .result-description, .item-right {
1923 nav.sub, .content .out-of-band {
1928 @media (max-width: 464px) {
1929 #titles, #titles > button {
1933 /* This is to prevent the search bar from being underneath the <section>
1934 * element following it.
1940 #main > table:not(.table-display) td {
1941 word-break: break-word;
1945 .search-container > div {
1947 width: calc(100% - 37px);
1956 #crate-search + .search-input {
1957 width: calc(100% + 71px);
1961 #theme-picker, #settings-menu {
1980 overflow-wrap: anywhere;