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 /* The only headings that get underlines are:
167 Markdown-generated headings within the top-doc
168 Rustdoc-generated h2 section headings (e.g. "Implementations", "Required Methods", etc)
169 Underlines elsewhere in the documentation break up visual flow and tend to invert
170 section hierarchies. */
172 .top-doc .docblock > h3,
173 .top-doc .docblock > h4 {
174 border-bottom: 1px solid var(--headings-border-bottom-color);
177 font-size: 1.125rem; /* 18px */
189 h1, h2, h3, h4, h5, h6,
193 .search-results .result-name,
199 details.rustdoc-toggle.top-doc > summary,
200 details.rustdoc-toggle.non-exhaustive > summary,
201 .scraped-example-title,
202 .more-examples-toggle summary, .more-examples-toggle .hide-more,
204 /* This selector is for the items listed in the "all items" page. */
206 font-family: "Fira Sans", Arial, NanumBarunGothic, sans-serif;
211 .small-section-header a,
221 .result-name .primitive > i, .result-name .keyword > i,
225 color: var(--main-color);
228 .content span.enum, .content a.enum,
229 .content span.struct, .content a.struct,
230 .content span.union, .content a.union,
231 .content span.primitive, .content a.primitive,
232 .content span.type, .content a.type,
233 .content span.foreigntype, .content a.foreigntype {
234 color: var(--type-link-color);
237 .content span.trait, .content a.trait,
238 .content span.traitalias, .content a.traitalias {
239 color: var(--trait-link-color);
242 .content span.associatedtype, .content a.associatedtype,
243 .content span.constant, .content a.constant,
244 .content span.static, .content a.static {
245 color: var(--assoc-item-link-color);
248 .content span.fn, .content a.fn,
250 .content span.method, .content a.method,
251 .content span.tymethod, .content a.tymethod {
252 color: var(--function-link-color);
255 .content span.attr, .content a.attr,
256 .content span.derive, .content a.derive,
257 .content span.macro, .content a.macro {
258 color: var(--macro-link-color);
261 .content span.mod, .content a.mod {
262 color: var(--mod-link-color);
265 .content span.keyword, .content a.keyword {
266 color: var(--keyword-link-color);
270 color: var(--link-color);
276 ul ul, ol ul, ul ol, ol ol {
277 margin-bottom: .625em;
281 /* Paragraph spacing at least 1.5 times line spacing per Web Content Accessibility Guidelines.
282 Line-height is 1.5rem, so line spacing is .5rem; .75em is 1.5 times that.
283 https://www.w3.org/WAI/WCAG21/Understanding/visual-presentation.html */
286 /* For the last child of a div, the margin will be taken care of
287 by the margin-top of the next item. */
292 /* Fix some style changes due to normalize.css 8 */
295 /* Buttons on Safari have different default padding than other platforms. Make them the same. */
299 button#toggle-all-docs {
304 /* iOS button gradient: https://stackoverflow.com/q/5438567 */
305 -webkit-appearance: none;
309 /* end tweaks for normalize.css 8 */
320 padding: 10px 15px 40px 45px;
333 .source .width-limiter {
337 details:not(.rustdoc-toggle) summary {
341 code, pre, a.test-arrow, .code-header {
342 font-family: "Source Code Pro", monospace;
344 .docblock code, .docblock-short code {
348 .docblock pre code, .docblock-short pre code {
358 .source .content pre {
370 .sub-logo-container {
374 .sub-logo-container > img {
380 .sidebar, .mobile-topbar, .sidebar-menu-toggle {
381 background-color: var(--sidebar-background-color);
395 .rustdoc.source .sidebar {
402 border-right: 1px solid;
404 /* The sidebar is by default hidden */
408 .source .sidebar, #sidebar-toggle, #source-sidebar {
409 background-color: var(--sidebar-background-color);
412 #sidebar-toggle > button:hover, #sidebar-toggle > button:focus {
413 background-color: var(--sidebar-background-color-hover);
416 .source .sidebar > *:not(#sidebar-toggle) {
420 .source-sidebar-expanded .source .sidebar {
425 .source-sidebar-expanded .source .sidebar > *:not(#sidebar-toggle) {
433 /* Improve the scrollbar display on firefox */
435 scrollbar-width: initial;
436 scrollbar-color: var(--scrollbar-color);
439 scrollbar-width: thin;
440 scrollbar-color: var(--scrollbar-color);
443 /* Improve the scrollbar display on webkit-based browsers */
444 ::-webkit-scrollbar {
447 .sidebar::-webkit-scrollbar {
450 ::-webkit-scrollbar-track {
451 -webkit-box-shadow: inset 0;
452 background-color: var(--scrollbar-track-background-color);
454 .sidebar::-webkit-scrollbar-track {
455 background-color: var(--scrollbar-track-background-color);
457 ::-webkit-scrollbar-thumb, .sidebar::-webkit-scrollbar-thumb {
458 background-color: var(--scrollbar-thumb-background-color);
461 /* Everything else */
464 display: none !important;
467 .sidebar .logo-container {
471 justify-content: center;
475 overflow-wrap: break-word;
478 .logo-container > img {
483 ul.block, .block li {
494 margin-left: -0.25rem;
496 text-overflow: ellipsis;
501 overflow-wrap: anywhere;
507 font-size: 1.125rem; /* 18px */
517 .sidebar a, .sidebar .current {
518 color: var(--sidebar-link-color);
522 background-color: var(--sidebar-current-link-background-color);
525 .sidebar-elems .block {
529 .sidebar-elems .block li a {
537 .source .content pre.rust {
542 .rustdoc .example-wrap {
547 /* For the last child of a div, the margin will be taken care of
548 by the margin-top of the next item. */
549 .rustdoc .example-wrap:last-child {
553 .rustdoc .example-wrap > pre {
559 .rustdoc .example-wrap > pre.example-line-numbers,
560 .rustdoc .example-wrap > pre.src-line-numbers {
564 -webkit-user-select: none;
565 -moz-user-select: none;
566 -ms-user-select: none;
570 .example-line-numbers {
573 border-top-left-radius: 5px;
574 border-bottom-left-radius: 5px;
575 border-color: var(--example-line-numbers-border-color);
578 .src-line-numbers span {
580 color: var(--src-line-numbers-span-color);
582 .src-line-numbers .line-highlighted {
583 background-color: var(--src-line-number-highlighted-background-color);
585 .src-line-numbers :target {
586 background-color: transparent;
594 overflow-wrap: break-word;
595 overflow-wrap: anywhere;
597 text-overflow: ellipsis;
599 /* Wrap non-pre code blocks (`text`) but not (```text```). */
600 .docblock > :not(pre) > code,
601 .docblock-short > code {
602 white-space: pre-wrap;
605 .top-doc .docblock h2 { font-size: 1.375rem; }
606 .top-doc .docblock h3 { font-size: 1.25rem; }
607 .top-doc .docblock h4,
608 .top-doc .docblock h5 {
611 .top-doc .docblock h6 {
615 .docblock h5 { font-size: 1rem; }
616 .docblock h6 { font-size: 0.875rem; }
623 .docblock > :not(.more-examples-toggle):not(.example-wrap) {
633 .docblock code, .docblock-short code,
634 pre, .rustdoc.source .example-wrap {
635 background-color: var(--code-block-background-color);
644 width: calc(100% - 2px);
647 border-collapse: collapse;
652 border: 1px dashed var(--border-color);
659 border: 1px solid var(--border-color);
662 /* Shift "where ..." part of method or fn definition down a line */
679 #main-content > .item-info {
686 flex-flow: row nowrap;
687 margin: 4px 0 25px 0;
700 .source .search-form {
705 text-decoration: none;
708 .small-section-header {
710 justify-content: space-between;
714 .small-section-header:hover > .anchor {
718 .impl:hover > .anchor, .trait-impl:hover > .anchor {
719 display: inline-block;
726 background: none !important;
731 .small-section-header > .anchor {
735 h2.small-section-header > .anchor {
742 .main-heading a:hover,
743 .example-wrap > pre.rust a:hover,
745 .docblock a:not(.test-arrow):not(.scrape-help):hover,
746 .docblock-short a:not(.test-arrow):not(.scrape-help):hover,
748 text-decoration: underline;
751 .crate.block a.current { font-weight: 500; }
753 /* In most contexts we use `overflow-wrap: anywhere` to ensure that we can wrap
754 as much as needed on mobile (see
755 src/test/rustdoc-gui/type-declaration-overflow.goml for an example of why
756 this matters). The `anywhere` value means:
758 "Soft wrap opportunities introduced by the word break are considered when
759 calculating min-content intrinsic sizes."
761 https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-wrap#values
763 For table layouts, that becomes a problem: the browser tries to make each
764 column as narrow as possible, and `overflow-wrap: anywhere` means it can do
765 so by breaking words - even if some other column could be shrunk without
766 breaking words! This shows up, for instance, in the `Structs` / `Modules` /
767 `Functions` (etcetera) sections of a module page, and when a docblock
770 So, for table layouts, override the default with break-word, which does
771 _not_ affect min-content intrinsic sizes.
775 overflow-wrap: break-word;
784 .item-left, .item-right {
788 padding-right: 1.25rem;
791 .search-results-title {
794 /* flex layout allows shrinking the <select> appropriately if it becomes too large */
795 display: inline-flex;
797 /* make things look like in a line, despite the fact that we're using a layout
798 with boxes (i.e. from the flex layout) */
799 align-items: baseline;
802 display: inline-block;
803 /* ensures that 100% in properties of #crate-search-div:after
804 are relative to the size of this div */
806 /* allows this div (and with it the <select>-element "#crate-search") to be shrunk */
811 /* keep these two in sync with "@-moz-document url-prefix()" below */
812 padding: 0 23px 0 4px;
813 /* prevents the <select> from overflowing the containing div in case it's shrunk */
815 /* contents can overflow because of max-width limit, then show ellipsis */
816 text-overflow: ellipsis;
817 border: 1px solid var(--border-color);
821 -moz-appearance: none;
822 -webkit-appearance: none;
823 /* Removes default arrow from firefox */
825 background-color: var(--main-background-color);
830 /* cancel stylistic differences in padding in firefox
831 for "appearance: none"-style (or equivalent) <select>s */
832 @-moz-document url-prefix() {
834 padding-left: 0px; /* == 4px - 4px */
835 padding-right: 19px; /* == 23px - 4px */
838 /* pseudo-element for holding the dropdown-arrow image; needs to be a separate thing
839 so that we can apply CSS-filters to change the arrow color in themes */
840 #crate-search-div::after {
841 /* lets clicks through! */
842 pointer-events: none;
843 /* completely covers the underlying div */
850 background-repeat: no-repeat;
851 background-size: 20px;
852 background-position: calc(100% - 2px) 56%;
853 /* image is black color, themes should apply a "filter" property to change the color */
854 background-image: /* AUTOREPLACE: */url("down-arrow.svg");
856 #crate-search > option {
860 /* Override Normalize.css: it has a rule that sets
861 -webkit-appearance: textfield for search inputs. That
862 causes rounded corners and no border on iOS Safari. */
863 -webkit-appearance: none;
865 border: 1px solid var(--border-color);
870 background-color: var(--button-background-color);
871 color: var(--search-color);
873 .search-input:focus {
874 border-color: var(--search-input-focused-border-color);
881 .search-results.active {
883 /* prevent overhanging tabs from moving the first result */
887 .search-results .desc > span {
889 text-overflow: ellipsis;
894 .search-results > a {
896 /* A little margin ensures the browser's outlining of focused links has room to display. */
899 border-bottom: 1px solid #aaa3;
902 .search-results > a > div {
907 .search-results .result-name, .search-results div.desc {
910 .search-results .result-name {
914 .search-results a:hover,
915 .search-results a:focus {
916 background-color: var(--search-result-link-focus-background-color);
927 border: 1px solid var(--border-color);
931 /* This rule is to draw the little arrow connecting the settings menu to the gear icon. */
936 border: solid var(--border-color);
937 border-width: 1px 1px 0 0;
938 display: inline-block;
940 transform: rotate(-45deg);
944 .popover, .popover::before {
945 background-color: var(--main-background-color);
946 color: var(--main-color);
949 /* use larger max-width for help popover, but not for help.html */
954 #help.popover::before {
962 margin-right: 0.5rem;
964 #help span.top, #help span.bottom {
971 border-bottom: 1px solid var(--border-color);
977 border-top: 1px solid var(--border-color);
979 .side-by-side > div {
982 padding: 0 20px 20px 17px;
987 /* This min-height is needed to unify the height of the stab elements because some of them
993 white-space: pre-wrap;
1000 color: var(--main-color);
1001 background-color: var(--stab-background-color);
1004 .stab.portability > code {
1006 color: var(--stab-code-color);
1011 margin-right: 0.3rem;
1014 /* This is to prevent the `.stab` elements to overflow the .docblock elements. */
1020 /* Black one-pixel outline around emoji shapes */
1030 .import-item .stab {
1032 display: inline-block;
1033 font-size: 0.875rem;
1036 margin-left: 0.3125em;
1038 vertical-align: text-bottom;
1041 .module-item.unstable,
1042 .import-item.unstable {
1047 font-weight: normal;
1059 color: var(--right-side-color);
1067 /* Code highlighting */
1069 color: var(--code-highlight-kw-color);
1072 color: var(--code-highlight-kw-2-color);
1074 pre.rust .lifetime {
1075 color: var(--code-highlight-lifetime-color);
1077 pre.rust .prelude-ty {
1078 color: var(--code-highlight-prelude-color);
1080 pre.rust .prelude-val {
1081 color: var(--code-highlight-prelude-val-color);
1084 color: var(--code-highlight-string-color);
1087 color: var(--code-highlight-number-color);
1089 pre.rust .bool-val {
1090 color: var(--code-highlight-literal-color);
1093 color: var(--code-highlight-self-color);
1095 pre.rust .attribute {
1096 color: var(--code-highlight-attribute-color);
1099 pre.rust .macro-nonterminal {
1100 color: var(--code-highlight-macro-color);
1102 pre.rust .question-mark {
1104 color: var(--code-highlight-question-mark-color);
1107 color: var(--code-highlight-comment-color);
1109 pre.rust .doccomment {
1110 color: var(--code-highlight-doc-comment-color);
1113 .example-wrap.compile_fail,
1114 .example-wrap.should_panic {
1115 border-left: 2px solid var(--codeblock-error-color);
1118 .ignore.example-wrap {
1119 border-left: 2px solid var(--codeblock-ignore-color);
1122 .example-wrap.compile_fail:hover,
1123 .example-wrap.should_panic:hover {
1124 border-left: 2px solid var(--codeblock-error-hover-color);
1127 .example-wrap.ignore:hover {
1128 border-left: 2px solid var(--codeblock-ignore-hover-color);
1131 .example-wrap.compile_fail .tooltip,
1132 .example-wrap.should_panic .tooltip {
1133 color: var(--codeblock-error-color);
1136 .example-wrap.ignore .tooltip {
1137 color: var(--codeblock-ignore-color);
1140 .example-wrap.compile_fail:hover .tooltip,
1141 .example-wrap.should_panic:hover .tooltip {
1142 color: var(--codeblock-error-hover-color);
1145 .example-wrap.ignore:hover .tooltip {
1146 color: var(--codeblock-ignore-hover-color);
1149 .example-wrap .tooltip {
1157 .example-wrap .tooltip::after {
1160 padding: 5px 3px 3px 3px;
1164 border: 1px solid var(--border-color);
1171 .example-wrap .tooltip::before {
1178 border-style: solid;
1183 .example-wrap.ignore .tooltip::after {
1184 content: "This example is not tested";
1186 .example-wrap.compile_fail .tooltip::after {
1187 content: "This example deliberately fails to compile";
1189 .example-wrap.should_panic .tooltip::after {
1190 content: "This example panics";
1192 .example-wrap.edition .tooltip::after {
1193 content: "This code runs with edition " attr(data-edition);
1196 .example-wrap .tooltip:hover::before, .example-wrap .tooltip:hover::after {
1200 .example-wrap.compile_fail .tooltip,
1201 .example-wrap.should_panic .tooltip,
1202 .example-wrap.ignore .tooltip {
1208 display: inline-block;
1211 padding: 5px 10px 5px 10px;
1213 font-size: 1.375rem;
1218 .example-wrap:hover .test-arrow {
1219 visibility: visible;
1224 color: var(--code-attribute-color);
1232 .out-of-band > span.since {
1238 font-size: 1.125rem;
1239 margin-bottom: 10px;
1251 margin-bottom: 40px;
1254 .sub-variant > .sub-variant-field {
1258 :target > code, :target > .code-header {
1266 .notable-traits-tooltip {
1267 display: inline-block;
1271 .notable-traits:hover .notable-traits-tooltiptext,
1272 .notable-traits .notable-traits-tooltiptext.force-tooltip {
1273 display: inline-block;
1276 .notable-traits .notable-traits-tooltiptext {
1278 padding: 5px 3px 3px 3px;
1288 .notable-traits-tooltip::after {
1289 /* The margin on the tooltip does not capture hover events,
1290 this extends the area of hover enough so that mouse hover is not
1291 lost when moving the mouse to the tooltip */
1292 content: "\00a0\00a0\00a0";
1295 .notable-traits .docblock {
1299 .notable-traits .notable {
1301 margin-bottom: 13px;
1302 font-size: 1.1875rem;
1307 .notable-traits .docblock code.content {
1319 .search-failed.active {
1323 .search-failed > ul {
1332 flex-direction: row;
1339 font-size: 1.125rem;
1342 border-top: 2px solid;
1348 #titles > button > div.count {
1349 display: inline-block;
1364 border-bottom: 1px solid;
1367 justify-content: center;
1368 align-items: center;
1375 #source-sidebar > .title {
1378 border-bottom: 1px solid var(--border-color);
1381 #sidebar-toggle > button {
1395 /* work around button layout strangeness: https://stackoverflow.com/q/7271561 */
1397 /* iOS button gradient: https://stackoverflow.com/q/5438567 */
1398 -webkit-appearance: none;
1401 #settings-menu, #help-button {
1406 #settings-menu > a, #help-button > a, #copy-path {
1412 #settings-menu > a, #help-button > a {
1416 background-color: var(--button-background-color);
1417 border: 1px solid var(--border-color);
1422 color: var(--copy-path-button-color);
1423 background: var(--main-background-color);
1431 filter: var(--copy-path-img-filter);
1433 #copy-path:hover > img {
1434 filter: var(--copy-path-img-hover-filter);
1437 @keyframes rotating {
1439 transform: rotate(0deg);
1442 transform: rotate(360deg);
1445 #settings-menu.rotate > a img {
1446 animation: rotating 2s linear infinite;
1451 /* Rare exception to specifying font sizes in rem. Since this is acting
1452 as an icon, it's okay to specify their sizes in pixels. */
1458 display: inline-block;
1460 font: 15px monospace;
1462 vertical-align: middle;
1463 border: solid 1px var(--border-color);
1476 details.dir-entry > summary::after {
1483 /* set width to cover gap between arrow and text */
1487 details[open].dir-entry > summary::after {
1491 details.dir-entry > summary::-webkit-details-marker,
1492 details.dir-entry > summary::marker {
1496 details.dir-entry > summary {
1503 details.dir-entry div.folders, details.dir-entry div.files {
1507 details.dir-entry a {
1511 /* We use CSS containment on the details elements because most sizeable elements
1512 of the page are contained in one of these. This also makes re-rendering
1513 faster on document changes (like closing and opening toggles).
1514 Unfortunately we can't yet specify contain: content or contain: strict
1515 because the [-]/[+] toggles extend past the boundaries of the <details>
1516 https://developer.mozilla.org/en-US/docs/Web/CSS/contain */
1517 details.rustdoc-toggle {
1522 /* The hideme class is used on summary tags that contain a span with
1523 placeholder text shown only when the toggle is closed. For instance,
1524 "Expand description" or "Show methods". */
1525 details.rustdoc-toggle > summary.hideme {
1529 details.rustdoc-toggle > summary {
1531 /* focus outline is shown on `::before` instead of this */
1534 details.rustdoc-toggle > summary::-webkit-details-marker,
1535 details.rustdoc-toggle > summary::marker {
1539 details.rustdoc-toggle > summary.hideme > span {
1543 details.rustdoc-toggle > summary::before {
1548 background-repeat: no-repeat;
1549 background-position: top left;
1550 display: inline-block;
1551 vertical-align: middle;
1555 details.rustdoc-toggle > summary.hideme > span,
1556 .more-examples-toggle summary, .more-examples-toggle .hide-more {
1557 color: var(--toggles-color);
1560 /* Screen readers see the text version at the end the line.
1561 Visual readers see the icon at the start of the line, but small and transparent. */
1562 details.rustdoc-toggle > summary::after {
1570 details.rustdoc-toggle > summary.hideme::after {
1571 /* "hideme" toggles already have a description when they're contracted */
1575 details.rustdoc-toggle > summary:focus::before,
1576 details.rustdoc-toggle > summary:hover::before {
1580 details.rustdoc-toggle > summary:focus-visible::before {
1581 /* The SVG is black, and gets turned white using a filter in the dark themes.
1582 Do the same with the outline.
1583 The dotted 1px style is copied from Firefox's focus ring style.
1585 outline: 1px dotted #000;
1586 outline-offset: 1px;
1589 details.rustdoc-toggle.top-doc > summary,
1590 details.rustdoc-toggle.top-doc > summary::before,
1591 details.rustdoc-toggle.non-exhaustive > summary,
1592 details.rustdoc-toggle.non-exhaustive > summary::before {
1596 details.non-exhaustive {
1600 details.rustdoc-toggle > summary.hideme::before {
1604 details.rustdoc-toggle > summary:not(.hideme)::before {
1610 .impl-items > details.rustdoc-toggle > summary:not(.hideme)::before {
1615 /* When a "hideme" summary is open and the "Expand description" or "Show
1616 methods" text is hidden, we want the [-] toggle that remains to not
1617 affect the layout of the items to its right. To do that, we use
1618 absolute positioning. Note that we also set position: relative
1619 on the parent <details> to make this work properly. */
1620 details.rustdoc-toggle[open] > summary.hideme {
1624 details.rustdoc-toggle[open] > summary.hideme > span {
1628 details.rustdoc-toggle[open] > summary::before,
1629 details.rustdoc-toggle[open] > summary.hideme::before {
1630 background-image: /* AUTOREPLACE: */url("toggle-minus.svg");
1633 details.rustdoc-toggle > summary::before {
1634 background-image: /* AUTOREPLACE: */url("toggle-plus.svg");
1637 details.rustdoc-toggle[open] > summary::before,
1638 details.rustdoc-toggle[open] > summary.hideme::before {
1641 background-repeat: no-repeat;
1642 background-position: top left;
1643 display: inline-block;
1647 details.rustdoc-toggle[open] > summary::after,
1648 details.rustdoc-toggle[open] > summary.hideme::after {
1649 content: "Collapse";
1652 /* This is needed in docblocks to have the "â–¶" element to be on the same line. */
1653 .docblock summary > * {
1654 display: inline-block;
1657 /* In case there is no documentation before a code block, we need to add some margin at the top
1658 to prevent an overlay between the "collapse toggle" and the information tooltip.
1659 However, it's not needed with smaller screen width because the doc/code block is always put
1660 "one line" below. */
1661 .docblock > .example-wrap:first-child .tooltip {
1668 WARNING: RUSTDOC_MOBILE_BREAKPOINT MEDIA QUERY
1669 If you update this line, then you also need to update the line with the same warning
1672 @media (max-width: 700px) {
1673 /* When linking to an item with an `id` (for instance, by clicking a link in the sidebar,
1674 or visiting a URL with a fragment like `#method.new`, we don't want the item to be obscured
1675 by the topbar. Anything with an `id` gets scroll-margin-top equal to .mobile-topbar's size.
1678 scroll-margin-top: 45px;
1683 /* Sidebar should overlay main content, rather than pushing main content to the right.
1684 Turn off `display: flex` on the body element. */
1694 flex-direction: column;
1699 margin-left: initial;
1703 .out-of-band .since::before {
1711 /* Hide the logo and item name from the sidebar. Those are displayed
1712 in the mobile-topbar instead. */
1713 .sidebar .sidebar-logo,
1714 .sidebar .location {
1721 /* Hide the sidebar offscreen while not in use. Doing this instead of display: none means
1722 the sidebar stays visible for screen readers, which is useful for navigation. */
1727 /* Reduce height slightly to account for mobile topbar. */
1728 height: calc(100vh - 45px);
1731 /* The source view uses a different design for the sidebar toggle, and doesn't have a topbar,
1732 so don't bump down the main content or the sidebar. */
1734 .rustdoc.source .sidebar {
1742 .source-sidebar-expanded .source .sidebar,
1743 .sidebar:focus-within {
1747 .rustdoc.source > .sidebar {
1753 margin: auto 0.5em auto auto;
1755 /* Rare exception to specifying font sizes in rem. Since the topbar
1756 height is specified in pixels, this also has to be specified in
1757 pixels to avoid overflowing the topbar when the user sets a bigger
1762 .mobile-topbar h2 a {
1764 text-overflow: ellipsis;
1766 white-space: nowrap;
1769 .mobile-topbar .logo-container {
1773 .mobile-topbar .logo-container > img {
1776 margin: 5px 0 5px 20px;
1781 flex-direction: row;
1791 .sidebar-menu-toggle {
1793 /* Rare exception to specifying font sizes in rem. Since this is acting
1794 as an icon, it's okay to specify its sizes in pixels. */
1797 color: var(--main-color);
1802 background-color: var(--sidebar-background-color);
1810 display: none !important;
1813 #titles > button > div.count {
1817 /* Because of ios, we need to actually have a full height sidebar title so the
1818 * actual sidebar can show up. But then we need to make it transparent so we don't
1819 * hide content. The filler just allows to create the background for the sidebar
1820 * title. But because of the absolute position, I had to lower the z-index.
1825 width: calc(100% - 45px);
1829 border-bottom: 1px solid;
1832 #main-content > details.rustdoc-toggle > summary::before,
1833 #main-content > div > details.rustdoc-toggle > summary::before {
1846 border-top-right-radius: 3px;
1847 border-bottom-right-radius: 3px;
1853 .source-sidebar-expanded #sidebar-toggle {
1857 border-top-right-radius: unset;
1858 border-bottom-right-radius: unset;
1861 border-bottom: 1px solid;
1864 .notable-traits .notable-traits-tooltiptext {
1869 /* We don't display the help button on mobile devices. */
1874 /* Display an alternating layout on tablets and phones */
1880 flex-flow: column wrap;
1882 .item-left, .item-right {
1886 /* Display an alternating layout on tablets and phones */
1887 .search-results > a {
1888 border-bottom: 1px solid #aaa9;
1891 .search-results .result-name, .search-results div.desc {
1894 .search-results div.desc, .item-right {
1898 .source-sidebar-expanded .source .sidebar {
1903 /* Position of the "[-]" element. */
1904 details.rustdoc-toggle:not(.top-doc) > summary {
1907 .impl-items > details.rustdoc-toggle > summary:not(.hideme)::before,
1908 #main-content > details.rustdoc-toggle:not(.top-doc) > summary::before,
1909 #main-content > div > details.rustdoc-toggle > summary::before {
1913 /* Align summary-nested and unnested item-info gizmos. */
1914 .impl-items > .item-info {
1925 nav.sidebar, nav.sub, .out-of-band, a.srclink, #copy-path,
1926 details.rustdoc-toggle[open] > summary::before, details.rustdoc-toggle > summary::before,
1927 details.rustdoc-toggle.top-doc > summary {
1940 @media (max-width: 464px) {
1946 overflow-wrap: break-word;
1947 overflow-wrap: anywhere;
1951 flex-direction: column;
1955 align-self: stretch;
1958 .sub-logo-container > img {
1966 .source-sidebar-expanded #sidebar-toggle {
1971 .implementors-toggle > summary,
1973 #implementors-list > .docblock,
1974 .impl-items > section,
1975 .impl-items > .rustdoc-toggle > summary,
1977 .methods > .rustdoc-toggle > summary
1979 margin-bottom: 0.75em;
1982 .impl-items > .rustdoc-toggle[open]:not(:last-child),
1983 .methods > .rustdoc-toggle[open]:not(:last-child),
1984 .implementors-toggle[open]:not(:last-child) {
1988 #trait-implementations-list .impl-items > .rustdoc-toggle:not(:last-child),
1989 #synthetic-implementations-list .impl-items > .rustdoc-toggle:not(:last-child),
1990 #blanket-implementations-list .impl-items > .rustdoc-toggle:not(:last-child) {
1994 /* Begin: styles for --scrape-examples feature */
1996 .scraped-example-list .scrape-help {
1999 font-weight: normal;
2003 background: transparent;
2005 border-style: solid;
2006 border-radius: 50px;
2009 .scraped-example .code-wrapper {
2012 flex-direction: row;
2017 .scraped-example:not(.expanded) .code-wrapper {
2021 .scraped-example:not(.expanded) .code-wrapper pre {
2027 .scraped-example .code-wrapper .next,
2028 .scraped-example .code-wrapper .prev,
2029 .scraped-example .code-wrapper .expand {
2035 .scraped-example .code-wrapper .prev {
2038 .scraped-example .code-wrapper .next {
2041 .scraped-example .code-wrapper .expand {
2045 .scraped-example:not(.expanded) .code-wrapper:before,
2046 .scraped-example:not(.expanded) .code-wrapper:after {
2053 .scraped-example:not(.expanded) .code-wrapper:before {
2056 .scraped-example:not(.expanded) .code-wrapper:after {
2060 .scraped-example .code-wrapper .src-line-numbers {
2065 .scraped-example .code-wrapper .src-line-numbers span {
2069 .scraped-example .code-wrapper .example-wrap {
2076 .scraped-example:not(.expanded) .code-wrapper .example-wrap {
2080 .scraped-example .code-wrapper .example-wrap pre.rust {
2081 overflow-x: inherit;
2087 .more-examples-toggle {
2088 max-width: calc(100% + 25px);
2093 .more-examples-toggle .hide-more {
2099 .more-scraped-examples {
2102 flex-direction: row;
2105 .more-scraped-examples-inner {
2106 /* 20px is width of toggle-line + toggle-line-inner */
2107 width: calc(100% - 20px);
2111 align-self: stretch;
2118 .toggle-line-inner {
2123 .more-scraped-examples .scraped-example {
2124 margin-bottom: 20px;
2127 .more-scraped-examples .scraped-example:last-child {
2139 /* End: styles for --scrape-examples feature */