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 {
1112 display: inline-block;
1119 padding: 5px 3px 3px 3px;
1125 .tooltip.ignore::after {
1126 content: "This example is not tested";
1128 .tooltip.compile_fail::after {
1129 content: "This example deliberately fails to compile";
1131 .tooltip.should_panic::after {
1132 content: "This example panics";
1134 .tooltip.edition::after {
1135 content: "This code runs with edition " attr(data-edition);
1145 border-style: solid;
1149 .tooltip:hover::before, .tooltip:hover::after {
1153 .tooltip.compile_fail, .tooltip.should_panic, .tooltip.ignore {
1158 .notable-traits-tooltip {
1159 display: inline-block;
1163 .notable-traits:hover .notable-traits-tooltiptext,
1164 .notable-traits .notable-traits-tooltiptext.force-tooltip {
1165 display: inline-block;
1168 .notable-traits .notable-traits-tooltiptext {
1170 padding: 5px 3px 3px 3px;
1180 .notable-traits-tooltip::after {
1181 /* The margin on the tooltip does not capture hover events,
1182 this extends the area of hover enough so that mouse hover is not
1183 lost when moving the mouse to the tooltip */
1184 content: "\00a0\00a0\00a0";
1187 .notable-traits .notable, .notable-traits .docblock {
1191 .notable-traits .notable {
1193 margin-bottom: 13px;
1198 .notable-traits .docblock code.content{
1204 /* Example code has the "Run" button that needs to be positioned relative to the pre */
1205 pre.rust.rust-example-rendered {
1220 .search-failed.active {
1224 .search-failed > ul {
1242 border-top: 2px solid;
1245 #titles > button:not(:last-child) {
1247 width: calc(33.3% - 1px);
1250 #titles > button > div.count {
1251 display: inline-block;
1265 margin-bottom: 10px;
1279 border-top-right-radius: 3px;
1280 border-bottom-right-radius: 3px;
1283 transition: left .5s;
1296 transition: left .5s;
1297 border-right: 1px solid;
1299 #source-sidebar > .title {
1302 border-bottom: 1px solid;
1312 .theme-picker button {
1316 #settings-menu, #help-button {
1326 #theme-picker, #settings-menu, #help-button, #copy-path {
1337 font-family: "Fira Sans", Arial, sans-serif;
1344 background: initial;
1362 #theme-choices > button {
1367 background: rgba(0,0,0,0);
1370 #theme-choices > button:not(:first-child) {
1371 border-top: 1px solid;
1375 display: inline-block;
1377 font: 15px monospace;
1379 vertical-align: middle;
1382 box-shadow: inset 0 -1px 0;
1386 .hidden-by-impl-hider,
1387 .hidden-by-usual-hider {
1388 /* important because of conflicting rule for small screens */
1389 display: none !important;
1392 #implementations-list > h3 > span.in-band {
1399 border-collapse: collapse;
1404 .table-display tr td:first-child {
1408 .table-display tr td:last-child {
1411 .table-display .out-of-band {
1416 #implementors-list > .impl-items .table-display .out-of-band {
1420 .table-display td:hover .anchor {
1450 div.files > a:hover, div.name:hover {
1451 background-color: #a14b4b;
1453 div.name.expand + .children {
1464 div.name.expand::before {
1465 transform: rotate(90deg);
1470 /* The hideme class is used on summary tags that contain a span with
1471 placeholder text shown only when the toggle is closed. For instance,
1472 "Expand description" or "Show methods". */
1473 details.rustdoc-toggle > summary.hideme {
1477 details.rustdoc-toggle > summary, details.undocumented > summary {
1480 details.rustdoc-toggle > summary::-webkit-details-marker,
1481 details.rustdoc-toggle > summary::marker,
1482 details.undocumented > summary::-webkit-details-marker,
1483 details.undocumented > summary::marker {
1487 details.rustdoc-toggle > summary.hideme > span {
1491 details.rustdoc-toggle > summary::before {
1495 letter-spacing: 1px;
1499 details.rustdoc-toggle.top-doc > summary,
1500 details.rustdoc-toggle.top-doc > summary::before,
1501 details.rustdoc-toggle.non-exhaustive > summary,
1502 details.rustdoc-toggle.non-exhaustive > summary::before {
1503 font-family: 'Fira Sans';
1507 details.non-exhaustive {
1511 details.rustdoc-toggle > summary.hideme::before {
1515 details.rustdoc-toggle > summary:not(.hideme)::before {
1521 .impl-items > details.rustdoc-toggle > summary:not(.hideme)::before,
1522 .undocumented > details.rustdoc-toggle > summary:not(.hideme)::before {
1527 /* When a "hideme" summary is open and the "Expand description" or "Show
1528 methods" text is hidden, we want the [-] toggle that remains to not
1529 affect the layout of the items to its right. To do that, we use
1530 absolute positioning. Note that we also set position: relative
1531 on the parent <details> to make this work properly. */
1532 details.rustdoc-toggle[open] > summary.hideme {
1536 details.rustdoc-toggle, details.undocumented {
1540 details.rustdoc-toggle[open] > summary.hideme > span {
1544 details.rustdoc-toggle[open] > summary::before {
1549 details.undocumented > summary::before {
1550 content: "[+] Show hidden undocumented items";
1556 details.undocumented[open] > summary::before {
1557 content: "[−] Hide undocumented items";
1562 @media (min-width: 701px) {
1563 /* In case there is no documentation before a code block, we need to add some margin at the top
1564 to prevent an overlay between the "collapse toggle" and the information tooltip.
1565 However, it's not needed with smaller screen width because the doc/code block is always put
1566 "one line" below. */
1567 .docblock > .information:first-child > .tooltip {
1572 @media (max-width: 700px) {
1577 .rustdoc > .sidebar {
1587 .sidebar > .location {
1591 padding: 3px 10px 1px 10px;
1593 background: inherit;
1598 .sidebar .location:empty {
1602 .sidebar .logo-container {
1611 .sidebar .logo-container > img {
1625 border-bottom: 1px solid;
1626 border-right: 1px solid;
1630 .rustdoc.source > .sidebar > .sidebar-menu {
1641 border-right: 1px solid;
1645 .sidebar > .block.version {
1647 border-bottom: none;
1652 .sidebar > .block.version > div.narrow-helper {
1657 .sidebar > .block.version > p {
1658 /* hide Version text if too narrow */
1661 /* vertically center */
1663 align-items: center;
1668 width: calc(100% - 32px);
1686 display: none !important;
1701 #titles > button > div.count {
1714 background-color: rgba(0,0,0,0);
1718 This allows to prevent the version text to overflow the sidebar title on mobile mode when the
1719 sidebar is displayed (after clicking on the "hamburger" button).
1721 .sidebar.mobile > div.version {
1726 width: calc(100% + 30px);
1734 .show-it > .block.items {
1738 .show-it > .block.items > ul {
1742 .show-it > .block.items > ul > li {
1747 .show-it > .block.items > ul > li > a {
1751 /* Because of ios, we need to actually have a full height sidebar title so the
1752 * actual sidebar can show up. But then we need to make it transparent so we don't
1753 * hide content. The filler just allows to create the background for the sidebar
1754 * title. But because of the absolute position, I had to lower the z-index.
1759 width: calc(100% - 45px);
1763 border-bottom: 1px solid;
1766 #main > details.rustdoc-toggle > summary::before,
1767 #main > div > details.rustdoc-toggle > summary::before {
1787 #main > .line-numbers {
1791 .notable-traits .notable-traits-tooltiptext {
1796 /* We don't display the help button on mobile devices. */
1801 /* Display an alternating layout on tablets and phones */
1804 flex-flow: column wrap;
1806 .item-left, .item-right {
1810 .search-container > div {
1811 width: calc(100% - 32px);
1814 /* Display an alternating layout on tablets and phones */
1815 .search-results > a {
1816 border-bottom: 1px solid #aaa9;
1819 .search-results .result-name, .search-results div.desc, .search-results .result-description {
1822 .search-results div.desc, .search-results .result-description, .item-right {
1828 nav.sub, .content .out-of-band {
1833 @media (max-width: 464px) {
1834 #titles, #titles > button {
1838 /* This is to prevent the search bar from being underneath the <section>
1839 * element following it.
1845 #main > table:not(.table-display) td {
1846 word-break: break-word;
1850 .search-container > div {
1852 width: calc(100% - 37px);
1861 #crate-search + .search-input {
1862 width: calc(100% + 71px);
1866 #theme-picker, #settings-menu {