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");
11 font-family: 'Fira Sans';
14 src: local('Fira Sans Medium'),
15 url("FiraSans-Medium.woff2") format("woff2");
19 /* See SourceSerif4-LICENSE.md for the Source Serif 4 license. */
21 font-family: 'Source Serif 4';
24 src: local('Source Serif 4'),
25 url("SourceSerif4-Regular.ttf.woff2") format("woff2");
29 font-family: 'Source Serif 4';
32 src: local('Source Serif 4 Italic'),
33 url("SourceSerif4-It.ttf.woff2") format("woff2");
37 font-family: 'Source Serif 4';
40 src: local('Source Serif 4 Bold'),
41 url("SourceSerif4-Bold.ttf.woff2") format("woff2");
45 /* See SourceCodePro-LICENSE.txt for the Source Code Pro license. */
47 font-family: 'Source Code Pro';
50 /* Avoid using locally installed font because bad versions are in circulation:
51 * see https://github.com/rust-lang/rust/issues/24355 */
52 src: url("SourceCodePro-Regular.ttf.woff2") format("woff2");
56 font-family: 'Source Code Pro';
59 src: url("SourceCodePro-It.ttf.woff2") format("woff2");
63 font-family: 'Source Code Pro';
66 src: url("SourceCodePro-Semibold.ttf.woff2") format("woff2");
70 /* Avoid using legacy CJK serif fonts in Windows like Batang. */
72 font-family: 'NanumBarunGothic';
73 src: url("NanumBarunGothic.ttf.woff2") format("woff2");
75 unicode-range: U+AC00-D7AF, U+1100-11FF, U+3130-318F, U+A960-A97F, U+D7B0-D7FF;
79 -webkit-box-sizing: border-box;
80 -moz-box-sizing: border-box;
81 box-sizing: border-box;
84 /* This part handles the "default" theme being used depending on the system one. */
88 @media (prefers-color-scheme: light) {
93 @media (prefers-color-scheme: dark) {
99 /* General structure and fonts */
102 /* Line spacing at least 1.5 per Web Content Accessibility Guidelines
103 https://www.w3.org/WAI/WCAG21/Understanding/visual-presentation.html */
104 font: 1rem/1.5 "Source Serif 4", NanumBarunGothic, serif;
107 /* We use overflow-wrap: break-word for Safari, which doesn't recognize
108 `anywhere`: https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-wrap */
109 overflow-wrap: break-word;
110 /* Then override it with `anywhere`, which is required to make non-Safari browsers break
111 more aggressively when we want them to. */
112 overflow-wrap: anywhere;
114 -webkit-font-feature-settings: "kern", "liga";
115 -moz-font-feature-settings: "kern", "liga";
116 font-feature-settings: "kern", "liga";
118 background-color: var(--main-background-color);
119 color: var(--main-color);
123 font-size: 1.5rem; /* 24px */
126 font-size: 1.375rem; /* 22px */
129 font-size: 1.25rem; /* 20px */
131 h1, h2, h3, h4, h5, h6 {
135 margin: 20px 0 15px 0;
138 .docblock h3, .docblock h4, h5, h6 {
139 margin: 15px 0 5px 0;
144 border-bottom-color: var(--headings-border-bottom-color);
147 border-bottom-color: var(--headings-border-bottom-color);
152 justify-content: space-between;
156 .main-heading a:hover {
157 text-decoration: underline;
160 text-decoration: none;
162 /* The only headings that get underlines are:
163 Markdown-generated headings within the top-doc
164 Rustdoc-generated h2 section headings (e.g. "Implementations", "Required Methods", etc)
165 Underlines elsewhere in the documentation break up visual flow and tend to invert
166 section hierarchies. */
168 .top-doc .docblock > h3,
169 .top-doc .docblock > h4 {
170 border-bottom: 1px solid var(--headings-border-bottom-color);
173 font-size: 1.125rem; /* 18px */
180 border-bottom-style: none;
184 margin-bottom: 0.4em;
191 .impl-items .associatedconstant,
192 .methods .associatedconstant,
193 .impl-items .associatedtype,
194 .methods .associatedtype {
200 h1, h2, h3, h4, h5, h6,
205 .search-results .result-name,
209 details.rustdoc-toggle > summary::before,
210 .content ul.crate a.crate,
212 #help-button > button,
213 details.rustdoc-toggle.top-doc > summary,
214 details.rustdoc-toggle.top-doc > summary::before,
215 details.rustdoc-toggle.non-exhaustive > summary,
216 details.rustdoc-toggle.non-exhaustive > summary::before,
217 .scraped-example-title,
218 .more-examples-toggle summary, .more-examples-toggle .hide-more,
220 /* This selector is for the items listed in the "all items" page. */
221 #main-content > ul.docblock > li > a {
222 font-family: "Fira Sans", Arial, NanumBarunGothic, sans-serif;
228 .small-section-header a,
238 .result-name .primitive > i, .result-name .keyword > i,
239 .content .method .where,
241 .content .where.fmt-newline {
242 color: var(--main-color);
248 ul ul, ol ul, ul ol, ol ol {
249 margin-bottom: .625em;
253 /* Paragraph spacing at least 1.5 times line spacing per Web Content Accessibility Guidelines.
254 Line-height is 1.5rem, so line spacing is .5rem; .75em is 1.5 times that.
255 https://www.w3.org/WAI/WCAG21/Understanding/visual-presentation.html */
263 /* Fix some style changes due to normalize.css 8 */
271 border-collapse: collapse;
285 /* Buttons on Safari have different default padding than other platforms. Make them the same. */
289 /* end tweaks for normalize.css 8 */
300 padding: 10px 15px 40px 45px;
313 .source .width-limiter {
317 details:not(.rustdoc-toggle) summary {
321 code, pre, a.test-arrow, .code-header {
322 font-family: "Source Code Pro", monospace;
324 .docblock code, .docblock-short code {
328 .docblock pre code, .docblock-short pre code {
334 .docblock.item-decl {
341 .source .content pre {
361 .sub-logo-container {
366 .source .sub-logo-container {
370 .source .sub-logo-container > img {
376 .sidebar, .mobile-topbar, .sidebar-menu-toggle {
377 background-color: var(--sidebar-background-color);
392 .sidebar > .location {
397 overflow-wrap: anywhere;
400 .rustdoc.source .sidebar {
407 border-right: 1px solid;
409 /* The sidebar is by default hidden */
413 .rustdoc.source .sidebar .sidebar-logo {
417 .source .sidebar, #sidebar-toggle, #source-sidebar {
418 background-color: var(--sidebar-background-color);
421 #sidebar-toggle > button:hover, #sidebar-toggle > button:focus {
422 background-color: var(--sidebar-background-color-hover);
425 .source .sidebar > *:not(#sidebar-toggle) {
430 .source-sidebar-expanded .source .sidebar {
434 .source-sidebar-expanded .source .sidebar > *:not(#sidebar-toggle) {
443 /* Improve the scrollbar display on firefox */
445 scrollbar-width: initial;
446 scrollbar-color: var(--scrollbar-color);
449 scrollbar-width: thin;
450 scrollbar-color: var(--scrollbar-color);
453 /* Improve the scrollbar display on webkit-based browsers */
454 ::-webkit-scrollbar {
457 .sidebar::-webkit-scrollbar {
460 ::-webkit-scrollbar-track {
461 -webkit-box-shadow: inset 0;
462 background-color: var(--scrollbar-track-background-color);
464 .sidebar::-webkit-scrollbar-track {
465 background-color: var(--scrollbar-track-background-color);
467 ::-webkit-scrollbar-thumb, .sidebar::-webkit-scrollbar-thumb {
468 background-color: var(--scrollbar-thumb-background-color);
471 /* Everything else */
474 display: none !important;
477 .sidebar .logo-container {
481 justify-content: center;
485 overflow-wrap: break-word;
488 .logo-container > img {
497 .location a:first-of-type {
504 .block ul, .block li {
514 margin-left: -0.25rem;
516 text-overflow: ellipsis;
526 margin-bottom: 0.7rem;
530 font-size: 1.125rem; /* 18px */
536 .sidebar-elems .block {
540 .sidebar-elems .block li a {
548 .source .content pre.rust {
554 .rustdoc .example-wrap {
555 display: inline-flex;
564 .example-wrap > pre.line-number {
569 border-top-left-radius: 5px;
570 border-bottom-left-radius: 5px;
573 .example-wrap > pre.rust a:hover {
574 text-decoration: underline;
580 .rustdoc:not(.source) .example-wrap > pre:not(.line-number) {
585 .rustdoc:not(.source) .example-wrap > pre.line-numbers {
590 .rustdoc .example-wrap > pre {
598 .content > .example-wrap pre.line-numbers {
600 -webkit-user-select: none;
601 -moz-user-select: none;
602 -ms-user-select: none;
610 overflow-wrap: break-word;
611 overflow-wrap: anywhere;
616 text-overflow: ellipsis;
619 /* Wrap non-pre code blocks (`text`) but not (```text```). */
620 .docblock > :not(pre) > code,
621 .docblock-short > :not(pre) > code {
622 white-space: pre-wrap;
625 .top-doc .docblock h2 { font-size: 1.375rem; }
626 .top-doc .docblock h3 { font-size: 1.25rem; }
627 .top-doc .docblock h4,
628 .top-doc .docblock h5 {
631 .top-doc .docblock h6 {
635 .docblock h5 { font-size: 1rem; }
636 .docblock h6 { font-size: 0.875rem; }
637 .docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5, .docblock h6 {
638 border-bottom-color: var(--headings-border-bottom-color);
646 .docblock > :not(.more-examples-toggle):not(.example-wrap) {
651 .content .out-of-band {
658 .method > .code-header, .trait-impl > .code-header {
659 max-width: calc(100% - 41px);
667 /* We use overflow-wrap: break-word for Safari, which doesn't recognize
668 `anywhere`: https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-wrap */
669 overflow-wrap: break-word;
670 /* Then override it with `anywhere`, which is required to make non-Safari browsers break
671 more aggressively when we want them to. */
672 overflow-wrap: anywhere;
673 background-color: var(--main-background-color);
676 .in-band > code, .in-band > .code-header {
677 display: inline-block;
680 .docblock code, .docblock-short code,
681 pre, .rustdoc.source .example-wrap {
682 background-color: var(--code-block-background-color);
690 border-spacing: 0 5px;
692 .content td { vertical-align: top; }
693 .content td:first-child { padding-right: 20px; }
694 .content td p:first-child { margin-top: 0; }
695 .content td h1, .content td h2 { margin-left: 0; font-size: 1.125rem; }
696 .content tr:first-child td { border-top: 0; }
700 width: calc(100% - 2px);
707 border: 1px dashed var(--border-color);
713 border: 1px solid var(--border-color);
716 .content .item-list {
717 list-style-type: none;
721 .content > .methods > .method {
725 /* Shift "where ..." part of method or fn definition down a line */
726 .content .method .where,
728 .content .where.fmt-newline {
737 .content .item-info code {
741 .content .item-info {
746 .content .impl-items .docblock, .content .impl-items .item-info {
750 #main-content > .item-info {
764 nav.sum { text-align: right; }
765 nav.sub form { display: inline; }
768 text-decoration: none;
771 .small-section-header {
773 justify-content: space-between;
777 .small-section-header:hover > .anchor {
781 .in-band:hover > .anchor, .impl:hover > .anchor, .method.trait-impl:hover > .anchor,
782 .type.trait-impl:hover > .anchor, .associatedconstant.trait-impl:hover > .anchor,
783 .associatedtype.trait-impl:hover > .anchor {
784 display: inline-block;
791 background: none !important;
796 .small-section-header > .anchor {
800 h2.small-section-header > .anchor {
807 .docblock a:not(.srclink):not(.test-arrow):not(.scrape-help):hover,
808 .docblock-short a:not(.srclink):not(.test-arrow):not(.scrape-help):hover, .item-info a {
809 text-decoration: underline;
812 .block a.current.crate { font-weight: 500; }
814 /* In most contexts we use `overflow-wrap: anywhere` to ensure that we can wrap
815 as much as needed on mobile (see
816 src/test/rustdoc-gui/type-declaration-overflow.goml for an example of why
817 this matters). The `anywhere` value means:
819 "Soft wrap opportunities introduced by the word break are considered when
820 calculating min-content intrinsic sizes."
822 https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-wrap#values
824 For table layouts, that becomes a problem: the browser tries to make each
825 column as narrow as possible, and `overflow-wrap: anywhere` means it can do
826 so by breaking words - even if some other column could be shrunk without
827 breaking words! This shows up, for instance, in the `Structs` / `Modules` /
828 `Functions` (etcetera) sections of a module page, and when a docblock
831 So, for table layouts, override the default with break-word, which does
832 _not_ affect min-content intrinsic sizes.
836 overflow-wrap: break-word;
845 .item-left, .item-right {
849 padding-right: 1.25rem;
858 .search-container > * {
861 .search-results-title {
864 /* flex layout allows shrinking the <select> appropriately if it becomes too large */
865 display: inline-flex;
867 /* make things look like in a line, despite the fact that we're using a layout
868 with boxes (i.e. from the flex layout) */
869 align-items: baseline;
872 display: inline-block;
873 /* ensures that 100% in properties of #crate-search-div:after
874 are relative to the size of this div */
876 /* allows this div (and with it the <select>-element "#crate-search") to be shrunk */
882 /* keep these two in sync with "@-moz-document url-prefix()" below */
885 /* prevents the <select> from overflowing the containing div in case it's shrunk */
887 /* contents can overflow because of max-width limit, then show ellipsis */
888 text-overflow: ellipsis;
889 border: 1px solid var(--border-color);
893 -moz-appearance: none;
894 -webkit-appearance: none;
895 /* Removes default arrow from firefox */
897 background-color: var(--main-background-color);
899 /* cancel stylistic differences in padding in firefox
900 for "appearance: none"-style (or equivalent) <select>s */
901 @-moz-document url-prefix() {
903 padding-left: 0px; /* == 4px - 4px */
904 padding-right: 19px; /* == 23px - 4px */
907 /* pseudo-element for holding the dropdown-arrow image; needs to be a separate thing
908 so that we can apply CSS-filters to change the arrow color in themes */
909 #crate-search-div::after {
910 /* lets clicks through! */
911 pointer-events: none;
912 /* completely covers the underlying div */
919 background-repeat: no-repeat;
920 background-size: 20px;
921 background-position: calc(100% - 2px) 56%;
922 /* image is black color, themes should apply a "filter" property to change the color */
923 background-image: /* AUTOREPLACE: */url("down-arrow.svg");
925 #crate-search > option {
929 /* Override Normalize.css: it has a rule that sets
930 -webkit-appearance: textfield for search inputs. That
931 causes rounded corners and no border on iOS Safari. */
932 -webkit-appearance: none;
933 /* Override Normalize.css: we have margins and do
934 not want to overflow - the `moz` attribute is necessary
935 until Firefox 29, too early to drop at this point */
936 -moz-box-sizing: border-box !important;
937 box-sizing: border-box !important;
939 border: 1px solid var(--border-color);
944 background-color: var(--button-background-color);
946 .search-input:focus {
947 border-color: var(--search-input-focused-border-color);
955 .search-results.active {
957 /* prevent overhanging tabs from moving the first result */
961 .search-results .desc > span {
963 text-overflow: ellipsis;
968 .search-results > a {
970 /* A little margin ensures the browser's outlining of focused links has room to display. */
973 border-bottom: 1px solid #aaa3;
976 .search-results > a > div {
981 .search-results .result-name, .search-results div.desc, .search-results .result-description {
984 .search-results .result-name {
996 border: 1px solid var(--border-color);
1000 /* This rule is to draw the little arrow connecting the settings menu to the gear icon. */
1005 border: solid var(--border-color);
1006 border-width: 1px 1px 0 0;
1007 display: inline-block;
1009 transform: rotate(-45deg);
1013 .popover, .popover::before {
1014 background-color: var(--main-background-color);
1015 color: var(--main-color);
1018 #help-button .popover {
1022 #help-button .popover::before {
1030 margin-right: 0.5rem;
1032 #help-button span.top, #help-button span.bottom {
1035 font-size: 1.125rem;
1037 #help-button span.top {
1041 border-bottom: 1px solid var(--border-color);
1042 padding-bottom: 4px;
1045 #help-button span.bottom {
1047 border-top: 1px solid var(--border-color);
1050 text-align: initial;
1052 .side-by-side > div {
1055 padding: 0 20px 20px 17px;
1060 /* This min-height is needed to unify the height of the stab elements because some of them
1065 align-items: center;
1066 white-space: pre-wrap;
1071 font-size: 0.875rem;
1072 font-weight: normal;
1081 margin-right: 0.3rem;
1084 /* Black one-pixel outline around emoji shapes */
1094 .import-item .stab {
1096 display: inline-block;
1097 font-size: 0.875rem;
1100 margin-left: 0.3125em;
1102 vertical-align: text-bottom;
1105 .module-item.unstable,
1106 .import-item.unstable {
1111 font-weight: normal;
1124 color: var(--right-side-color);
1128 .impl-items .srclink, .impl .srclink, .methods .srclink {
1129 /* Override header settings otherwise it's too bold */
1130 font-weight: normal;
1142 pre.rust .question-mark {
1146 .example-wrap.compile_fail,
1147 .example-wrap.should_panic {
1148 border-left: 2px solid var(--codeblock-error-color);
1151 .ignore.example-wrap {
1152 border-left: 2px solid var(--codeblock-ignore-color);
1155 .example-wrap.compile_fail:hover,
1156 .example-wrap.should_panic:hover {
1157 border-left: 2px solid var(--codeblock-error-hover-color);
1160 .example-wrap.ignore:hover {
1161 border-left: 2px solid var(--codeblock-ignore-hover-color);
1164 .example-wrap.compile_fail .tooltip,
1165 .example-wrap.should_panic .tooltip {
1166 color: var(--codeblock-error-color);
1169 .example-wrap.ignore .tooltip {
1170 color: var(--codeblock-ignore-color);
1173 .example-wrap.compile_fail:hover .tooltip,
1174 .example-wrap.should_panic:hover .tooltip {
1175 color: var(--codeblock-error-hover-color);
1178 .example-wrap.ignore:hover .tooltip {
1179 color: var(--codeblock-ignore-hover-color);
1182 .example-wrap .tooltip {
1190 .example-wrap .tooltip::after {
1193 padding: 5px 3px 3px 3px;
1197 border: 1px solid var(--border-color);
1204 .example-wrap .tooltip::before {
1211 border-style: solid;
1216 .example-wrap.ignore .tooltip::after {
1217 content: "This example is not tested";
1219 .example-wrap.compile_fail .tooltip::after {
1220 content: "This example deliberately fails to compile";
1222 .example-wrap.should_panic .tooltip::after {
1223 content: "This example panics";
1225 .example-wrap.edition .tooltip::after {
1226 content: "This code runs with edition " attr(data-edition);
1229 .example-wrap .tooltip:hover::before, .example-wrap .tooltip:hover::after {
1233 .example-wrap.compile_fail .tooltip,
1234 .example-wrap.should_panic .tooltip,
1235 .example-wrap.ignore .tooltip {
1241 display: inline-block;
1244 padding: 5px 10px 5px 10px;
1246 font-size: 1.375rem;
1251 .example-wrap:hover .test-arrow {
1252 visibility: visible;
1254 a.test-arrow:hover {
1255 text-decoration: none;
1260 color: var(--code-attribute-color);
1268 .out-of-band > span.since {
1275 font-size: 1.125rem;
1276 margin-bottom: 10px;
1277 border-bottom: none;
1283 border-bottom: none;
1290 margin-bottom: 40px;
1293 .sub-variant > .sub-variant-field {
1297 :target > code, :target > .code-header {
1305 .notable-traits-tooltip {
1306 display: inline-block;
1310 .notable-traits:hover .notable-traits-tooltiptext,
1311 .notable-traits .notable-traits-tooltiptext.force-tooltip {
1312 display: inline-block;
1315 .notable-traits .notable-traits-tooltiptext {
1317 padding: 5px 3px 3px 3px;
1327 .notable-traits-tooltip::after {
1328 /* The margin on the tooltip does not capture hover events,
1329 this extends the area of hover enough so that mouse hover is not
1330 lost when moving the mouse to the tooltip */
1331 content: "\00a0\00a0\00a0";
1334 .notable-traits .notable, .notable-traits .docblock {
1338 .notable-traits .notable {
1340 margin-bottom: 13px;
1341 font-size: 1.1875rem;
1346 .notable-traits .docblock code.content {
1352 /* Example code has the "Run" button that needs to be positioned relative to the pre */
1353 pre.rust.rust-example-rendered {
1368 .search-failed.active {
1372 .search-failed > ul {
1387 font-size: 1.125rem;
1390 border-top: 2px solid;
1393 #titles > button:first-child:last-child {
1395 width: calc(100% - 1px);
1398 #titles > button:not(:last-child) {
1400 width: calc(33.3% - 1px);
1403 #titles > button > div.count {
1404 display: inline-block;
1420 border-bottom: 1px solid;
1423 justify-content: center;
1424 align-items: center;
1432 #source-sidebar > .title {
1435 border-bottom: 1px solid var(--border-color);
1438 #sidebar-toggle > button {
1450 /* work around button layout strangeness: https://stackoverflow.com/q/7271561 */
1452 /* iOS button gradient: https://stackoverflow.com/q/5438567 */
1453 -webkit-appearance: none;
1456 #settings-menu, #help-button {
1461 #settings-menu > a, #help-button > button, #copy-path {
1464 border: 1px solid var(--border-color);
1469 #settings-menu > a, #help-button > button {
1473 background-color: var(--button-background-color);
1477 color: var(--copy-path-button-color);
1480 filter: var(--copy-path-img-filter);
1482 #copy-path:hover > img {
1483 filter: var(--copy-path-img-hover-filter);
1486 @keyframes rotating {
1488 transform: rotate(0deg);
1491 transform: rotate(360deg);
1494 #settings-menu.rotate > a img {
1495 animation: rotating 2s linear infinite;
1498 .setting-line .radio-line input:checked {
1499 box-shadow: inset 0 0 0 3px var(--main-background-color);
1500 background-color: var(--settings-input-color);
1502 .setting-line .radio-line input:focus {
1503 box-shadow: 0 0 1px 1px var(--settings-input-color);
1505 /* In here we combine both `:focus` and `:checked` properties. */
1506 .setting-line .radio-line input:checked:focus {
1507 box-shadow: inset 0 0 0 3px var(--main-background-color),
1508 0 0 2px 2px var(--settings-input-color);
1510 .setting-line .radio-line input:hover {
1511 border-color: var(--settings-input-color) !important;
1513 input:checked + .slider {
1514 background-color: var(--settings-input-color);
1517 #help-button > button {
1519 /* Rare exception to specifying font sizes in rem. Since this is acting
1520 as an icon, it's okay to specify their sizes in pixels. */
1527 background-color: var(--main-background-color);
1535 display: inline-block;
1537 font: 15px monospace;
1539 vertical-align: middle;
1540 border: solid 1px var(--border-color);
1545 #main-content > ul {
1548 #main-content > ul > li {
1560 details.dir-entry > summary {
1562 list-style-position: outside;
1566 details.dir-entry div.folders, details.dir-entry div.files {
1570 details.dir-entry a {
1574 /* The hideme class is used on summary tags that contain a span with
1575 placeholder text shown only when the toggle is closed. For instance,
1576 "Expand description" or "Show methods". */
1577 details.rustdoc-toggle > summary.hideme {
1581 details.rustdoc-toggle > summary {
1584 details.rustdoc-toggle > summary::-webkit-details-marker,
1585 details.rustdoc-toggle > summary::marker {
1589 details.rustdoc-toggle > summary.hideme > span {
1593 details.rustdoc-toggle > summary::before {
1598 background-repeat: no-repeat;
1599 background-position: top left;
1600 display: inline-block;
1601 vertical-align: middle;
1605 details.rustdoc-toggle > summary.hideme > span,
1606 details.rustdoc-toggle > summary::before,
1607 .more-examples-toggle summary, .more-examples-toggle .hide-more {
1608 color: var(--toggles-color);
1611 /* Screen readers see the text version at the end the line.
1612 Visual readers see the icon at the start of the line, but small and transparent. */
1613 details.rustdoc-toggle > summary::after {
1621 details.rustdoc-toggle > summary.hideme::after {
1622 /* "hideme" toggles already have a description when they're contracted */
1626 details.rustdoc-toggle > summary:focus::before,
1627 details.rustdoc-toggle > summary:hover::before {
1631 details.rustdoc-toggle.top-doc > summary,
1632 details.rustdoc-toggle.top-doc > summary::before,
1633 details.rustdoc-toggle.non-exhaustive > summary,
1634 details.rustdoc-toggle.non-exhaustive > summary::before {
1638 details.non-exhaustive {
1642 details.rustdoc-toggle > summary.hideme::before {
1646 details.rustdoc-toggle > summary:not(.hideme)::before {
1652 .impl-items > details.rustdoc-toggle > summary:not(.hideme)::before {
1657 /* When a "hideme" summary is open and the "Expand description" or "Show
1658 methods" text is hidden, we want the [-] toggle that remains to not
1659 affect the layout of the items to its right. To do that, we use
1660 absolute positioning. Note that we also set position: relative
1661 on the parent <details> to make this work properly. */
1662 details.rustdoc-toggle[open] > summary.hideme {
1666 details.rustdoc-toggle {
1670 details.rustdoc-toggle[open] > summary.hideme > span {
1674 details.rustdoc-toggle[open] > summary::before,
1675 details.rustdoc-toggle[open] > summary.hideme::before {
1676 background-image: /* AUTOREPLACE: */url("toggle-minus.svg");
1679 details.rustdoc-toggle > summary::before {
1680 background-image: /* AUTOREPLACE: */url("toggle-plus.svg");
1683 details.rustdoc-toggle[open] > summary::before,
1684 details.rustdoc-toggle[open] > summary.hideme::before {
1687 background-repeat: no-repeat;
1688 background-position: top left;
1689 display: inline-block;
1693 details.rustdoc-toggle[open] > summary::after,
1694 details.rustdoc-toggle[open] > summary.hideme::after {
1695 content: "Collapse";
1698 /* This is needed in docblocks to have the "â–¶" element to be on the same line. */
1699 .docblock summary > * {
1700 display: inline-block;
1706 WARNING: RUSTDOC_MOBILE_BREAKPOINT MEDIA QUERY;
1707 If you update this line, then you also need to update the line with the same warning
1708 in storage.js plus the media query with (max-width: 700px)
1710 @media (min-width: 701px) {
1711 /* In case there is no documentation before a code block, we need to add some margin at the top
1712 to prevent an overlay between the "collapse toggle" and the information tooltip.
1713 However, it's not needed with smaller screen width because the doc/code block is always put
1714 "one line" below. */
1715 .docblock > .example-wrap:first-child .tooltip {
1719 /* When we expand the sidebar on the source code page, we hide the logo on the left of the
1720 search bar to have more space. */
1721 .source-sidebar-expanded .source .sidebar + main .width-limiter .sub-logo-container.rust-logo {
1725 .source-sidebar-expanded .source .sidebar {
1731 WARNING: RUSTDOC_MOBILE_BREAKPOINT MEDIA QUERY
1732 If you update this line, then you also need to update the line with the same warning
1733 in storage.js plus the media query with (min-width: 701px)
1735 @media (max-width: 700px) {
1736 /* When linking to an item with an `id` (for instance, by clicking a link in the sidebar,
1737 or visiting a URL with a fragment like `#method.new`, we don't want the item to be obscured
1738 by the topbar. Anything with an `id` gets scroll-margin-top equal to .mobile-topbar's size.
1741 scroll-margin-top: 45px;
1746 /* Sidebar should overlay main content, rather than pushing main content to the right.
1747 Turn off `display: flex` on the body element. */
1757 flex-direction: column;
1760 .content .out-of-band {
1762 margin-left: initial;
1766 .content .out-of-band .since::before {
1774 /* Hide the logo and item name from the sidebar. Those are displayed
1775 in the mobile-topbar instead. */
1776 .sidebar .sidebar-logo,
1777 .sidebar .location {
1784 /* Hide the sidebar offscreen while not in use. Doing this instead of display: none means
1785 the sidebar stays visible for screen readers, which is useful for navigation. */
1791 /* Reduce height slightly to account for mobile topbar. */
1792 height: calc(100vh - 45px);
1795 /* The source view uses a different design for the sidebar toggle, and doesn't have a topbar,
1796 so don't bump down the main content or the sidebar. */
1798 .rustdoc.source .sidebar {
1806 .source-sidebar-expanded .source .sidebar,
1807 .sidebar:focus-within {
1811 .rustdoc.source > .sidebar {
1818 .mobile-topbar .location a {
1823 .mobile-topbar .location {
1826 margin: auto 0.5em auto auto;
1827 text-overflow: ellipsis;
1829 white-space: nowrap;
1830 /* Rare exception to specifying font sizes in rem. Since the topbar
1831 height is specified in pixels, this also has to be specified in
1832 pixels to avoid overflowing the topbar when the user sets a bigger
1837 .mobile-topbar .logo-container {
1841 .mobile-topbar .logo-container > img {
1851 flex-direction: row;
1861 .source .mobile-topbar {
1865 .sidebar-menu-toggle {
1867 /* Rare exception to specifying font sizes in rem. Since this is acting
1868 as an icon, it's okay to specify its sizes in pixels. */
1875 background-color: var(--sidebar-background-color);
1887 display: none !important;
1896 #titles > button > div.count {
1905 /* Because of ios, we need to actually have a full height sidebar title so the
1906 * actual sidebar can show up. But then we need to make it transparent so we don't
1907 * hide content. The filler just allows to create the background for the sidebar
1908 * title. But because of the absolute position, I had to lower the z-index.
1913 width: calc(100% - 45px);
1917 border-bottom: 1px solid;
1920 #main-content > details.rustdoc-toggle > summary::before,
1921 #main-content > div > details.rustdoc-toggle > summary::before {
1934 border-top-right-radius: 3px;
1935 border-bottom-right-radius: 3px;
1942 .source-sidebar-expanded #sidebar-toggle {
1946 border-top-right-radius: unset;
1947 border-bottom-right-radius: unset;
1950 border-bottom: 1px solid;
1957 #main-content > .line-numbers {
1961 .notable-traits .notable-traits-tooltiptext {
1966 /* We don't display the help button on mobile devices. */
1971 /* Display an alternating layout on tablets and phones */
1977 flex-flow: column wrap;
1979 .item-left, .item-right {
1983 /* Display an alternating layout on tablets and phones */
1984 .search-results > a {
1985 border-bottom: 1px solid #aaa9;
1988 .search-results .result-name, .search-results div.desc, .search-results .result-description {
1991 .search-results div.desc, .search-results .result-description, .item-right {
1995 .source-sidebar-expanded .source .sidebar {
2000 /* Position of the "[-]" element. */
2001 details.rustdoc-toggle:not(.top-doc) > summary {
2004 .impl-items > details.rustdoc-toggle > summary:not(.hideme)::before,
2005 #main-content > details.rustdoc-toggle:not(.top-doc) > summary::before,
2006 #main-content > div > details.rustdoc-toggle > summary::before {
2010 /* Align summary-nested and unnested item-info gizmos. */
2011 .content .impl-items > .item-info {
2017 nav.sidebar, nav.sub, .content .out-of-band, a.srclink, #copy-path,
2018 details.rustdoc-toggle[open] > summary::before, details.rustdoc-toggle > summary::before,
2019 details.rustdoc-toggle.top-doc > summary {
2032 @media (max-width: 464px) {
2033 #titles, #titles > button {
2046 overflow-wrap: break-word;
2047 overflow-wrap: anywhere;
2051 flex-direction: column;
2054 .sub-logo-container {
2058 .source .sub-logo-container > img {
2066 .source-sidebar-expanded #sidebar-toggle {
2071 .method-toggle summary,
2072 .implementors-toggle summary,
2074 margin-bottom: 0.75em;
2077 .method-toggle[open] {
2081 .implementors-toggle[open] {
2085 #trait-implementations-list .method-toggle,
2086 #synthetic-implementations-list .method-toggle,
2087 #blanket-implementations-list .method-toggle {
2091 /* Begin: styles for --scrape-examples feature */
2093 .scraped-example-list .scrape-help {
2096 font-weight: normal;
2100 background: transparent;
2102 border-style: solid;
2103 border-radius: 50px;
2106 .scraped-example .code-wrapper {
2109 flex-direction: row;
2114 .scraped-example:not(.expanded) .code-wrapper {
2118 .scraped-example:not(.expanded) .code-wrapper pre {
2124 .scraped-example:not(.expanded) .code-wrapper pre.line-numbers {
2128 .scraped-example .code-wrapper .prev {
2136 .scraped-example .code-wrapper .next {
2144 .scraped-example .code-wrapper .expand {
2152 .scraped-example:not(.expanded) .code-wrapper:before {
2161 .scraped-example:not(.expanded) .code-wrapper:after {
2170 .scraped-example .code-wrapper .line-numbers {
2175 .scraped-example .code-wrapper .line-numbers span {
2179 .scraped-example .code-wrapper .example-wrap {
2186 .scraped-example:not(.expanded) .code-wrapper .example-wrap {
2190 .scraped-example .code-wrapper .example-wrap pre.rust {
2191 overflow-x: inherit;
2197 .more-examples-toggle {
2198 max-width: calc(100% + 25px);
2203 .more-examples-toggle .hide-more {
2209 .more-scraped-examples {
2212 flex-direction: row;
2215 .more-scraped-examples-inner {
2216 /* 20px is width of toggle-line + toggle-line-inner */
2217 width: calc(100% - 20px);
2221 align-self: stretch;
2228 .toggle-line-inner {
2233 .more-scraped-examples .scraped-example {
2234 margin-bottom: 20px;
2237 .more-scraped-examples .scraped-example:last-child {
2249 /* End: styles for --scrape-examples feature */