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: 25px 0 15px 0;
138 .docblock h3, .docblock h4, h5, h6 {
139 margin: 15px 0 5px 0;
141 .docblock > h2:first-child,
142 .docblock > h3:first-child,
143 .docblock > h4:first-child,
144 .docblock > h5:first-child,
145 .docblock > h6:first-child {
152 /* We use overflow-wrap: break-word for Safari, which doesn't recognize
153 `anywhere`: https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-wrap */
154 overflow-wrap: break-word;
155 /* Then override it with `anywhere`, which is required to make non-Safari browsers break
156 more aggressively when we want them to. */
157 overflow-wrap: anywhere;
162 justify-content: space-between;
166 .main-heading a:hover {
167 text-decoration: underline;
170 text-decoration: none;
172 /* The only headings that get underlines are:
173 Markdown-generated headings within the top-doc
174 Rustdoc-generated h2 section headings (e.g. "Implementations", "Required Methods", etc)
175 Underlines elsewhere in the documentation break up visual flow and tend to invert
176 section hierarchies. */
178 .top-doc .docblock > h3,
179 .top-doc .docblock > h4 {
180 border-bottom: 1px solid var(--headings-border-bottom-color);
183 font-size: 1.125rem; /* 18px */
190 border-bottom-style: none;
196 h1, h2, h3, h4, h5, h6,
200 .search-results .result-name,
205 #help-button > button,
206 details.rustdoc-toggle.top-doc > summary,
207 details.rustdoc-toggle.non-exhaustive > summary,
208 .scraped-example-title,
209 .more-examples-toggle summary, .more-examples-toggle .hide-more,
211 /* This selector is for the items listed in the "all items" page. */
213 font-family: "Fira Sans", Arial, NanumBarunGothic, sans-serif;
218 .small-section-header a,
228 .result-name .primitive > i, .result-name .keyword > i,
229 .content .method .where,
231 .content .where.fmt-newline {
232 color: var(--main-color);
235 .content span.enum, .content a.enum,
236 .content span.struct, .content a.struct,
237 .content span.union, .content a.union,
238 .content span.primitive, .content a.primitive,
239 .content span.type, .content a.type,
240 .content span.foreigntype, .content a.foreigntype {
241 color: var(--type-link-color);
244 .content span.trait, .content a.trait,
245 .content span.traitalias, .content a.traitalias {
246 color: var(--trait-link-color);
249 .content span.associatedtype, .content a.associatedtype,
250 .content span.constant, .content a.constant,
251 .content span.static, .content a.static {
252 color: var(--assoc-item-link-color);
255 .content span.fn, .content a.fn,
257 .content span.method, .content a.method,
258 .content span.tymethod, .content a.tymethod {
259 color: var(--function-link-color);
262 .content span.attr, .content a.attr,
263 .content span.derive, .content a.derive,
264 .content span.macro, .content a.macro {
265 color: var(--macro-link-color);
268 .content span.mod, .content a.mod, .block a.current.mod {
269 color: var(--mod-link-color);
272 .content span.keyword, .content a.keyword {
273 color: var(--keyword-link-color);
277 color: var(--link-color);
283 ul ul, ol ul, ul ol, ol ol {
284 margin-bottom: .625em;
288 /* Paragraph spacing at least 1.5 times line spacing per Web Content Accessibility Guidelines.
289 Line-height is 1.5rem, so line spacing is .5rem; .75em is 1.5 times that.
290 https://www.w3.org/WAI/WCAG21/Understanding/visual-presentation.html */
293 /* For the last child of a div, the margin will be taken care of
294 by the margin-top of the next item. */
303 /* Fix some style changes due to normalize.css 8 */
306 /* Buttons on Safari have different default padding than other platforms. Make them the same. */
310 /* end tweaks for normalize.css 8 */
321 padding: 10px 15px 40px 45px;
334 .source .width-limiter {
338 details:not(.rustdoc-toggle) summary {
342 code, pre, a.test-arrow, .code-header {
343 font-family: "Source Code Pro", monospace;
345 .docblock code, .docblock-short code {
349 .docblock pre code, .docblock-short pre code {
359 .source .content pre {
377 .sub-logo-container {
382 .source .sub-logo-container {
386 .source .sub-logo-container > img {
392 .sidebar, .mobile-topbar, .sidebar-menu-toggle {
393 background-color: var(--sidebar-background-color);
408 .sidebar > .location {
413 overflow-wrap: anywhere;
416 .rustdoc.source .sidebar {
423 border-right: 1px solid;
425 /* The sidebar is by default hidden */
429 .rustdoc.source .sidebar .sidebar-logo {
433 .source .sidebar, #sidebar-toggle, #source-sidebar {
434 background-color: var(--sidebar-background-color);
437 #sidebar-toggle > button:hover, #sidebar-toggle > button:focus {
438 background-color: var(--sidebar-background-color-hover);
441 .source .sidebar > *:not(#sidebar-toggle) {
445 .source-sidebar-expanded .source .sidebar {
449 .source-sidebar-expanded .source .sidebar > *:not(#sidebar-toggle) {
457 /* Improve the scrollbar display on firefox */
459 scrollbar-width: initial;
460 scrollbar-color: var(--scrollbar-color);
463 scrollbar-width: thin;
464 scrollbar-color: var(--scrollbar-color);
467 /* Improve the scrollbar display on webkit-based browsers */
468 ::-webkit-scrollbar {
471 .sidebar::-webkit-scrollbar {
474 ::-webkit-scrollbar-track {
475 -webkit-box-shadow: inset 0;
476 background-color: var(--scrollbar-track-background-color);
478 .sidebar::-webkit-scrollbar-track {
479 background-color: var(--scrollbar-track-background-color);
481 ::-webkit-scrollbar-thumb, .sidebar::-webkit-scrollbar-thumb {
482 background-color: var(--scrollbar-thumb-background-color);
485 /* Everything else */
488 display: none !important;
491 .sidebar .logo-container {
495 justify-content: center;
499 overflow-wrap: break-word;
502 .logo-container > img {
507 .block ul, .block li {
517 margin-left: -0.25rem;
519 text-overflow: ellipsis;
529 margin-bottom: 0.7rem;
533 font-size: 1.125rem; /* 18px */
539 .sidebar a, .sidebar .current {
540 color: var(--sidebar-link-color);
544 background-color: var(--sidebar-current-link-background-color);
547 .sidebar-elems .block {
551 .sidebar-elems .block li a {
559 .source .content pre.rust {
565 .rustdoc .example-wrap {
569 .rustdoc .example-wrap {
572 /* For the last child of a div, the margin will be taken care of
573 by the margin-top of the next item. */
574 .rustdoc .example-wrap:last-child {
578 pre.example-line-numbers {
583 border-top-left-radius: 5px;
584 border-bottom-left-radius: 5px;
587 .example-wrap > pre.rust a:hover {
588 text-decoration: underline;
594 .rustdoc:not(.source) .example-wrap > pre:not(.example-line-numbers) {
599 .rustdoc:not(.source) .example-wrap > pre.src-line-numbers {
604 .rustdoc .example-wrap > pre {
612 .content > .example-wrap pre.src-line-numbers {
614 -webkit-user-select: none;
615 -moz-user-select: none;
616 -ms-user-select: none;
619 .src-line-numbers span {
624 overflow-wrap: break-word;
625 overflow-wrap: anywhere;
627 text-overflow: ellipsis;
629 /* Wrap non-pre code blocks (`text`) but not (```text```). */
630 .docblock > :not(pre) > code,
631 .docblock-short > code {
632 white-space: pre-wrap;
635 .top-doc .docblock h2 { font-size: 1.375rem; }
636 .top-doc .docblock h3 { font-size: 1.25rem; }
637 .top-doc .docblock h4,
638 .top-doc .docblock h5 {
641 .top-doc .docblock h6 {
645 .docblock h5 { font-size: 1rem; }
646 .docblock h6 { font-size: 0.875rem; }
653 .docblock > :not(.more-examples-toggle):not(.example-wrap) {
664 .docblock code, .docblock-short code,
665 pre, .rustdoc.source .example-wrap {
666 background-color: var(--code-block-background-color);
675 width: calc(100% - 2px);
678 border-collapse: collapse;
683 border: 1px dashed var(--border-color);
690 border: 1px solid var(--border-color);
693 /* Shift "where ..." part of method or fn definition down a line */
694 .content .method .where,
696 .content .where.fmt-newline {
705 .content .item-info code {
709 .content .item-info {
713 #main-content > .item-info {
727 nav.sum { text-align: right; }
728 nav.sub form { display: inline; }
731 text-decoration: none;
734 .small-section-header {
736 justify-content: space-between;
740 .small-section-header:hover > .anchor {
744 .impl:hover > .anchor, .method.trait-impl:hover > .anchor,
745 .type.trait-impl:hover > .anchor, .associatedconstant.trait-impl:hover > .anchor,
746 .associatedtype.trait-impl:hover > .anchor {
747 display: inline-block;
754 background: none !important;
759 .small-section-header > .anchor {
763 h2.small-section-header > .anchor {
771 .docblock a:not(.test-arrow):not(.scrape-help):hover,
772 .docblock-short a:not(.test-arrow):not(.scrape-help):hover,
774 text-decoration: underline;
777 .block a.current.crate { font-weight: 500; }
779 /* In most contexts we use `overflow-wrap: anywhere` to ensure that we can wrap
780 as much as needed on mobile (see
781 src/test/rustdoc-gui/type-declaration-overflow.goml for an example of why
782 this matters). The `anywhere` value means:
784 "Soft wrap opportunities introduced by the word break are considered when
785 calculating min-content intrinsic sizes."
787 https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-wrap#values
789 For table layouts, that becomes a problem: the browser tries to make each
790 column as narrow as possible, and `overflow-wrap: anywhere` means it can do
791 so by breaking words - even if some other column could be shrunk without
792 breaking words! This shows up, for instance, in the `Structs` / `Modules` /
793 `Functions` (etcetera) sections of a module page, and when a docblock
796 So, for table layouts, override the default with break-word, which does
797 _not_ affect min-content intrinsic sizes.
801 overflow-wrap: break-word;
810 .item-left, .item-right {
814 padding-right: 1.25rem;
823 .search-container > * {
826 .search-results-title {
829 /* flex layout allows shrinking the <select> appropriately if it becomes too large */
830 display: inline-flex;
832 /* make things look like in a line, despite the fact that we're using a layout
833 with boxes (i.e. from the flex layout) */
834 align-items: baseline;
837 display: inline-block;
838 /* ensures that 100% in properties of #crate-search-div:after
839 are relative to the size of this div */
841 /* allows this div (and with it the <select>-element "#crate-search") to be shrunk */
847 /* keep these two in sync with "@-moz-document url-prefix()" below */
850 /* prevents the <select> from overflowing the containing div in case it's shrunk */
852 /* contents can overflow because of max-width limit, then show ellipsis */
853 text-overflow: ellipsis;
854 border: 1px solid var(--border-color);
858 -moz-appearance: none;
859 -webkit-appearance: none;
860 /* Removes default arrow from firefox */
862 background-color: var(--main-background-color);
867 /* cancel stylistic differences in padding in firefox
868 for "appearance: none"-style (or equivalent) <select>s */
869 @-moz-document url-prefix() {
871 padding-left: 0px; /* == 4px - 4px */
872 padding-right: 19px; /* == 23px - 4px */
875 /* pseudo-element for holding the dropdown-arrow image; needs to be a separate thing
876 so that we can apply CSS-filters to change the arrow color in themes */
877 #crate-search-div::after {
878 /* lets clicks through! */
879 pointer-events: none;
880 /* completely covers the underlying div */
887 background-repeat: no-repeat;
888 background-size: 20px;
889 background-position: calc(100% - 2px) 56%;
890 /* image is black color, themes should apply a "filter" property to change the color */
891 background-image: /* AUTOREPLACE: */url("down-arrow.svg");
893 #crate-search > option {
897 /* Override Normalize.css: it has a rule that sets
898 -webkit-appearance: textfield for search inputs. That
899 causes rounded corners and no border on iOS Safari. */
900 -webkit-appearance: none;
901 /* Override Normalize.css: we have margins and do
902 not want to overflow - the `moz` attribute is necessary
903 until Firefox 29, too early to drop at this point */
904 -moz-box-sizing: border-box !important;
905 box-sizing: border-box !important;
907 border: 1px solid var(--border-color);
912 background-color: var(--button-background-color);
913 color: var(--search-color);
915 .search-input:focus {
916 border-color: var(--search-input-focused-border-color);
924 .search-results.active {
926 /* prevent overhanging tabs from moving the first result */
930 .search-results .desc > span {
932 text-overflow: ellipsis;
937 .search-results > a {
939 /* A little margin ensures the browser's outlining of focused links has room to display. */
942 border-bottom: 1px solid #aaa3;
945 .search-results > a > div {
950 .search-results .result-name, .search-results div.desc, .search-results .result-description {
953 .search-results .result-name {
957 .search-results a:hover,
958 .search-results a:focus {
959 background-color: var(--search-result-link-focus-background-color);
970 border: 1px solid var(--border-color);
974 /* This rule is to draw the little arrow connecting the settings menu to the gear icon. */
979 border: solid var(--border-color);
980 border-width: 1px 1px 0 0;
981 display: inline-block;
983 transform: rotate(-45deg);
987 .popover, .popover::before {
988 background-color: var(--main-background-color);
989 color: var(--main-color);
992 #help-button .popover {
996 #help-button .popover::before {
1004 margin-right: 0.5rem;
1006 #help-button span.top, #help-button span.bottom {
1009 font-size: 1.125rem;
1011 #help-button span.top {
1013 border-bottom: 1px solid var(--border-color);
1014 padding-bottom: 4px;
1017 #help-button span.bottom {
1019 border-top: 1px solid var(--border-color);
1021 .side-by-side > div {
1024 padding: 0 20px 20px 17px;
1029 /* This min-height is needed to unify the height of the stab elements because some of them
1034 align-items: center;
1035 white-space: pre-wrap;
1040 font-size: 0.875rem;
1041 font-weight: normal;
1042 color: var(--main-color);
1043 background-color: var(--stab-background-color);
1046 .stab.portability > code {
1048 color: var(--stab-code-color);
1053 margin-right: 0.3rem;
1056 /* This is to prevent the `.stab` elements to overflow the .docblock elements. */
1062 /* Black one-pixel outline around emoji shapes */
1072 .import-item .stab {
1074 display: inline-block;
1075 font-size: 0.875rem;
1078 margin-left: 0.3125em;
1080 vertical-align: text-bottom;
1083 .module-item.unstable,
1084 .import-item.unstable {
1089 font-weight: normal;
1102 color: var(--right-side-color);
1105 pre.rust .question-mark {
1109 .example-wrap.compile_fail,
1110 .example-wrap.should_panic {
1111 border-left: 2px solid var(--codeblock-error-color);
1114 .ignore.example-wrap {
1115 border-left: 2px solid var(--codeblock-ignore-color);
1118 .example-wrap.compile_fail:hover,
1119 .example-wrap.should_panic:hover {
1120 border-left: 2px solid var(--codeblock-error-hover-color);
1123 .example-wrap.ignore:hover {
1124 border-left: 2px solid var(--codeblock-ignore-hover-color);
1127 .example-wrap.compile_fail .tooltip,
1128 .example-wrap.should_panic .tooltip {
1129 color: var(--codeblock-error-color);
1132 .example-wrap.ignore .tooltip {
1133 color: var(--codeblock-ignore-color);
1136 .example-wrap.compile_fail:hover .tooltip,
1137 .example-wrap.should_panic:hover .tooltip {
1138 color: var(--codeblock-error-hover-color);
1141 .example-wrap.ignore:hover .tooltip {
1142 color: var(--codeblock-ignore-hover-color);
1145 .example-wrap .tooltip {
1153 .example-wrap .tooltip::after {
1156 padding: 5px 3px 3px 3px;
1160 border: 1px solid var(--border-color);
1167 .example-wrap .tooltip::before {
1174 border-style: solid;
1179 .example-wrap.ignore .tooltip::after {
1180 content: "This example is not tested";
1182 .example-wrap.compile_fail .tooltip::after {
1183 content: "This example deliberately fails to compile";
1185 .example-wrap.should_panic .tooltip::after {
1186 content: "This example panics";
1188 .example-wrap.edition .tooltip::after {
1189 content: "This code runs with edition " attr(data-edition);
1192 .example-wrap .tooltip:hover::before, .example-wrap .tooltip:hover::after {
1196 .example-wrap.compile_fail .tooltip,
1197 .example-wrap.should_panic .tooltip,
1198 .example-wrap.ignore .tooltip {
1204 display: inline-block;
1207 padding: 5px 10px 5px 10px;
1209 font-size: 1.375rem;
1214 .example-wrap:hover .test-arrow {
1215 visibility: visible;
1217 a.test-arrow:hover {
1218 text-decoration: none;
1223 color: var(--code-attribute-color);
1231 .out-of-band > span.since {
1237 font-size: 1.125rem;
1238 margin-bottom: 10px;
1250 margin-bottom: 40px;
1253 .sub-variant > .sub-variant-field {
1257 :target > code, :target > .code-header {
1265 .notable-traits-tooltip {
1266 display: inline-block;
1270 .notable-traits:hover .notable-traits-tooltiptext,
1271 .notable-traits .notable-traits-tooltiptext.force-tooltip {
1272 display: inline-block;
1275 .notable-traits .notable-traits-tooltiptext {
1277 padding: 5px 3px 3px 3px;
1287 .notable-traits-tooltip::after {
1288 /* The margin on the tooltip does not capture hover events,
1289 this extends the area of hover enough so that mouse hover is not
1290 lost when moving the mouse to the tooltip */
1291 content: "\00a0\00a0\00a0";
1294 .notable-traits .notable, .notable-traits .docblock {
1298 .notable-traits .notable {
1300 margin-bottom: 13px;
1301 font-size: 1.1875rem;
1306 .notable-traits .docblock code.content {
1323 .search-failed.active {
1327 .search-failed > ul {
1336 flex-direction: row;
1343 font-size: 1.125rem;
1346 border-top: 2px solid;
1352 #titles > button > div.count {
1353 display: inline-block;
1368 border-bottom: 1px solid;
1371 justify-content: center;
1372 align-items: center;
1379 #source-sidebar > .title {
1382 border-bottom: 1px solid var(--border-color);
1385 #sidebar-toggle > button {
1399 /* work around button layout strangeness: https://stackoverflow.com/q/7271561 */
1401 /* iOS button gradient: https://stackoverflow.com/q/5438567 */
1402 -webkit-appearance: none;
1405 #settings-menu, #help-button {
1410 #settings-menu > a, #help-button > button, #copy-path {
1413 border: 1px solid var(--border-color);
1419 #settings-menu > a, #help-button > button {
1423 background-color: var(--button-background-color);
1427 color: var(--copy-path-button-color);
1430 filter: var(--copy-path-img-filter);
1432 #copy-path:hover > img {
1433 filter: var(--copy-path-img-hover-filter);
1436 @keyframes rotating {
1438 transform: rotate(0deg);
1441 transform: rotate(360deg);
1444 #settings-menu.rotate > a img {
1445 animation: rotating 2s linear infinite;
1448 .setting-line .radio-line input:checked {
1449 box-shadow: inset 0 0 0 3px var(--main-background-color);
1450 background-color: var(--settings-input-color);
1452 .setting-line .radio-line input:focus {
1453 box-shadow: 0 0 1px 1px var(--settings-input-color);
1455 /* In here we combine both `:focus` and `:checked` properties. */
1456 .setting-line .radio-line input:checked:focus {
1457 box-shadow: inset 0 0 0 3px var(--main-background-color),
1458 0 0 2px 2px var(--settings-input-color);
1460 .setting-line .radio-line input:hover {
1461 border-color: var(--settings-input-color) !important;
1463 input:checked + .slider {
1464 background-color: var(--settings-input-color);
1467 #help-button > button {
1469 /* Rare exception to specifying font sizes in rem. Since this is acting
1470 as an icon, it's okay to specify their sizes in pixels. */
1477 background-color: var(--main-background-color);
1485 display: inline-block;
1487 font: 15px monospace;
1489 vertical-align: middle;
1490 border: solid 1px var(--border-color);
1503 details.dir-entry > summary {
1505 list-style-position: outside;
1509 details.dir-entry div.folders, details.dir-entry div.files {
1513 details.dir-entry a {
1517 /* We use CSS containment on the details elements because most sizeable elements
1518 of the page are contained in one of these. This also makes re-rendering
1519 faster on document changes (like closing and opening toggles).
1520 Unfortunately we can't yet specify contain: content or contain: strict
1521 because the [-]/[+] toggles extend past the boundaries of the <details>
1522 https://developer.mozilla.org/en-US/docs/Web/CSS/contain */
1523 details.rustdoc-toggle {
1527 /* The hideme class is used on summary tags that contain a span with
1528 placeholder text shown only when the toggle is closed. For instance,
1529 "Expand description" or "Show methods". */
1530 details.rustdoc-toggle > summary.hideme {
1534 details.rustdoc-toggle > summary {
1537 details.rustdoc-toggle > summary::-webkit-details-marker,
1538 details.rustdoc-toggle > summary::marker {
1542 details.rustdoc-toggle > summary.hideme > span {
1546 details.rustdoc-toggle > summary::before {
1551 background-repeat: no-repeat;
1552 background-position: top left;
1553 display: inline-block;
1554 vertical-align: middle;
1558 details.rustdoc-toggle > summary.hideme > span,
1559 .more-examples-toggle summary, .more-examples-toggle .hide-more {
1560 color: var(--toggles-color);
1563 /* Screen readers see the text version at the end the line.
1564 Visual readers see the icon at the start of the line, but small and transparent. */
1565 details.rustdoc-toggle > summary::after {
1573 details.rustdoc-toggle > summary.hideme::after {
1574 /* "hideme" toggles already have a description when they're contracted */
1578 details.rustdoc-toggle > summary:focus::before,
1579 details.rustdoc-toggle > summary:hover::before {
1583 details.rustdoc-toggle.top-doc > summary,
1584 details.rustdoc-toggle.top-doc > summary::before,
1585 details.rustdoc-toggle.non-exhaustive > summary,
1586 details.rustdoc-toggle.non-exhaustive > summary::before {
1590 details.non-exhaustive {
1594 details.rustdoc-toggle > summary.hideme::before {
1598 details.rustdoc-toggle > summary:not(.hideme)::before {
1604 .impl-items > details.rustdoc-toggle > summary:not(.hideme)::before {
1609 /* When a "hideme" summary is open and the "Expand description" or "Show
1610 methods" text is hidden, we want the [-] toggle that remains to not
1611 affect the layout of the items to its right. To do that, we use
1612 absolute positioning. Note that we also set position: relative
1613 on the parent <details> to make this work properly. */
1614 details.rustdoc-toggle[open] > summary.hideme {
1618 details.rustdoc-toggle {
1622 details.rustdoc-toggle[open] > summary.hideme > span {
1626 details.rustdoc-toggle[open] > summary::before,
1627 details.rustdoc-toggle[open] > summary.hideme::before {
1628 background-image: /* AUTOREPLACE: */url("toggle-minus.svg");
1631 details.rustdoc-toggle > summary::before {
1632 background-image: /* AUTOREPLACE: */url("toggle-plus.svg");
1635 details.rustdoc-toggle[open] > summary::before,
1636 details.rustdoc-toggle[open] > summary.hideme::before {
1639 background-repeat: no-repeat;
1640 background-position: top left;
1641 display: inline-block;
1645 details.rustdoc-toggle[open] > summary::after,
1646 details.rustdoc-toggle[open] > summary.hideme::after {
1647 content: "Collapse";
1650 /* This is needed in docblocks to have the "â–¶" element to be on the same line. */
1651 .docblock summary > * {
1652 display: inline-block;
1658 WARNING: RUSTDOC_MOBILE_BREAKPOINT MEDIA QUERY;
1659 If you update this line, then you also need to update the line with the same warning
1660 in storage.js plus the media query with (max-width: 700px)
1662 @media (min-width: 701px) {
1663 /* In case there is no documentation before a code block, we need to add some margin at the top
1664 to prevent an overlay between the "collapse toggle" and the information tooltip.
1665 However, it's not needed with smaller screen width because the doc/code block is always put
1666 "one line" below. */
1667 .docblock > .example-wrap:first-child .tooltip {
1671 /* When we expand the sidebar on the source code page, we hide the logo on the left of the
1672 search bar to have more space. */
1673 .source-sidebar-expanded .source .sidebar + main .width-limiter .sub-logo-container.rust-logo {
1677 .source-sidebar-expanded .source .sidebar {
1683 WARNING: RUSTDOC_MOBILE_BREAKPOINT MEDIA QUERY
1684 If you update this line, then you also need to update the line with the same warning
1685 in storage.js plus the media query with (min-width: 701px)
1687 @media (max-width: 700px) {
1688 /* When linking to an item with an `id` (for instance, by clicking a link in the sidebar,
1689 or visiting a URL with a fragment like `#method.new`, we don't want the item to be obscured
1690 by the topbar. Anything with an `id` gets scroll-margin-top equal to .mobile-topbar's size.
1693 scroll-margin-top: 45px;
1698 /* Sidebar should overlay main content, rather than pushing main content to the right.
1699 Turn off `display: flex` on the body element. */
1709 flex-direction: column;
1714 margin-left: initial;
1718 .out-of-band .since::before {
1726 /* Hide the logo and item name from the sidebar. Those are displayed
1727 in the mobile-topbar instead. */
1728 .sidebar .sidebar-logo,
1729 .sidebar .location {
1736 /* Hide the sidebar offscreen while not in use. Doing this instead of display: none means
1737 the sidebar stays visible for screen readers, which is useful for navigation. */
1743 /* Reduce height slightly to account for mobile topbar. */
1744 height: calc(100vh - 45px);
1747 /* The source view uses a different design for the sidebar toggle, and doesn't have a topbar,
1748 so don't bump down the main content or the sidebar. */
1750 .rustdoc.source .sidebar {
1758 .source-sidebar-expanded .source .sidebar,
1759 .sidebar:focus-within {
1763 .rustdoc.source > .sidebar {
1767 .mobile-topbar .location a {
1772 .mobile-topbar .location {
1775 margin: auto 0.5em auto auto;
1776 text-overflow: ellipsis;
1778 white-space: nowrap;
1779 /* Rare exception to specifying font sizes in rem. Since the topbar
1780 height is specified in pixels, this also has to be specified in
1781 pixels to avoid overflowing the topbar when the user sets a bigger
1786 .mobile-topbar .logo-container {
1790 .mobile-topbar .logo-container > img {
1800 flex-direction: row;
1810 .source .mobile-topbar {
1814 .sidebar-menu-toggle {
1816 /* Rare exception to specifying font sizes in rem. Since this is acting
1817 as an icon, it's okay to specify its sizes in pixels. */
1820 color: var(--main-color);
1825 background-color: var(--sidebar-background-color);
1837 display: none !important;
1840 #titles > button > div.count {
1844 /* Because of ios, we need to actually have a full height sidebar title so the
1845 * actual sidebar can show up. But then we need to make it transparent so we don't
1846 * hide content. The filler just allows to create the background for the sidebar
1847 * title. But because of the absolute position, I had to lower the z-index.
1852 width: calc(100% - 45px);
1856 border-bottom: 1px solid;
1859 #main-content > details.rustdoc-toggle > summary::before,
1860 #main-content > div > details.rustdoc-toggle > summary::before {
1873 border-top-right-radius: 3px;
1874 border-bottom-right-radius: 3px;
1880 .source-sidebar-expanded #sidebar-toggle {
1884 border-top-right-radius: unset;
1885 border-bottom-right-radius: unset;
1888 border-bottom: 1px solid;
1891 .notable-traits .notable-traits-tooltiptext {
1896 /* We don't display the help button on mobile devices. */
1901 /* Display an alternating layout on tablets and phones */
1907 flex-flow: column wrap;
1909 .item-left, .item-right {
1913 /* Display an alternating layout on tablets and phones */
1914 .search-results > a {
1915 border-bottom: 1px solid #aaa9;
1918 .search-results .result-name, .search-results div.desc, .search-results .result-description {
1921 .search-results div.desc, .search-results .result-description, .item-right {
1925 .source-sidebar-expanded .source .sidebar {
1930 /* Position of the "[-]" element. */
1931 details.rustdoc-toggle:not(.top-doc) > summary {
1934 .impl-items > details.rustdoc-toggle > summary:not(.hideme)::before,
1935 #main-content > details.rustdoc-toggle:not(.top-doc) > summary::before,
1936 #main-content > div > details.rustdoc-toggle > summary::before {
1940 /* Align summary-nested and unnested item-info gizmos. */
1941 .content .impl-items > .item-info {
1947 nav.sidebar, nav.sub, .out-of-band, a.srclink, #copy-path,
1948 details.rustdoc-toggle[open] > summary::before, details.rustdoc-toggle > summary::before,
1949 details.rustdoc-toggle.top-doc > summary {
1962 @media (max-width: 464px) {
1972 overflow-wrap: break-word;
1973 overflow-wrap: anywhere;
1977 flex-direction: column;
1980 .sub-logo-container {
1984 .source .sub-logo-container > img {
1992 .source-sidebar-expanded #sidebar-toggle {
1997 .method-toggle summary,
1998 .implementors-toggle summary,
2000 #implementors-list > .docblock,
2001 .impl-items > section,
2004 margin-bottom: 0.75em;
2007 .method-toggle[open]:not(:last-child) {
2011 .implementors-toggle[open]:not(:last-child) {
2015 #trait-implementations-list .method-toggle:not(:last-child),
2016 #synthetic-implementations-list .method-toggle:not(:last-child),
2017 #blanket-implementations-list .method-toggle:not(:last-child) {
2021 /* Begin: styles for --scrape-examples feature */
2023 .scraped-example-list .scrape-help {
2026 font-weight: normal;
2030 background: transparent;
2032 border-style: solid;
2033 border-radius: 50px;
2036 .scraped-example .code-wrapper {
2039 flex-direction: row;
2044 .scraped-example:not(.expanded) .code-wrapper {
2048 .scraped-example:not(.expanded) .code-wrapper pre {
2054 .scraped-example:not(.expanded) .code-wrapper pre.src-line-numbers {
2058 .scraped-example .code-wrapper .prev {
2066 .scraped-example .code-wrapper .next {
2074 .scraped-example .code-wrapper .expand {
2082 .scraped-example:not(.expanded) .code-wrapper:before {
2091 .scraped-example:not(.expanded) .code-wrapper:after {
2100 .scraped-example .code-wrapper .src-line-numbers {
2105 .scraped-example .code-wrapper .src-line-numbers span {
2109 .scraped-example .code-wrapper .example-wrap {
2116 .scraped-example:not(.expanded) .code-wrapper .example-wrap {
2120 .scraped-example .code-wrapper .example-wrap pre.rust {
2121 overflow-x: inherit;
2127 .more-examples-toggle {
2128 max-width: calc(100% + 25px);
2133 .more-examples-toggle .hide-more {
2139 .more-scraped-examples {
2142 flex-direction: row;
2145 .more-scraped-examples-inner {
2146 /* 20px is width of toggle-line + toggle-line-inner */
2147 width: calc(100% - 20px);
2151 align-self: stretch;
2158 .toggle-line-inner {
2163 .more-scraped-examples .scraped-example {
2164 margin-bottom: 20px;
2167 .more-scraped-examples .scraped-example:last-child {
2179 /* End: styles for --scrape-examples feature */