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 #source-sidebar, #sidebar-toggle,
210 details.rustdoc-toggle > summary::before,
211 .content ul.crate a.crate,
213 #help-button > button,
214 details.rustdoc-toggle.top-doc > summary,
215 details.rustdoc-toggle.top-doc > summary::before,
216 details.rustdoc-toggle.non-exhaustive > summary,
217 details.rustdoc-toggle.non-exhaustive > summary::before,
218 .scraped-example-title,
219 .more-examples-toggle summary, .more-examples-toggle .hide-more,
221 /* This selector is for the items listed in the "all items" page. */
222 #main-content > ul.docblock > li > a {
223 font-family: "Fira Sans", Arial, NanumBarunGothic, sans-serif;
229 .small-section-header a,
239 .result-name .primitive > i, .result-name .keyword > i,
240 .content .method .where,
242 .content .where.fmt-newline {
243 color: var(--main-color);
249 ul ul, ol ul, ul ol, ol ol {
250 margin-bottom: .625em;
254 /* Paragraph spacing at least 1.5 times line spacing per Web Content Accessibility Guidelines.
255 Line-height is 1.5rem, so line spacing is .5rem; .75em is 1.5 times that.
256 https://www.w3.org/WAI/WCAG21/Understanding/visual-presentation.html */
264 /* Fix some style changes due to normalize.css 8 */
272 border-collapse: collapse;
286 /* Buttons on Safari have different default padding than other platforms. Make them the same. */
290 /* end tweaks for normalize.css 8 */
301 padding: 10px 15px 40px 45px;
314 .source .width-limiter {
318 details:not(.rustdoc-toggle) summary {
322 code, pre, a.test-arrow, .code-header {
323 font-family: "Source Code Pro", monospace;
325 .docblock code, .docblock-short code {
329 .docblock pre code, .docblock-short pre code {
335 .docblock.item-decl {
342 .source .content pre {
362 .sub-logo-container {
367 .source .sub-logo-container {
371 .source .sub-logo-container > img {
377 .sidebar, .mobile-topbar, .sidebar-menu-toggle {
378 background-color: var(--sidebar-background-color);
393 .sidebar > .location {
398 overflow-wrap: anywhere;
401 .rustdoc.source .sidebar {
408 border-right: 1px solid;
410 /* The sidebar is by default hidden */
414 .rustdoc.source .sidebar .sidebar-logo {
418 .source .sidebar, #sidebar-toggle, #source-sidebar {
419 background-color: var(--sidebar-background-color);
422 #sidebar-toggle > button:hover, #sidebar-toggle > button:focus {
423 background-color: var(--sidebar-background-color-hover);
426 .source .sidebar > *:not(#sidebar-toggle) {
431 .source-sidebar-expanded .source .sidebar {
435 .source-sidebar-expanded .source .sidebar > *:not(#sidebar-toggle) {
444 /* Improve the scrollbar display on firefox */
446 scrollbar-width: initial;
447 scrollbar-color: var(--scrollbar-color);
450 scrollbar-width: thin;
451 scrollbar-color: var(--scrollbar-color);
454 /* Improve the scrollbar display on webkit-based browsers */
455 ::-webkit-scrollbar {
458 .sidebar::-webkit-scrollbar {
461 ::-webkit-scrollbar-track {
462 -webkit-box-shadow: inset 0;
463 background-color: var(--scrollbar-track-background-color);
465 .sidebar::-webkit-scrollbar-track {
466 background-color: var(--scrollbar-track-background-color);
468 ::-webkit-scrollbar-thumb, .sidebar::-webkit-scrollbar-thumb {
469 background-color: var(--scrollbar-thumb-background-color);
472 /* Everything else */
475 display: none !important;
478 .sidebar .logo-container {
482 justify-content: center;
486 overflow-wrap: break-word;
489 .logo-container > img {
498 .location a:first-of-type {
505 .block ul, .block li {
515 margin-left: -0.25rem;
517 text-overflow: ellipsis;
527 margin-bottom: 0.7rem;
531 font-size: 1.125rem; /* 18px */
537 .sidebar-elems .block {
541 .sidebar-elems .block li a {
549 .source .content pre.rust {
555 .rustdoc .example-wrap {
556 display: inline-flex;
565 .example-wrap > pre.line-number {
570 border-top-left-radius: 5px;
571 border-bottom-left-radius: 5px;
574 .example-wrap > pre.rust a:hover {
575 text-decoration: underline;
581 .rustdoc:not(.source) .example-wrap > pre:not(.line-number) {
586 .rustdoc:not(.source) .example-wrap > pre.line-numbers {
591 .rustdoc .example-wrap > pre {
599 .content > .example-wrap pre.line-numbers {
601 -webkit-user-select: none;
602 -moz-user-select: none;
603 -ms-user-select: none;
611 overflow-wrap: break-word;
612 overflow-wrap: anywhere;
617 text-overflow: ellipsis;
620 /* Wrap non-pre code blocks (`text`) but not (```text```). */
621 .docblock > :not(pre) > code,
622 .docblock-short > :not(pre) > code {
623 white-space: pre-wrap;
626 .top-doc .docblock h2 { font-size: 1.375rem; }
627 .top-doc .docblock h3 { font-size: 1.25rem; }
628 .top-doc .docblock h4,
629 .top-doc .docblock h5 {
632 .top-doc .docblock h6 {
636 .docblock h5 { font-size: 1rem; }
637 .docblock h6 { font-size: 0.875rem; }
638 .docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5, .docblock h6 {
639 border-bottom-color: var(--headings-border-bottom-color);
647 .docblock > :not(.more-examples-toggle):not(.example-wrap) {
652 .content .out-of-band {
659 .method > .code-header, .trait-impl > .code-header {
660 max-width: calc(100% - 41px);
668 /* We use overflow-wrap: break-word for Safari, which doesn't recognize
669 `anywhere`: https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-wrap */
670 overflow-wrap: break-word;
671 /* Then override it with `anywhere`, which is required to make non-Safari browsers break
672 more aggressively when we want them to. */
673 overflow-wrap: anywhere;
674 background-color: var(--main-background-color);
677 .in-band > code, .in-band > .code-header {
678 display: inline-block;
681 .docblock code, .docblock-short code,
682 pre, .rustdoc.source .example-wrap {
683 background-color: var(--code-block-background-color);
691 border-spacing: 0 5px;
693 .content td { vertical-align: top; }
694 .content td:first-child { padding-right: 20px; }
695 .content td p:first-child { margin-top: 0; }
696 .content td h1, .content td h2 { margin-left: 0; font-size: 1.125rem; }
697 .content tr:first-child td { border-top: 0; }
701 width: calc(100% - 2px);
708 border: 1px dashed var(--border-color);
714 border: 1px solid var(--border-color);
717 .content .item-list {
718 list-style-type: none;
722 .content > .methods > .method {
726 /* Shift "where ..." part of method or fn definition down a line */
727 .content .method .where,
729 .content .where.fmt-newline {
738 .content .item-info code {
742 .content .item-info {
747 .content .impl-items .docblock, .content .impl-items .item-info {
751 #main-content > .item-info {
765 nav.sum { text-align: right; }
766 nav.sub form { display: inline; }
769 text-decoration: none;
770 background: transparent;
773 .small-section-header {
775 justify-content: space-between;
779 .small-section-header:hover > .anchor {
783 .in-band:hover > .anchor, .impl:hover > .anchor, .method.trait-impl:hover > .anchor,
784 .type.trait-impl:hover > .anchor, .associatedconstant.trait-impl:hover > .anchor,
785 .associatedtype.trait-impl:hover > .anchor {
786 display: inline-block;
793 background: none !important;
798 .small-section-header > .anchor {
802 h2.small-section-header > .anchor {
809 .docblock a:not(.srclink):not(.test-arrow):not(.scrape-help):hover,
810 .docblock-short a:not(.srclink):not(.test-arrow):not(.scrape-help):hover, .item-info a {
811 text-decoration: underline;
814 .block a.current.crate { font-weight: 500; }
816 /* In most contexts we use `overflow-wrap: anywhere` to ensure that we can wrap
817 as much as needed on mobile (see
818 src/test/rustdoc-gui/type-declaration-overflow.goml for an example of why
819 this matters). The `anywhere` value means:
821 "Soft wrap opportunities introduced by the word break are considered when
822 calculating min-content intrinsic sizes."
824 https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-wrap#values
826 For table layouts, that becomes a problem: the browser tries to make each
827 column as narrow as possible, and `overflow-wrap: anywhere` means it can do
828 so by breaking words - even if some other column could be shrunk without
829 breaking words! This shows up, for instance, in the `Structs` / `Modules` /
830 `Functions` (etcetera) sections of a module page, and when a docblock
833 So, for table layouts, override the default with break-word, which does
834 _not_ affect min-content intrinsic sizes.
838 overflow-wrap: break-word;
847 .item-left, .item-right {
851 padding-right: 1.25rem;
860 .search-container > * {
863 .search-results-title {
866 /* flex layout allows shrinking the <select> appropriately if it becomes too large */
867 display: inline-flex;
869 /* make things look like in a line, despite the fact that we're using a layout
870 with boxes (i.e. from the flex layout) */
871 align-items: baseline;
874 display: inline-block;
875 /* ensures that 100% in properties of #crate-search-div:after
876 are relative to the size of this div */
878 /* allows this div (and with it the <select>-element "#crate-search") to be shrunk */
884 /* keep these two in sync with "@-moz-document url-prefix()" below */
887 /* prevents the <select> from overflowing the containing div in case it's shrunk */
889 /* contents can overflow because of max-width limit, then show ellipsis */
890 text-overflow: ellipsis;
891 border: 1px solid var(--border-color);
895 -moz-appearance: none;
896 -webkit-appearance: none;
897 /* Removes default arrow from firefox */
899 background-color: var(--main-background-color);
901 /* cancel stylistic differences in padding in firefox
902 for "appearance: none"-style (or equivalent) <select>s */
903 @-moz-document url-prefix() {
905 padding-left: 0px; /* == 4px - 4px */
906 padding-right: 19px; /* == 23px - 4px */
909 /* pseudo-element for holding the dropdown-arrow image; needs to be a separate thing
910 so that we can apply CSS-filters to change the arrow color in themes */
911 #crate-search-div::after {
912 /* lets clicks through! */
913 pointer-events: none;
914 /* completely covers the underlying div */
921 background-repeat: no-repeat;
922 background-size: 20px;
923 background-position: calc(100% - 2px) 56%;
924 /* image is black color, themes should apply a "filter" property to change the color */
925 background-image: /* AUTOREPLACE: */url("down-arrow.svg");
927 #crate-search > option {
931 /* Override Normalize.css: it has a rule that sets
932 -webkit-appearance: textfield for search inputs. That
933 causes rounded corners and no border on iOS Safari. */
934 -webkit-appearance: none;
935 /* Override Normalize.css: we have margins and do
936 not want to overflow - the `moz` attribute is necessary
937 until Firefox 29, too early to drop at this point */
938 -moz-box-sizing: border-box !important;
939 box-sizing: border-box !important;
941 border: 1px solid var(--border-color);
946 background-color: var(--button-background-color);
948 .search-input:focus {
949 border-color: var(--search-input-focused-border-color);
957 .search-results.active {
959 /* prevent overhanging tabs from moving the first result */
963 .search-results .desc > span {
965 text-overflow: ellipsis;
970 .search-results > a {
972 /* A little margin ensures the browser's outlining of focused links has room to display. */
975 border-bottom: 1px solid #aaa3;
978 .search-results > a > div {
983 .search-results .result-name, .search-results div.desc, .search-results .result-description {
986 .search-results .result-name {
990 .search-results .result-name > span {
991 display: inline-block;
1004 border: 1px solid var(--border-color);
1008 /* This rule is to draw the little arrow connecting the settings menu to the gear icon. */
1013 border: solid var(--border-color);
1014 border-width: 1px 1px 0 0;
1015 display: inline-block;
1017 transform: rotate(-45deg);
1021 .popover, .popover::before {
1022 background-color: var(--main-background-color);
1023 color: var(--main-color);
1026 #help-button .popover {
1030 #help-button .popover::before {
1038 margin-right: 0.5rem;
1040 #help-button span.top, #help-button span.bottom {
1043 font-size: 1.125rem;
1045 #help-button span.top {
1049 border-bottom: 1px solid var(--border-color);
1050 padding-bottom: 4px;
1053 #help-button span.bottom {
1055 border-top: 1px solid var(--border-color);
1058 text-align: initial;
1060 .side-by-side > div {
1063 padding: 0 20px 20px 17px;
1068 /* This min-height is needed to unify the height of the stab elements because some of them
1073 align-items: center;
1074 white-space: pre-wrap;
1079 font-size: 0.875rem;
1080 font-weight: normal;
1089 margin-right: 0.3rem;
1092 /* Black one-pixel outline around emoji shapes */
1102 .import-item .stab {
1104 display: inline-block;
1105 font-size: 0.875rem;
1108 margin-left: 0.3125em;
1110 vertical-align: text-bottom;
1113 .module-item.unstable,
1114 .import-item.unstable {
1119 font-weight: normal;
1132 color: var(--right-side-color);
1136 .impl-items .srclink, .impl .srclink, .methods .srclink {
1137 /* Override header settings otherwise it's too bold */
1138 font-weight: normal;
1150 pre.rust .question-mark {
1154 .example-wrap.compile_fail,
1155 .example-wrap.should_panic {
1156 border-left: 2px solid var(--codeblock-error-color);
1159 .ignore.example-wrap {
1160 border-left: 2px solid var(--codeblock-ignore-color);
1163 .example-wrap.compile_fail:hover,
1164 .example-wrap.should_panic:hover {
1165 border-left: 2px solid var(--codeblock-error-hover-color);
1168 .example-wrap.ignore:hover {
1169 border-left: 2px solid var(--codeblock-ignore-hover-color);
1172 .example-wrap.compile_fail .tooltip,
1173 .example-wrap.should_panic .tooltip {
1174 color: var(--codeblock-error-color);
1177 .example-wrap.ignore .tooltip {
1178 color: var(--codeblock-ignore-color);
1181 .example-wrap.compile_fail:hover .tooltip,
1182 .example-wrap.should_panic:hover .tooltip {
1183 color: var(--codeblock-error-hover-color);
1186 .example-wrap.ignore:hover .tooltip {
1187 color: var(--codeblock-ignore-hover-color);
1190 .example-wrap .tooltip {
1198 .example-wrap .tooltip::after {
1201 padding: 5px 3px 3px 3px;
1205 border: 1px solid var(--border-color);
1212 .example-wrap .tooltip::before {
1219 border-style: solid;
1224 .example-wrap.ignore .tooltip::after {
1225 content: "This example is not tested";
1227 .example-wrap.compile_fail .tooltip::after {
1228 content: "This example deliberately fails to compile";
1230 .example-wrap.should_panic .tooltip::after {
1231 content: "This example panics";
1233 .example-wrap.edition .tooltip::after {
1234 content: "This code runs with edition " attr(data-edition);
1237 .example-wrap .tooltip:hover::before, .example-wrap .tooltip:hover::after {
1241 .example-wrap.compile_fail .tooltip,
1242 .example-wrap.should_panic .tooltip,
1243 .example-wrap.ignore .tooltip {
1249 display: inline-block;
1252 padding: 5px 10px 5px 10px;
1254 font-size: 1.375rem;
1259 .example-wrap:hover .test-arrow {
1260 visibility: visible;
1262 a.test-arrow:hover {
1263 text-decoration: none;
1268 color: var(--code-attribute-color);
1276 .out-of-band > span.since {
1283 font-size: 1.125rem;
1284 margin-bottom: 10px;
1285 border-bottom: none;
1291 border-bottom: none;
1298 margin-bottom: 40px;
1301 .sub-variant > .sub-variant-field {
1305 :target > code, :target > .code-header {
1313 .notable-traits-tooltip {
1314 display: inline-block;
1318 .notable-traits:hover .notable-traits-tooltiptext,
1319 .notable-traits .notable-traits-tooltiptext.force-tooltip {
1320 display: inline-block;
1323 .notable-traits .notable-traits-tooltiptext {
1325 padding: 5px 3px 3px 3px;
1335 .notable-traits-tooltip::after {
1336 /* The margin on the tooltip does not capture hover events,
1337 this extends the area of hover enough so that mouse hover is not
1338 lost when moving the mouse to the tooltip */
1339 content: "\00a0\00a0\00a0";
1342 .notable-traits .notable, .notable-traits .docblock {
1346 .notable-traits .notable {
1348 margin-bottom: 13px;
1349 font-size: 1.1875rem;
1354 .notable-traits .docblock code.content {
1360 /* Example code has the "Run" button that needs to be positioned relative to the pre */
1361 pre.rust.rust-example-rendered {
1376 .search-failed.active {
1380 .search-failed > ul {
1395 font-size: 1.125rem;
1398 border-top: 2px solid;
1401 #titles > button:first-child:last-child {
1403 width: calc(100% - 1px);
1406 #titles > button:not(:last-child) {
1408 width: calc(33.3% - 1px);
1411 #titles > button > div.count {
1412 display: inline-block;
1428 border-bottom: 1px solid;
1431 justify-content: center;
1432 align-items: center;
1440 #source-sidebar > .title {
1443 border-bottom: 1px solid var(--border-color);
1446 #sidebar-toggle > button {
1458 /* work around button layout strangeness: https://stackoverflow.com/q/7271561 */
1460 /* iOS button gradient: https://stackoverflow.com/q/5438567 */
1461 -webkit-appearance: none;
1464 #settings-menu, #help-button {
1469 #settings-menu > a, #help-button > button, #copy-path {
1472 border: 1px solid var(--border-color);
1477 #settings-menu > a, #help-button > button {
1481 background-color: var(--button-background-color);
1485 color: var(--copy-path-button-color);
1488 filter: var(--copy-path-img-filter);
1490 #copy-path:hover > img {
1491 filter: var(--copy-path-img-hover-filter);
1494 @keyframes rotating {
1496 transform: rotate(0deg);
1499 transform: rotate(360deg);
1502 #settings-menu.rotate > a img {
1503 animation: rotating 2s linear infinite;
1506 .setting-line .radio-line input:checked {
1507 box-shadow: inset 0 0 0 3px var(--main-background-color);
1508 background-color: var(--settings-input-color);
1510 .setting-line .radio-line input:focus {
1511 box-shadow: 0 0 1px 1px var(--settings-input-color);
1513 /* In here we combine both `:focus` and `:checked` properties. */
1514 .setting-line .radio-line input:checked:focus {
1515 box-shadow: inset 0 0 0 3px var(--main-background-color),
1516 0 0 2px 2px var(--settings-input-color);
1518 .setting-line .radio-line input:hover {
1519 border-color: var(--settings-input-color) !important;
1521 input:checked + .slider {
1522 background-color: var(--settings-input-color);
1525 #help-button > button {
1527 /* Rare exception to specifying font sizes in rem. Since this is acting
1528 as an icon, it's okay to specify their sizes in pixels. */
1535 background-color: var(--main-background-color);
1543 display: inline-block;
1545 font: 15px monospace;
1547 vertical-align: middle;
1548 border: solid 1px var(--border-color);
1553 #main-content > ul {
1556 #main-content > ul > li {
1568 details.dir-entry > summary {
1570 list-style-position: outside;
1574 details.dir-entry div.folders, details.dir-entry div.files {
1578 details.dir-entry a {
1582 /* The hideme class is used on summary tags that contain a span with
1583 placeholder text shown only when the toggle is closed. For instance,
1584 "Expand description" or "Show methods". */
1585 details.rustdoc-toggle > summary.hideme {
1589 details.rustdoc-toggle > summary {
1592 details.rustdoc-toggle > summary::-webkit-details-marker,
1593 details.rustdoc-toggle > summary::marker {
1597 details.rustdoc-toggle > summary.hideme > span {
1601 details.rustdoc-toggle > summary::before {
1606 background-repeat: no-repeat;
1607 background-position: top left;
1608 display: inline-block;
1609 vertical-align: middle;
1613 details.rustdoc-toggle > summary.hideme > span,
1614 details.rustdoc-toggle > summary::before,
1615 .more-examples-toggle summary, .more-examples-toggle .hide-more {
1616 color: var(--toggles-color);
1619 /* Screen readers see the text version at the end the line.
1620 Visual readers see the icon at the start of the line, but small and transparent. */
1621 details.rustdoc-toggle > summary::after {
1629 details.rustdoc-toggle > summary.hideme::after {
1630 /* "hideme" toggles already have a description when they're contracted */
1634 details.rustdoc-toggle > summary:focus::before,
1635 details.rustdoc-toggle > summary:hover::before {
1639 details.rustdoc-toggle.top-doc > summary,
1640 details.rustdoc-toggle.top-doc > summary::before,
1641 details.rustdoc-toggle.non-exhaustive > summary,
1642 details.rustdoc-toggle.non-exhaustive > summary::before {
1646 details.non-exhaustive {
1650 details.rustdoc-toggle > summary.hideme::before {
1654 details.rustdoc-toggle > summary:not(.hideme)::before {
1660 .impl-items > details.rustdoc-toggle > summary:not(.hideme)::before {
1665 /* When a "hideme" summary is open and the "Expand description" or "Show
1666 methods" text is hidden, we want the [-] toggle that remains to not
1667 affect the layout of the items to its right. To do that, we use
1668 absolute positioning. Note that we also set position: relative
1669 on the parent <details> to make this work properly. */
1670 details.rustdoc-toggle[open] > summary.hideme {
1674 details.rustdoc-toggle {
1678 details.rustdoc-toggle[open] > summary.hideme > span {
1682 details.rustdoc-toggle[open] > summary::before,
1683 details.rustdoc-toggle[open] > summary.hideme::before {
1684 background-image: /* AUTOREPLACE: */url("toggle-minus.svg");
1687 details.rustdoc-toggle > summary::before {
1688 background-image: /* AUTOREPLACE: */url("toggle-plus.svg");
1691 details.rustdoc-toggle[open] > summary::before,
1692 details.rustdoc-toggle[open] > summary.hideme::before {
1695 background-repeat: no-repeat;
1696 background-position: top left;
1697 display: inline-block;
1701 details.rustdoc-toggle[open] > summary::after,
1702 details.rustdoc-toggle[open] > summary.hideme::after {
1703 content: "Collapse";
1706 /* This is needed in docblocks to have the "â–¶" element to be on the same line. */
1707 .docblock summary > * {
1708 display: inline-block;
1714 WARNING: RUSTDOC_MOBILE_BREAKPOINT MEDIA QUERY;
1715 If you update this line, then you also need to update the line with the same warning
1716 in storage.js plus the media query with (max-width: 700px)
1718 @media (min-width: 701px) {
1719 /* In case there is no documentation before a code block, we need to add some margin at the top
1720 to prevent an overlay between the "collapse toggle" and the information tooltip.
1721 However, it's not needed with smaller screen width because the doc/code block is always put
1722 "one line" below. */
1723 .docblock > .example-wrap:first-child .tooltip {
1727 /* When we expand the sidebar on the source code page, we hide the logo on the left of the
1728 search bar to have more space. */
1729 .source-sidebar-expanded .source .sidebar + main .width-limiter .sub-logo-container.rust-logo {
1733 .source-sidebar-expanded .source .sidebar {
1739 WARNING: RUSTDOC_MOBILE_BREAKPOINT MEDIA QUERY
1740 If you update this line, then you also need to update the line with the same warning
1741 in storage.js plus the media query with (min-width: 701px)
1743 @media (max-width: 700px) {
1744 /* When linking to an item with an `id` (for instance, by clicking a link in the sidebar,
1745 or visiting a URL with a fragment like `#method.new`, we don't want the item to be obscured
1746 by the topbar. Anything with an `id` gets scroll-margin-top equal to .mobile-topbar's size.
1749 scroll-margin-top: 45px;
1754 /* Sidebar should overlay main content, rather than pushing main content to the right.
1755 Turn off `display: flex` on the body element. */
1765 flex-direction: column;
1768 .content .out-of-band {
1770 margin-left: initial;
1774 .content .out-of-band .since::before {
1782 /* Hide the logo and item name from the sidebar. Those are displayed
1783 in the mobile-topbar instead. */
1784 .sidebar .sidebar-logo,
1785 .sidebar .location {
1792 /* Hide the sidebar offscreen while not in use. Doing this instead of display: none means
1793 the sidebar stays visible for screen readers, which is useful for navigation. */
1799 /* Reduce height slightly to account for mobile topbar. */
1800 height: calc(100vh - 45px);
1803 /* The source view uses a different design for the sidebar toggle, and doesn't have a topbar,
1804 so don't bump down the main content or the sidebar. */
1806 .rustdoc.source .sidebar {
1814 .source-sidebar-expanded .source .sidebar,
1815 .sidebar:focus-within {
1819 .rustdoc.source > .sidebar {
1826 .mobile-topbar .location a {
1831 .mobile-topbar .location {
1834 margin: auto 0.5em auto auto;
1835 text-overflow: ellipsis;
1837 white-space: nowrap;
1838 /* Rare exception to specifying font sizes in rem. Since the topbar
1839 height is specified in pixels, this also has to be specified in
1840 pixels to avoid overflowing the topbar when the user sets a bigger
1845 .mobile-topbar .logo-container {
1849 .mobile-topbar .logo-container > img {
1859 flex-direction: row;
1869 .source .mobile-topbar {
1873 .sidebar-menu-toggle {
1875 /* Rare exception to specifying font sizes in rem. Since this is acting
1876 as an icon, it's okay to specify its sizes in pixels. */
1883 background-color: var(--sidebar-background-color);
1900 display: none !important;
1909 #titles > button > div.count {
1918 /* Because of ios, we need to actually have a full height sidebar title so the
1919 * actual sidebar can show up. But then we need to make it transparent so we don't
1920 * hide content. The filler just allows to create the background for the sidebar
1921 * title. But because of the absolute position, I had to lower the z-index.
1926 width: calc(100% - 45px);
1930 border-bottom: 1px solid;
1933 #main-content > details.rustdoc-toggle > summary::before,
1934 #main-content > div > details.rustdoc-toggle > summary::before {
1947 border-top-right-radius: 3px;
1948 border-bottom-right-radius: 3px;
1955 .source-sidebar-expanded #sidebar-toggle {
1959 border-top-right-radius: unset;
1960 border-bottom-right-radius: unset;
1963 border-bottom: 1px solid;
1970 #main-content > .line-numbers {
1974 .notable-traits .notable-traits-tooltiptext {
1979 /* We don't display the help button on mobile devices. */
1984 /* Display an alternating layout on tablets and phones */
1990 flex-flow: column wrap;
1992 .item-left, .item-right {
1996 /* Display an alternating layout on tablets and phones */
1997 .search-results > a {
1998 border-bottom: 1px solid #aaa9;
2001 .search-results .result-name, .search-results div.desc, .search-results .result-description {
2004 .search-results div.desc, .search-results .result-description, .item-right {
2008 .source-sidebar-expanded .source .sidebar {
2013 /* Position of the "[-]" element. */
2014 details.rustdoc-toggle:not(.top-doc) > summary {
2017 .impl-items > details.rustdoc-toggle > summary:not(.hideme)::before,
2018 #main-content > details.rustdoc-toggle:not(.top-doc) > summary::before,
2019 #main-content > div > details.rustdoc-toggle > summary::before {
2023 /* Align summary-nested and unnested item-info gizmos. */
2024 .content .impl-items > .item-info {
2030 nav.sidebar, nav.sub, .content .out-of-band, a.srclink, #copy-path,
2031 details.rustdoc-toggle[open] > summary::before, details.rustdoc-toggle > summary::before,
2032 details.rustdoc-toggle.top-doc > summary {
2045 @media (max-width: 464px) {
2046 #titles, #titles > button {
2059 overflow-wrap: break-word;
2060 overflow-wrap: anywhere;
2064 flex-direction: column;
2067 .sub-logo-container {
2071 .source .sub-logo-container > img {
2079 .source-sidebar-expanded #sidebar-toggle {
2084 .method-toggle summary,
2085 .implementors-toggle summary,
2087 margin-bottom: 0.75em;
2090 .method-toggle[open] {
2094 .implementors-toggle[open] {
2098 #trait-implementations-list .method-toggle,
2099 #synthetic-implementations-list .method-toggle,
2100 #blanket-implementations-list .method-toggle {
2104 /* Begin: styles for --scrape-examples feature */
2106 .scraped-example-list .scrape-help {
2109 font-weight: normal;
2113 background: transparent;
2115 border-style: solid;
2116 border-radius: 50px;
2119 .scraped-example .code-wrapper {
2122 flex-direction: row;
2127 .scraped-example:not(.expanded) .code-wrapper {
2131 .scraped-example:not(.expanded) .code-wrapper pre {
2137 .scraped-example:not(.expanded) .code-wrapper pre.line-numbers {
2141 .scraped-example .code-wrapper .prev {
2149 .scraped-example .code-wrapper .next {
2157 .scraped-example .code-wrapper .expand {
2165 .scraped-example:not(.expanded) .code-wrapper:before {
2174 .scraped-example:not(.expanded) .code-wrapper:after {
2183 .scraped-example .code-wrapper .line-numbers {
2188 .scraped-example .code-wrapper .line-numbers span {
2192 .scraped-example .code-wrapper .example-wrap {
2199 .scraped-example:not(.expanded) .code-wrapper .example-wrap {
2203 .scraped-example .code-wrapper .example-wrap pre.rust {
2204 overflow-x: inherit;
2210 .more-examples-toggle {
2211 max-width: calc(100% + 25px);
2216 .more-examples-toggle .hide-more {
2222 .more-scraped-examples {
2225 flex-direction: row;
2228 .more-scraped-examples-inner {
2229 /* 20px is width of toggle-line + toggle-line-inner */
2230 width: calc(100% - 20px);
2234 align-self: stretch;
2241 .toggle-line-inner {
2246 .more-scraped-examples .scraped-example {
2247 margin-bottom: 20px;
2250 .more-scraped-examples .scraped-example:last-child {
2262 /* End: styles for --scrape-examples feature */