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;
167 text-decoration: none;
169 /* The only headings that get underlines are:
170 Markdown-generated headings within the top-doc
171 Rustdoc-generated h2 section headings (e.g. "Implementations", "Required Methods", etc)
172 Underlines elsewhere in the documentation break up visual flow and tend to invert
173 section hierarchies. */
175 .top-doc .docblock > h3,
176 .top-doc .docblock > h4 {
177 border-bottom: 1px solid var(--headings-border-bottom-color);
180 font-size: 1.125rem; /* 18px */
192 h1, h2, h3, h4, h5, h6,
196 .search-results .result-name,
202 details.rustdoc-toggle.top-doc > summary,
203 details.rustdoc-toggle.non-exhaustive > summary,
204 .scraped-example-title,
205 .more-examples-toggle summary, .more-examples-toggle .hide-more,
207 /* This selector is for the items listed in the "all items" page. */
209 font-family: "Fira Sans", Arial, NanumBarunGothic, sans-serif;
214 .small-section-header a,
224 .result-name .primitive > i, .result-name .keyword > i,
228 color: var(--main-color);
231 .content span.enum, .content a.enum,
232 .content span.struct, .content a.struct,
233 .content span.union, .content a.union,
234 .content span.primitive, .content a.primitive,
235 .content span.type, .content a.type,
236 .content span.foreigntype, .content a.foreigntype {
237 color: var(--type-link-color);
240 .content span.trait, .content a.trait,
241 .content span.traitalias, .content a.traitalias {
242 color: var(--trait-link-color);
245 .content span.associatedtype, .content a.associatedtype,
246 .content span.constant, .content a.constant,
247 .content span.static, .content a.static {
248 color: var(--assoc-item-link-color);
251 .content span.fn, .content a.fn,
253 .content span.method, .content a.method,
254 .content span.tymethod, .content a.tymethod {
255 color: var(--function-link-color);
258 .content span.attr, .content a.attr,
259 .content span.derive, .content a.derive,
260 .content span.macro, .content a.macro {
261 color: var(--macro-link-color);
264 .content span.mod, .content a.mod {
265 color: var(--mod-link-color);
268 .content span.keyword, .content a.keyword {
269 color: var(--keyword-link-color);
273 color: var(--link-color);
279 ul ul, ol ul, ul ol, ol ol {
280 margin-bottom: .625em;
284 /* Paragraph spacing at least 1.5 times line spacing per Web Content Accessibility Guidelines.
285 Line-height is 1.5rem, so line spacing is .5rem; .75em is 1.5 times that.
286 https://www.w3.org/WAI/WCAG21/Understanding/visual-presentation.html */
289 /* For the last child of a div, the margin will be taken care of
290 by the margin-top of the next item. */
295 /* Fix some style changes due to normalize.css 8 */
298 /* Buttons on Safari have different default padding than other platforms. Make them the same. */
302 /* end tweaks for normalize.css 8 */
313 padding: 10px 15px 40px 45px;
326 .source .width-limiter {
330 details:not(.rustdoc-toggle) summary {
334 code, pre, a.test-arrow, .code-header {
335 font-family: "Source Code Pro", monospace;
337 .docblock code, .docblock-short code {
341 .docblock pre code, .docblock-short pre code {
351 .source .content pre {
363 .sub-logo-container {
367 .sub-logo-container > img {
373 .sidebar, .mobile-topbar, .sidebar-menu-toggle {
374 background-color: var(--sidebar-background-color);
388 .rustdoc.source .sidebar {
395 border-right: 1px solid;
397 /* The sidebar is by default hidden */
401 .source .sidebar, #sidebar-toggle, #source-sidebar {
402 background-color: var(--sidebar-background-color);
405 #sidebar-toggle > button:hover, #sidebar-toggle > button:focus {
406 background-color: var(--sidebar-background-color-hover);
409 .source .sidebar > *:not(#sidebar-toggle) {
413 .source-sidebar-expanded .source .sidebar {
418 .source-sidebar-expanded .source .sidebar > *:not(#sidebar-toggle) {
426 /* Improve the scrollbar display on firefox */
428 scrollbar-width: initial;
429 scrollbar-color: var(--scrollbar-color);
432 scrollbar-width: thin;
433 scrollbar-color: var(--scrollbar-color);
436 /* Improve the scrollbar display on webkit-based browsers */
437 ::-webkit-scrollbar {
440 .sidebar::-webkit-scrollbar {
443 ::-webkit-scrollbar-track {
444 -webkit-box-shadow: inset 0;
445 background-color: var(--scrollbar-track-background-color);
447 .sidebar::-webkit-scrollbar-track {
448 background-color: var(--scrollbar-track-background-color);
450 ::-webkit-scrollbar-thumb, .sidebar::-webkit-scrollbar-thumb {
451 background-color: var(--scrollbar-thumb-background-color);
454 /* Everything else */
457 display: none !important;
460 .sidebar .logo-container {
464 justify-content: center;
468 overflow-wrap: break-word;
471 .logo-container > img {
476 ul.block, .block li {
487 margin-left: -0.25rem;
489 text-overflow: ellipsis;
494 overflow-wrap: anywhere;
498 margin-bottom: 0.7rem;
502 font-size: 1.125rem; /* 18px */
512 .sidebar a, .sidebar .current {
513 color: var(--sidebar-link-color);
517 background-color: var(--sidebar-current-link-background-color);
520 .sidebar-elems .block {
524 .sidebar-elems .block li a {
532 .source .content pre.rust {
537 .rustdoc .example-wrap {
542 /* For the last child of a div, the margin will be taken care of
543 by the margin-top of the next item. */
544 .rustdoc .example-wrap:last-child {
548 .rustdoc .example-wrap > pre {
554 .rustdoc .example-wrap > pre.example-line-numbers,
555 .rustdoc .example-wrap > pre.src-line-numbers {
559 -webkit-user-select: none;
560 -moz-user-select: none;
561 -ms-user-select: none;
565 .example-line-numbers {
568 border-top-left-radius: 5px;
569 border-bottom-left-radius: 5px;
570 border-color: var(--example-line-numbers-border-color);
573 .src-line-numbers span {
575 color: var(--src-line-numbers-span-color);
577 .src-line-numbers .line-highlighted {
578 background-color: var(--src-line-number-highlighted-background-color);
580 .src-line-numbers :target {
581 background-color: transparent;
589 overflow-wrap: break-word;
590 overflow-wrap: anywhere;
592 text-overflow: ellipsis;
594 /* Wrap non-pre code blocks (`text`) but not (```text```). */
595 .docblock > :not(pre) > code,
596 .docblock-short > code {
597 white-space: pre-wrap;
600 .top-doc .docblock h2 { font-size: 1.375rem; }
601 .top-doc .docblock h3 { font-size: 1.25rem; }
602 .top-doc .docblock h4,
603 .top-doc .docblock h5 {
606 .top-doc .docblock h6 {
610 .docblock h5 { font-size: 1rem; }
611 .docblock h6 { font-size: 0.875rem; }
618 .docblock > :not(.more-examples-toggle):not(.example-wrap) {
628 .docblock code, .docblock-short code,
629 pre, .rustdoc.source .example-wrap {
630 background-color: var(--code-block-background-color);
639 width: calc(100% - 2px);
642 border-collapse: collapse;
647 border: 1px dashed var(--border-color);
654 border: 1px solid var(--border-color);
657 /* Shift "where ..." part of method or fn definition down a line */
674 #main-content > .item-info {
681 flex-flow: row nowrap;
682 margin: 4px 0 25px 0;
692 .source nav.sub form {
697 text-decoration: none;
700 .small-section-header {
702 justify-content: space-between;
706 .small-section-header:hover > .anchor {
710 .impl:hover > .anchor, .trait-impl:hover > .anchor {
711 display: inline-block;
718 background: none !important;
723 .small-section-header > .anchor {
727 h2.small-section-header > .anchor {
734 .main-heading a:hover,
735 .example-wrap > pre.rust a:hover,
737 .docblock a:not(.test-arrow):not(.scrape-help):hover,
738 .docblock-short a:not(.test-arrow):not(.scrape-help):hover,
740 text-decoration: underline;
743 .crate.block a.current { font-weight: 500; }
745 /* In most contexts we use `overflow-wrap: anywhere` to ensure that we can wrap
746 as much as needed on mobile (see
747 src/test/rustdoc-gui/type-declaration-overflow.goml for an example of why
748 this matters). The `anywhere` value means:
750 "Soft wrap opportunities introduced by the word break are considered when
751 calculating min-content intrinsic sizes."
753 https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-wrap#values
755 For table layouts, that becomes a problem: the browser tries to make each
756 column as narrow as possible, and `overflow-wrap: anywhere` means it can do
757 so by breaking words - even if some other column could be shrunk without
758 breaking words! This shows up, for instance, in the `Structs` / `Modules` /
759 `Functions` (etcetera) sections of a module page, and when a docblock
762 So, for table layouts, override the default with break-word, which does
763 _not_ affect min-content intrinsic sizes.
767 overflow-wrap: break-word;
776 .item-left, .item-right {
780 padding-right: 1.25rem;
788 .search-results-title {
791 /* flex layout allows shrinking the <select> appropriately if it becomes too large */
792 display: inline-flex;
794 /* make things look like in a line, despite the fact that we're using a layout
795 with boxes (i.e. from the flex layout) */
796 align-items: baseline;
799 display: inline-block;
800 /* ensures that 100% in properties of #crate-search-div:after
801 are relative to the size of this div */
803 /* allows this div (and with it the <select>-element "#crate-search") to be shrunk */
809 /* keep these two in sync with "@-moz-document url-prefix()" below */
812 /* prevents the <select> from overflowing the containing div in case it's shrunk */
814 /* contents can overflow because of max-width limit, then show ellipsis */
815 text-overflow: ellipsis;
816 border: 1px solid var(--border-color);
820 -moz-appearance: none;
821 -webkit-appearance: none;
822 /* Removes default arrow from firefox */
824 background-color: var(--main-background-color);
829 /* cancel stylistic differences in padding in firefox
830 for "appearance: none"-style (or equivalent) <select>s */
831 @-moz-document url-prefix() {
833 padding-left: 0px; /* == 4px - 4px */
834 padding-right: 19px; /* == 23px - 4px */
837 /* pseudo-element for holding the dropdown-arrow image; needs to be a separate thing
838 so that we can apply CSS-filters to change the arrow color in themes */
839 #crate-search-div::after {
840 /* lets clicks through! */
841 pointer-events: none;
842 /* completely covers the underlying div */
849 background-repeat: no-repeat;
850 background-size: 20px;
851 background-position: calc(100% - 2px) 56%;
852 /* image is black color, themes should apply a "filter" property to change the color */
853 background-image: /* AUTOREPLACE: */url("down-arrow.svg");
855 #crate-search > option {
859 /* Override Normalize.css: it has a rule that sets
860 -webkit-appearance: textfield for search inputs. That
861 causes rounded corners and no border on iOS Safari. */
862 -webkit-appearance: none;
863 /* Override Normalize.css: we have margins and do
864 not want to overflow */
865 box-sizing: border-box !important;
867 border: 1px solid var(--border-color);
872 background-color: var(--button-background-color);
873 color: var(--search-color);
875 .search-input:focus {
876 border-color: var(--search-input-focused-border-color);
884 .search-results.active {
886 /* prevent overhanging tabs from moving the first result */
890 .search-results .desc > span {
892 text-overflow: ellipsis;
897 .search-results > a {
899 /* A little margin ensures the browser's outlining of focused links has room to display. */
902 border-bottom: 1px solid #aaa3;
905 .search-results > a > div {
910 .search-results .result-name, .search-results div.desc {
913 .search-results .result-name {
917 .search-results a:hover,
918 .search-results a:focus {
919 background-color: var(--search-result-link-focus-background-color);
930 border: 1px solid var(--border-color);
934 /* This rule is to draw the little arrow connecting the settings menu to the gear icon. */
939 border: solid var(--border-color);
940 border-width: 1px 1px 0 0;
941 display: inline-block;
943 transform: rotate(-45deg);
947 .popover, .popover::before {
948 background-color: var(--main-background-color);
949 color: var(--main-color);
952 /* use larger max-width for help popover, but not for help.html */
957 #help.popover::before {
965 margin-right: 0.5rem;
967 #help span.top, #help span.bottom {
974 border-bottom: 1px solid var(--border-color);
980 border-top: 1px solid var(--border-color);
982 .side-by-side > div {
985 padding: 0 20px 20px 17px;
990 /* This min-height is needed to unify the height of the stab elements because some of them
996 white-space: pre-wrap;
1001 font-size: 0.875rem;
1002 font-weight: normal;
1003 color: var(--main-color);
1004 background-color: var(--stab-background-color);
1007 .stab.portability > code {
1009 color: var(--stab-code-color);
1014 margin-right: 0.3rem;
1017 /* This is to prevent the `.stab` elements to overflow the .docblock elements. */
1023 /* Black one-pixel outline around emoji shapes */
1033 .import-item .stab {
1035 display: inline-block;
1036 font-size: 0.875rem;
1039 margin-left: 0.3125em;
1041 vertical-align: text-bottom;
1044 .module-item.unstable,
1045 .import-item.unstable {
1050 font-weight: normal;
1062 color: var(--right-side-color);
1070 /* Code highlighting */
1072 color: var(--code-highlight-kw-color);
1075 color: var(--code-highlight-kw-2-color);
1077 pre.rust .lifetime {
1078 color: var(--code-highlight-lifetime-color);
1080 pre.rust .prelude-ty {
1081 color: var(--code-highlight-prelude-color);
1083 pre.rust .prelude-val {
1084 color: var(--code-highlight-prelude-val-color);
1087 color: var(--code-highlight-string-color);
1090 color: var(--code-highlight-number-color);
1092 pre.rust .bool-val {
1093 color: var(--code-highlight-literal-color);
1096 color: var(--code-highlight-self-color);
1098 pre.rust .attribute {
1099 color: var(--code-highlight-attribute-color);
1102 pre.rust .macro-nonterminal {
1103 color: var(--code-highlight-macro-color);
1105 pre.rust .question-mark {
1107 color: var(--code-highlight-question-mark-color);
1110 color: var(--code-highlight-comment-color);
1112 pre.rust .doccomment {
1113 color: var(--code-highlight-doc-comment-color);
1116 .example-wrap.compile_fail,
1117 .example-wrap.should_panic {
1118 border-left: 2px solid var(--codeblock-error-color);
1121 .ignore.example-wrap {
1122 border-left: 2px solid var(--codeblock-ignore-color);
1125 .example-wrap.compile_fail:hover,
1126 .example-wrap.should_panic:hover {
1127 border-left: 2px solid var(--codeblock-error-hover-color);
1130 .example-wrap.ignore:hover {
1131 border-left: 2px solid var(--codeblock-ignore-hover-color);
1134 .example-wrap.compile_fail .tooltip,
1135 .example-wrap.should_panic .tooltip {
1136 color: var(--codeblock-error-color);
1139 .example-wrap.ignore .tooltip {
1140 color: var(--codeblock-ignore-color);
1143 .example-wrap.compile_fail:hover .tooltip,
1144 .example-wrap.should_panic:hover .tooltip {
1145 color: var(--codeblock-error-hover-color);
1148 .example-wrap.ignore:hover .tooltip {
1149 color: var(--codeblock-ignore-hover-color);
1152 .example-wrap .tooltip {
1160 .example-wrap .tooltip::after {
1163 padding: 5px 3px 3px 3px;
1167 border: 1px solid var(--border-color);
1174 .example-wrap .tooltip::before {
1181 border-style: solid;
1186 .example-wrap.ignore .tooltip::after {
1187 content: "This example is not tested";
1189 .example-wrap.compile_fail .tooltip::after {
1190 content: "This example deliberately fails to compile";
1192 .example-wrap.should_panic .tooltip::after {
1193 content: "This example panics";
1195 .example-wrap.edition .tooltip::after {
1196 content: "This code runs with edition " attr(data-edition);
1199 .example-wrap .tooltip:hover::before, .example-wrap .tooltip:hover::after {
1203 .example-wrap.compile_fail .tooltip,
1204 .example-wrap.should_panic .tooltip,
1205 .example-wrap.ignore .tooltip {
1211 display: inline-block;
1214 padding: 5px 10px 5px 10px;
1216 font-size: 1.375rem;
1221 .example-wrap:hover .test-arrow {
1222 visibility: visible;
1227 color: var(--code-attribute-color);
1235 .out-of-band > span.since {
1241 font-size: 1.125rem;
1242 margin-bottom: 10px;
1254 margin-bottom: 40px;
1257 .sub-variant > .sub-variant-field {
1261 :target > code, :target > .code-header {
1269 .notable-traits-tooltip {
1270 display: inline-block;
1274 .notable-traits:hover .notable-traits-tooltiptext,
1275 .notable-traits .notable-traits-tooltiptext.force-tooltip {
1276 display: inline-block;
1279 .notable-traits .notable-traits-tooltiptext {
1281 padding: 5px 3px 3px 3px;
1291 .notable-traits-tooltip::after {
1292 /* The margin on the tooltip does not capture hover events,
1293 this extends the area of hover enough so that mouse hover is not
1294 lost when moving the mouse to the tooltip */
1295 content: "\00a0\00a0\00a0";
1298 .notable-traits .docblock {
1302 .notable-traits .notable {
1304 margin-bottom: 13px;
1305 font-size: 1.1875rem;
1310 .notable-traits .docblock code.content {
1322 .search-failed.active {
1326 .search-failed > ul {
1335 flex-direction: row;
1342 font-size: 1.125rem;
1345 border-top: 2px solid;
1351 #titles > button > div.count {
1352 display: inline-block;
1367 border-bottom: 1px solid;
1370 justify-content: center;
1371 align-items: center;
1378 #source-sidebar > .title {
1381 border-bottom: 1px solid var(--border-color);
1384 #sidebar-toggle > button {
1398 /* work around button layout strangeness: https://stackoverflow.com/q/7271561 */
1400 /* iOS button gradient: https://stackoverflow.com/q/5438567 */
1401 -webkit-appearance: none;
1404 #settings-menu, #help-button {
1409 #settings-menu > a, #help-button > a, #copy-path {
1415 #settings-menu > a, #help-button > a {
1419 background-color: var(--button-background-color);
1420 border: 1px solid var(--border-color);
1425 color: var(--copy-path-button-color);
1426 background: var(--main-background-color);
1434 filter: var(--copy-path-img-filter);
1436 #copy-path:hover > img {
1437 filter: var(--copy-path-img-hover-filter);
1440 @keyframes rotating {
1442 transform: rotate(0deg);
1445 transform: rotate(360deg);
1448 #settings-menu.rotate > a img {
1449 animation: rotating 2s linear infinite;
1454 /* Rare exception to specifying font sizes in rem. Since this is acting
1455 as an icon, it's okay to specify their sizes in pixels. */
1461 display: inline-block;
1463 font: 15px monospace;
1465 vertical-align: middle;
1466 border: solid 1px var(--border-color);
1479 details.dir-entry > summary::after {
1486 /* set width to cover gap between arrow and text */
1490 details[open].dir-entry > summary::after {
1494 details.dir-entry > summary::-webkit-details-marker,
1495 details.dir-entry > summary::marker {
1499 details.dir-entry > summary {
1506 details.dir-entry div.folders, details.dir-entry div.files {
1510 details.dir-entry a {
1514 /* We use CSS containment on the details elements because most sizeable elements
1515 of the page are contained in one of these. This also makes re-rendering
1516 faster on document changes (like closing and opening toggles).
1517 Unfortunately we can't yet specify contain: content or contain: strict
1518 because the [-]/[+] toggles extend past the boundaries of the <details>
1519 https://developer.mozilla.org/en-US/docs/Web/CSS/contain */
1520 details.rustdoc-toggle {
1525 /* The hideme class is used on summary tags that contain a span with
1526 placeholder text shown only when the toggle is closed. For instance,
1527 "Expand description" or "Show methods". */
1528 details.rustdoc-toggle > summary.hideme {
1532 details.rustdoc-toggle > summary {
1534 /* focus outline is shown on `::before` instead of this */
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 > summary:focus-visible::before {
1584 /* The SVG is black, and gets turned white using a filter in the dark themes.
1585 Do the same with the outline.
1586 The dotted 1px style is copied from Firefox's focus ring style.
1588 outline: 1px dotted #000;
1589 outline-offset: 1px;
1592 details.rustdoc-toggle.top-doc > summary,
1593 details.rustdoc-toggle.top-doc > summary::before,
1594 details.rustdoc-toggle.non-exhaustive > summary,
1595 details.rustdoc-toggle.non-exhaustive > summary::before {
1599 details.non-exhaustive {
1603 details.rustdoc-toggle > summary.hideme::before {
1607 details.rustdoc-toggle > summary:not(.hideme)::before {
1613 .impl-items > details.rustdoc-toggle > summary:not(.hideme)::before {
1618 /* When a "hideme" summary is open and the "Expand description" or "Show
1619 methods" text is hidden, we want the [-] toggle that remains to not
1620 affect the layout of the items to its right. To do that, we use
1621 absolute positioning. Note that we also set position: relative
1622 on the parent <details> to make this work properly. */
1623 details.rustdoc-toggle[open] > summary.hideme {
1627 details.rustdoc-toggle[open] > summary.hideme > span {
1631 details.rustdoc-toggle[open] > summary::before,
1632 details.rustdoc-toggle[open] > summary.hideme::before {
1633 background-image: /* AUTOREPLACE: */url("toggle-minus.svg");
1636 details.rustdoc-toggle > summary::before {
1637 background-image: /* AUTOREPLACE: */url("toggle-plus.svg");
1640 details.rustdoc-toggle[open] > summary::before,
1641 details.rustdoc-toggle[open] > summary.hideme::before {
1644 background-repeat: no-repeat;
1645 background-position: top left;
1646 display: inline-block;
1650 details.rustdoc-toggle[open] > summary::after,
1651 details.rustdoc-toggle[open] > summary.hideme::after {
1652 content: "Collapse";
1655 /* This is needed in docblocks to have the "â–¶" element to be on the same line. */
1656 .docblock summary > * {
1657 display: inline-block;
1660 /* In case there is no documentation before a code block, we need to add some margin at the top
1661 to prevent an overlay between the "collapse toggle" and the information tooltip.
1662 However, it's not needed with smaller screen width because the doc/code block is always put
1663 "one line" below. */
1664 .docblock > .example-wrap:first-child .tooltip {
1671 WARNING: RUSTDOC_MOBILE_BREAKPOINT MEDIA QUERY
1672 If you update this line, then you also need to update the line with the same warning
1675 @media (max-width: 700px) {
1676 /* When linking to an item with an `id` (for instance, by clicking a link in the sidebar,
1677 or visiting a URL with a fragment like `#method.new`, we don't want the item to be obscured
1678 by the topbar. Anything with an `id` gets scroll-margin-top equal to .mobile-topbar's size.
1681 scroll-margin-top: 45px;
1686 /* Sidebar should overlay main content, rather than pushing main content to the right.
1687 Turn off `display: flex` on the body element. */
1697 flex-direction: column;
1702 margin-left: initial;
1706 .out-of-band .since::before {
1714 /* Hide the logo and item name from the sidebar. Those are displayed
1715 in the mobile-topbar instead. */
1716 .sidebar .sidebar-logo,
1717 .sidebar .location {
1724 /* Hide the sidebar offscreen while not in use. Doing this instead of display: none means
1725 the sidebar stays visible for screen readers, which is useful for navigation. */
1731 /* Reduce height slightly to account for mobile topbar. */
1732 height: calc(100vh - 45px);
1735 /* The source view uses a different design for the sidebar toggle, and doesn't have a topbar,
1736 so don't bump down the main content or the sidebar. */
1738 .rustdoc.source .sidebar {
1746 .source-sidebar-expanded .source .sidebar,
1747 .sidebar:focus-within {
1751 .rustdoc.source > .sidebar {
1757 margin: auto 0.5em auto auto;
1759 /* Rare exception to specifying font sizes in rem. Since the topbar
1760 height is specified in pixels, this also has to be specified in
1761 pixels to avoid overflowing the topbar when the user sets a bigger
1766 .mobile-topbar h2 a {
1768 text-overflow: ellipsis;
1770 white-space: nowrap;
1773 .mobile-topbar .logo-container {
1777 .mobile-topbar .logo-container > img {
1787 flex-direction: row;
1797 .sidebar-menu-toggle {
1799 /* Rare exception to specifying font sizes in rem. Since this is acting
1800 as an icon, it's okay to specify its sizes in pixels. */
1803 color: var(--main-color);
1808 background-color: var(--sidebar-background-color);
1816 display: none !important;
1819 #titles > button > div.count {
1823 /* Because of ios, we need to actually have a full height sidebar title so the
1824 * actual sidebar can show up. But then we need to make it transparent so we don't
1825 * hide content. The filler just allows to create the background for the sidebar
1826 * title. But because of the absolute position, I had to lower the z-index.
1831 width: calc(100% - 45px);
1835 border-bottom: 1px solid;
1838 #main-content > details.rustdoc-toggle > summary::before,
1839 #main-content > div > details.rustdoc-toggle > summary::before {
1852 border-top-right-radius: 3px;
1853 border-bottom-right-radius: 3px;
1859 .source-sidebar-expanded #sidebar-toggle {
1863 border-top-right-radius: unset;
1864 border-bottom-right-radius: unset;
1867 border-bottom: 1px solid;
1870 .notable-traits .notable-traits-tooltiptext {
1875 /* We don't display the help button on mobile devices. */
1880 /* Display an alternating layout on tablets and phones */
1886 flex-flow: column wrap;
1888 .item-left, .item-right {
1892 /* Display an alternating layout on tablets and phones */
1893 .search-results > a {
1894 border-bottom: 1px solid #aaa9;
1897 .search-results .result-name, .search-results div.desc {
1900 .search-results div.desc, .item-right {
1904 .source-sidebar-expanded .source .sidebar {
1909 /* Position of the "[-]" element. */
1910 details.rustdoc-toggle:not(.top-doc) > summary {
1913 .impl-items > details.rustdoc-toggle > summary:not(.hideme)::before,
1914 #main-content > details.rustdoc-toggle:not(.top-doc) > summary::before,
1915 #main-content > div > details.rustdoc-toggle > summary::before {
1919 /* Align summary-nested and unnested item-info gizmos. */
1920 .impl-items > .item-info {
1931 nav.sidebar, nav.sub, .out-of-band, a.srclink, #copy-path,
1932 details.rustdoc-toggle[open] > summary::before, details.rustdoc-toggle > summary::before,
1933 details.rustdoc-toggle.top-doc > summary {
1946 @media (max-width: 464px) {
1952 overflow-wrap: break-word;
1953 overflow-wrap: anywhere;
1957 flex-direction: column;
1961 align-self: stretch;
1964 .sub-logo-container > img {
1972 .source-sidebar-expanded #sidebar-toggle {
1977 .method-toggle > summary,
1978 .implementors-toggle > summary,
1980 #implementors-list > .docblock,
1981 .impl-items > section,
1984 margin-bottom: 0.75em;
1987 .method-toggle[open]:not(:last-child),
1988 .implementors-toggle[open]:not(:last-child) {
1992 #trait-implementations-list .method-toggle:not(:last-child),
1993 #synthetic-implementations-list .method-toggle:not(:last-child),
1994 #blanket-implementations-list .method-toggle:not(:last-child) {
1998 /* Begin: styles for --scrape-examples feature */
2000 .scraped-example-list .scrape-help {
2003 font-weight: normal;
2007 background: transparent;
2009 border-style: solid;
2010 border-radius: 50px;
2013 .scraped-example .code-wrapper {
2016 flex-direction: row;
2021 .scraped-example:not(.expanded) .code-wrapper {
2025 .scraped-example:not(.expanded) .code-wrapper pre {
2031 .scraped-example .code-wrapper .prev {
2039 .scraped-example .code-wrapper .next {
2047 .scraped-example .code-wrapper .expand {
2055 .scraped-example:not(.expanded) .code-wrapper:before {
2064 .scraped-example:not(.expanded) .code-wrapper:after {
2073 .scraped-example .code-wrapper .src-line-numbers {
2078 .scraped-example .code-wrapper .src-line-numbers span {
2082 .scraped-example .code-wrapper .example-wrap {
2089 .scraped-example:not(.expanded) .code-wrapper .example-wrap {
2093 .scraped-example .code-wrapper .example-wrap pre.rust {
2094 overflow-x: inherit;
2100 .more-examples-toggle {
2101 max-width: calc(100% + 25px);
2106 .more-examples-toggle .hide-more {
2112 .more-scraped-examples {
2115 flex-direction: row;
2118 .more-scraped-examples-inner {
2119 /* 20px is width of toggle-line + toggle-line-inner */
2120 width: calc(100% - 20px);
2124 align-self: stretch;
2131 .toggle-line-inner {
2136 .more-scraped-examples .scraped-example {
2137 margin-bottom: 20px;
2140 .more-scraped-examples .scraped-example:last-child {
2152 /* End: styles for --scrape-examples feature */