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 {
251 .source .content pre {
272 text-transform: uppercase;
284 /* Improve the scrollbar display on firefox */
286 scrollbar-width: initial;
289 scrollbar-width: thin;
292 /* Improve the scrollbar display on webkit-based browsers */
293 ::-webkit-scrollbar {
296 .sidebar::-webkit-scrollbar {
299 ::-webkit-scrollbar-track {
300 -webkit-box-shadow: inset 0;
303 .sidebar .block > ul > li {
311 /* Everything else */
314 display: none !important;
326 .logo-container > img {
332 transform: translate(-50%, -50%);
339 margin: 30px 10px 20px 10px;
341 word-wrap: break-word;
347 border-bottom: 1px solid;
348 overflow-wrap: break-word;
349 word-wrap: break-word; /* deprecated */
350 word-break: break-word; /* Chrome, non-standard */
357 .location a:first-of-type {
361 text-decoration: underline;
368 .block h2, .block h3 {
371 .block ul, .block li {
379 text-overflow: ellipsis;
385 transition: border 500ms ease-out;
389 border-top: 1px solid;
390 border-bottom: 1px solid;
413 .source .content pre.rust {
419 .rustdoc .example-wrap {
420 display: inline-flex;
429 .example-wrap > pre.line-number {
434 border-top-left-radius: 5px;
435 border-bottom-left-radius: 5px;
438 .rustdoc:not(.source) .example-wrap > pre.rust {
443 .rustdoc .example-wrap > pre {
457 .content > .example-wrap pre.line-numbers {
459 -webkit-user-select: none;
460 -moz-user-select: none;
461 -ms-user-select: none;
469 overflow-wrap: anywhere;
477 text-overflow: ellipsis;
480 /* Wrap non-pre code blocks (`text`) but not (```text```). */
481 .docblock > :not(pre) > code,
482 .docblock-short > :not(pre) > code {
483 white-space: pre-wrap;
486 .docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5 {
487 border-bottom: 1px solid;
490 .top-doc .docblock h1 { font-size: 1.3em; }
491 .top-doc .docblock h2 { font-size: 1.15em; }
492 .top-doc .docblock h3,
493 .top-doc .docblock h4,
494 .top-doc .docblock h5 {
498 .docblock h1 { font-size: 1em; }
499 .docblock h2 { font-size: 0.95em; }
500 .docblock h3, .docblock h4, .docblock h5 { font-size: 0.9em; }
507 .content .out-of-band {
516 .method > code, .trait-impl > code, .invisible > code {
517 max-width: calc(100% - 41px);
523 display: inline-block;
533 display: inline-block;
541 font-family: "Fira Sans", Arial, sans-serif;
544 .content table:not(.table-display) {
545 border-spacing: 0 5px;
547 .content td { vertical-align: top; }
548 .content td:first-child { padding-right: 20px; }
549 .content td p:first-child { margin-top: 0; }
550 .content td h1, .content td h2 { margin-left: 0; font-size: 1.1em; }
551 .content tr:first-child td { border-top: 0; }
555 width: calc(100% - 2px);
574 .content .item-list {
575 list-style-type: none;
579 .content .multi-column {
580 -moz-column-count: 5;
581 -moz-column-gap: 2.5em;
582 -webkit-column-count: 5;
583 -webkit-column-gap: 2.5em;
587 .content .multi-column li { width: 100%; display: inline-block; }
589 .content > .methods > .method {
593 /* Shift "where ..." part of method or fn definition down a line */
594 .content .method .where,
596 .content .where.fmt-newline {
601 .content .methods > div:not(.notable-traits):not(.method) {
606 .content .docblock > .impl-items {
610 .content .docblock >.impl-items .table-display {
613 .content .docblock >.impl-items table td {
616 .content .docblock > .impl-items .table-display, .impl-items table td {
620 .content .item-info code {
624 .content .item-info {
629 .sub-variant > div > .item-info {
633 .content .item-info::before {
641 .content .impl-items .method, .content .impl-items > .type, .impl-items > .associatedconstant,
642 .impl-items > .associatedtype, .content .impl-items details > summary > .type,
643 .impl-items details > summary > .associatedconstant,
644 .impl-items details > summary > .associatedtype {
648 .content .impl-items .docblock, .content .impl-items .item-info {
652 .content .impl-items > .item-info {
656 .methods > .item-info, .content .impl-items > .item-info {
669 border-bottom: 1px solid;
670 padding-bottom: 10px;
678 border-top: 1px solid;
679 border-bottom: 1px solid;
681 nav.main .separator {
683 display: inline-block;
687 nav.sum { text-align: right; }
688 nav.sub form { display: inline; }
695 text-decoration: none;
696 background: transparent;
699 .small-section-header {
701 justify-content: space-between;
705 .small-section-header:hover > .anchor {
709 .in-band:hover > .anchor, .impl:hover > .anchor, .method.trait-impl:hover > .anchor,
710 .type.trait-impl:hover > .anchor, .associatedconstant.trait-impl:hover > .anchor,
711 .associatedtype.trait-impl:hover > .anchor {
712 display: inline-block;
723 .small-section-header > .anchor {
725 padding-right: 10px; /* avoid gap that causes hover to disappear */
728 content: '\2002\00a7\2002';
731 .docblock a:not(.srclink):not(.test-arrow):hover,
732 .docblock-short a:not(.srclink):not(.test-arrow):hover, .item-info a {
733 text-decoration: underline;
736 .invisible > .srclink,
737 .method > code + .srclink {
745 .block a.current.crate { font-weight: 500; }
751 grid-template-columns: auto 1fr;
752 /* align content left */
753 justify-items: start;
756 .item-left, .item-right {
769 .search-container > div {
770 display: inline-flex;
771 width: calc(100% - 63px);
781 border-radius: 4px 0 0 4px;
784 border-right: 1px solid;
785 -moz-appearance: none;
786 -webkit-appearance: none;
787 /* Removes default arrow from firefox */
790 background-repeat: no-repeat;
791 background-color: transparent;
792 background-size: 20px;
793 background-position: calc(100% - 1px) 56%;
795 .search-container > .top-button {
801 /* Override Normalize.css: we have margins and do
802 not want to overflow - the `moz` attribute is necessary
803 until Firefox 29, too early to drop at this point */
804 -moz-box-sizing: border-box !important;
805 box-sizing: border-box !important;
812 transition: border-color 300ms ease;
813 transition: border-radius 300ms ease-in-out;
814 transition: box-shadow 300ms ease-in-out;
818 #crate-search + .search-input {
819 border-radius: 0 1px 1px 0;
820 width: calc(100% - 32px);
823 .search-input:focus {
834 .search-results.active {
836 /* prevent overhanging tabs from moving the first result */
840 .search-results .desc > span {
842 text-overflow: ellipsis;
847 .search-results > a {
850 /* A little margin ensures the browser's outlining of focused links has room to display. */
853 border-bottom: 1px solid #aaa3;
856 .search-results > a > div {
861 .search-results .result-name, .search-results div.desc, .search-results .result-description {
864 .search-results .result-name {
868 .search-results .result-name > span {
869 display: inline-block;
874 body.blur > :not(#help) {
876 -webkit-filter: blur(8px);
887 justify-content: center;
892 box-shadow: 0 0 6px rgba(0,0,0,.2);
901 margin-right: 0.5rem;
908 border-bottom: 1px solid #ccc;
912 #help dd { margin: 5px 35px; }
913 #help .infos { padding-left: 0; }
914 #help h1, #help h2 { margin-top: 0; }
918 padding: 0 20px 20px 17px;;
937 /* Black one-pixel outline around emoji shapes */
949 display: inline-block;
955 vertical-align: text-bottom;
958 .module-item.unstable,
959 .import-item.unstable {
968 .impl-items .since, .impl .since, .methods .since {
974 .impl-items .srclink, .impl .srclink, .methods .srclink {
975 /* Override header settings otherwise it's too bold */
987 /* Push the src link out to the right edge consistently */
988 justify-content: space-between;
995 .variants_table tbody tr td:first-child {
996 width: 1%; /* make the variant name as small as possible */
1007 pre.rust .question-mark {
1012 display: inline-block;
1014 padding: 5px 10px 5px 10px;
1022 text-decoration: none;
1025 .section-header:hover a:before {
1028 padding-right: 10px; /* avoid gap that causes hover to disappear */
1029 content: '\2002\00a7\2002';
1032 .section-header:hover a {
1033 text-decoration: none;
1053 .out-of-band > span.since {
1059 .sub-variant, .sub-variant > h3 {
1060 margin-top: 0px !important;
1064 #main > details > .sub-variant > h3 {
1070 .sub-variant > div {
1072 margin-bottom: 10px;
1075 .sub-variant > div > span {
1081 display: inline-block;
1086 .docblock > .section-header:first-child {
1091 .docblock > .section-header:first-child:hover > a:before {
1095 #main > .variant, #main > .structfield {
1117 display: inline-block;
1124 padding: 5px 3px 3px 3px;
1130 .tooltip.ignore::after {
1131 content: "This example is not tested";
1133 .tooltip.compile_fail::after {
1134 content: "This example deliberately fails to compile";
1136 .tooltip.should_panic::after {
1137 content: "This example panics";
1139 .tooltip.edition::after {
1140 content: "This code runs with edition " attr(data-edition);
1150 border-style: solid;
1154 .tooltip:hover::before, .tooltip:hover::after {
1158 .tooltip.compile_fail, .tooltip.should_panic, .tooltip.ignore {
1163 .notable-traits-tooltip {
1164 display: inline-block;
1168 .notable-traits:hover .notable-traits-tooltiptext,
1169 .notable-traits .notable-traits-tooltiptext.force-tooltip {
1170 display: inline-block;
1173 .notable-traits .notable-traits-tooltiptext {
1175 padding: 5px 3px 3px 3px;
1185 .notable-traits-tooltip::after {
1186 /* The margin on the tooltip does not capture hover events,
1187 this extends the area of hover enough so that mouse hover is not
1188 lost when moving the mouse to the tooltip */
1189 content: "\00a0\00a0\00a0";
1192 .notable-traits .notable, .notable-traits .docblock {
1196 .notable-traits .notable {
1198 margin-bottom: 13px;
1203 .notable-traits .docblock code.content{
1209 /* Example code has the "Run" button that needs to be positioned relative to the pre */
1210 pre.rust.rust-example-rendered {
1225 .search-failed.active {
1229 .search-failed > ul {
1247 border-top: 2px solid;
1250 #titles > button:not(:last-child) {
1252 width: calc(33.3% - 1px);
1255 #titles > button > div.count {
1256 display: inline-block;
1270 margin-bottom: 10px;
1284 border-top-right-radius: 3px;
1285 border-bottom-right-radius: 3px;
1288 transition: left .5s;
1301 transition: left .5s;
1302 border-right: 1px solid;
1304 #source-sidebar > .title {
1307 border-bottom: 1px solid;
1317 .theme-picker button {
1321 #settings-menu, #help-button {
1331 #theme-picker, #settings-menu, #help-button, #copy-path {
1342 font-family: "Fira Sans", Arial, sans-serif;
1349 background: initial;
1367 #theme-choices > button {
1372 background: rgba(0,0,0,0);
1375 #theme-choices > button:not(:first-child) {
1376 border-top: 1px solid;
1380 display: inline-block;
1382 font: 15px monospace;
1384 vertical-align: middle;
1387 box-shadow: inset 0 -1px 0;
1391 .hidden-by-impl-hider,
1392 .hidden-by-usual-hider {
1393 /* important because of conflicting rule for small screens */
1394 display: none !important;
1397 #implementations-list > h3 > span.in-band {
1404 border-collapse: collapse;
1409 .table-display tr td:first-child {
1413 .table-display tr td:last-child {
1416 .table-display .out-of-band {
1421 #implementors-list > .impl-items .table-display .out-of-band {
1425 .table-display td:hover .anchor {
1455 div.files > a:hover, div.name:hover {
1456 background-color: #a14b4b;
1458 div.name.expand + .children {
1469 div.name.expand::before {
1470 transform: rotate(90deg);
1475 /* The hideme class is used on summary tags that contain a span with
1476 placeholder text shown only when the toggle is closed. For instance,
1477 "Expand description" or "Show methods". */
1478 details.rustdoc-toggle > summary.hideme {
1482 details.rustdoc-toggle > summary, details.undocumented > summary {
1485 details.rustdoc-toggle > summary::-webkit-details-marker,
1486 details.rustdoc-toggle > summary::marker,
1487 details.undocumented > summary::-webkit-details-marker,
1488 details.undocumented > summary::marker {
1492 details.rustdoc-toggle > summary.hideme > span {
1496 details.rustdoc-toggle > summary::before {
1500 letter-spacing: 1px;
1504 details.rustdoc-toggle.top-doc > summary,
1505 details.rustdoc-toggle.top-doc > summary::before,
1506 details.rustdoc-toggle.non-exhaustive > summary,
1507 details.rustdoc-toggle.non-exhaustive > summary::before {
1508 font-family: 'Fira Sans';
1512 details.non-exhaustive {
1516 details.rustdoc-toggle > summary.hideme::before {
1520 details.rustdoc-toggle > summary:not(.hideme)::before {
1526 .impl-items > details.rustdoc-toggle > summary:not(.hideme)::before,
1527 .undocumented > details.rustdoc-toggle > summary:not(.hideme)::before {
1532 /* When a "hideme" summary is open and the "Expand description" or "Show
1533 methods" text is hidden, we want the [-] toggle that remains to not
1534 affect the layout of the items to its right. To do that, we use
1535 absolute positioning. Note that we also set position: relative
1536 on the parent <details> to make this work properly. */
1537 details.rustdoc-toggle[open] > summary.hideme {
1541 details.rustdoc-toggle, details.undocumented {
1545 details.rustdoc-toggle[open] > summary.hideme > span {
1549 details.rustdoc-toggle[open] > summary::before {
1554 details.undocumented > summary::before {
1555 content: "[+] Show hidden undocumented items";
1561 details.undocumented[open] > summary::before {
1562 content: "[−] Hide undocumented items";
1567 @media (min-width: 701px) {
1568 /* In case there is no documentation before a code block, we need to add some margin at the top
1569 to prevent an overlay between the "collapse toggle" and the information tooltip.
1570 However, it's not needed with smaller screen width because the doc/code block is always put
1571 "one line" below. */
1572 .docblock > .information:first-child > .tooltip {
1577 @media (max-width: 700px) {
1582 .rustdoc > .sidebar {
1592 .sidebar > .location {
1596 padding: 3px 10px 1px 10px;
1598 background: inherit;
1603 .sidebar .location:empty {
1607 .sidebar .logo-container {
1616 .sidebar .logo-container > img {
1630 border-bottom: 1px solid;
1631 border-right: 1px solid;
1635 .rustdoc.source > .sidebar > .sidebar-menu {
1646 border-right: 1px solid;
1650 .sidebar > .block.version {
1652 border-bottom: none;
1657 .sidebar > .block.version > div.narrow-helper {
1662 .sidebar > .block.version > p {
1663 /* hide Version text if too narrow */
1666 /* vertically center */
1668 align-items: center;
1673 width: calc(100% - 32px);
1691 display: none !important;
1706 #titles > button > div.count {
1719 background-color: rgba(0,0,0,0);
1723 This allows to prevent the version text to overflow the sidebar title on mobile mode when the
1724 sidebar is displayed (after clicking on the "hamburger" button).
1726 .sidebar.mobile > div.version {
1731 width: calc(100% + 30px);
1739 .show-it > .block.items {
1743 .show-it > .block.items > ul {
1747 .show-it > .block.items > ul > li {
1752 .show-it > .block.items > ul > li > a {
1756 /* Because of ios, we need to actually have a full height sidebar title so the
1757 * actual sidebar can show up. But then we need to make it transparent so we don't
1758 * hide content. The filler just allows to create the background for the sidebar
1759 * title. But because of the absolute position, I had to lower the z-index.
1764 width: calc(100% - 45px);
1768 border-bottom: 1px solid;
1771 #main > details.rustdoc-toggle > summary::before,
1772 #main > div > details.rustdoc-toggle > summary::before {
1792 #main > .line-numbers {
1796 .notable-traits .notable-traits-tooltiptext {
1801 /* We don't display the help button on mobile devices. */
1806 /* Display an alternating layout on tablets and phones */
1809 flex-flow: column wrap;
1811 .item-left, .item-right {
1815 .search-container > div {
1816 width: calc(100% - 32px);
1819 /* Display an alternating layout on tablets and phones */
1820 .search-results > a {
1821 border-bottom: 1px solid #aaa9;
1824 .search-results .result-name, .search-results div.desc, .search-results .result-description {
1827 .search-results div.desc, .search-results .result-description, .item-right {
1833 nav.sub, .content .out-of-band {
1838 @media (max-width: 464px) {
1839 #titles, #titles > button {
1843 /* This is to prevent the search bar from being underneath the <section>
1844 * element following it.
1850 #main > table:not(.table-display) td {
1851 word-break: break-word;
1855 .search-container > div {
1857 width: calc(100% - 37px);
1866 #crate-search + .search-input {
1867 width: calc(100% + 71px);
1871 #theme-picker, #settings-menu {