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;
148 justify-content: space-between;
152 .main-heading a:hover {
153 text-decoration: underline;
156 text-decoration: none;
158 /* The only headings that get underlines are:
159 Markdown-generated headings within the top-doc
160 Rustdoc-generated h2 section headings (e.g. "Implementations", "Required Methods", etc)
161 Underlines elsewhere in the documentation break up visual flow and tend to invert
162 section hierarchies. */
164 .top-doc .docblock > h3,
165 .top-doc .docblock > h4 {
166 border-bottom: 1px solid var(--headings-border-bottom-color);
169 font-size: 1.125rem; /* 18px */
176 border-bottom-style: none;
185 .impl-items .associatedconstant,
186 .methods .associatedconstant,
187 .impl-items .associatedtype,
188 .methods .associatedtype {
194 h1, h2, h3, h4, h5, h6,
199 .search-results .result-name,
203 details.rustdoc-toggle > summary::before,
205 #help-button > button,
206 details.rustdoc-toggle.top-doc > summary,
207 details.rustdoc-toggle.top-doc > summary::before,
208 details.rustdoc-toggle.non-exhaustive > summary,
209 details.rustdoc-toggle.non-exhaustive > summary::before,
210 .scraped-example-title,
211 .more-examples-toggle summary, .more-examples-toggle .hide-more,
213 /* This selector is for the items listed in the "all items" page. */
215 font-family: "Fira Sans", Arial, NanumBarunGothic, sans-serif;
220 .small-section-header a,
230 .result-name .primitive > i, .result-name .keyword > i,
231 .content .method .where,
233 .content .where.fmt-newline {
234 color: var(--main-color);
237 .content span.enum, .content a.enum,
238 .content span.struct, .content a.struct,
239 .content span.union, .content a.union,
240 .content span.primitive, .content a.primitive,
241 .content span.type, .content a.type,
242 .content span.foreigntype, .content a.foreigntype {
243 color: var(--type-link-color);
246 .content span.trait, .content a.trait,
247 .content span.traitalias, .content a.traitalias {
248 color: var(--trait-link-color);
251 .content span.associatedtype, .content a.associatedtype,
252 .content span.constant, .content a.constant,
253 .content span.static, .content a.static {
254 color: var(--assoc-item-link-color);
257 .content span.fn, .content a.fn,
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 */
316 /* Buttons on Safari have different default padding than other platforms. Make them the same. */
320 /* end tweaks for normalize.css 8 */
331 padding: 10px 15px 40px 45px;
344 .source .width-limiter {
348 details:not(.rustdoc-toggle) summary {
352 code, pre, a.test-arrow, .code-header {
353 font-family: "Source Code Pro", monospace;
355 .docblock code, .docblock-short code {
359 .docblock pre code, .docblock-short pre code {
369 .source .content pre {
387 .sub-logo-container {
392 .source .sub-logo-container {
396 .source .sub-logo-container > img {
402 .sidebar, .mobile-topbar, .sidebar-menu-toggle {
403 background-color: var(--sidebar-background-color);
418 .sidebar > .location {
423 overflow-wrap: anywhere;
426 .rustdoc.source .sidebar {
433 border-right: 1px solid;
435 /* The sidebar is by default hidden */
439 .rustdoc.source .sidebar .sidebar-logo {
443 .source .sidebar, #sidebar-toggle, #source-sidebar {
444 background-color: var(--sidebar-background-color);
447 #sidebar-toggle > button:hover, #sidebar-toggle > button:focus {
448 background-color: var(--sidebar-background-color-hover);
451 .source .sidebar > *:not(#sidebar-toggle) {
456 .source-sidebar-expanded .source .sidebar {
460 .source-sidebar-expanded .source .sidebar > *:not(#sidebar-toggle) {
469 /* Improve the scrollbar display on firefox */
471 scrollbar-width: initial;
472 scrollbar-color: var(--scrollbar-color);
475 scrollbar-width: thin;
476 scrollbar-color: var(--scrollbar-color);
479 /* Improve the scrollbar display on webkit-based browsers */
480 ::-webkit-scrollbar {
483 .sidebar::-webkit-scrollbar {
486 ::-webkit-scrollbar-track {
487 -webkit-box-shadow: inset 0;
488 background-color: var(--scrollbar-track-background-color);
490 .sidebar::-webkit-scrollbar-track {
491 background-color: var(--scrollbar-track-background-color);
493 ::-webkit-scrollbar-thumb, .sidebar::-webkit-scrollbar-thumb {
494 background-color: var(--scrollbar-thumb-background-color);
497 /* Everything else */
500 display: none !important;
503 .sidebar .logo-container {
507 justify-content: center;
511 overflow-wrap: break-word;
514 .logo-container > img {
519 .block ul, .block li {
529 margin-left: -0.25rem;
531 text-overflow: ellipsis;
541 margin-bottom: 0.7rem;
545 font-size: 1.125rem; /* 18px */
551 .sidebar-elems .block {
555 .sidebar-elems .block li a {
563 .source .content pre.rust {
569 .rustdoc .example-wrap {
573 .rustdoc .example-wrap {
576 /* For the last child of a div, the margin will be taken care of
577 by the margin-top of the next item. */
578 .rustdoc .example-wrap:last-child {
582 pre.example-line-numbers {
587 border-top-left-radius: 5px;
588 border-bottom-left-radius: 5px;
591 .example-wrap > pre.rust a:hover {
592 text-decoration: underline;
598 .rustdoc:not(.source) .example-wrap > pre:not(.example-line-numbers) {
603 .rustdoc:not(.source) .example-wrap > pre.src-line-numbers {
608 .rustdoc .example-wrap > pre {
616 .content > .example-wrap pre.src-line-numbers {
618 -webkit-user-select: none;
619 -moz-user-select: none;
620 -ms-user-select: none;
623 .src-line-numbers span {
628 overflow-wrap: break-word;
629 overflow-wrap: anywhere;
631 text-overflow: ellipsis;
633 /* Wrap non-pre code blocks (`text`) but not (```text```). */
634 .docblock > :not(pre) > code,
635 .docblock-short > code {
636 white-space: pre-wrap;
639 .top-doc .docblock h2 { font-size: 1.375rem; }
640 .top-doc .docblock h3 { font-size: 1.25rem; }
641 .top-doc .docblock h4,
642 .top-doc .docblock h5 {
645 .top-doc .docblock h6 {
649 .docblock h5 { font-size: 1rem; }
650 .docblock h6 { font-size: 0.875rem; }
657 .docblock > :not(.more-examples-toggle):not(.example-wrap) {
668 .method > .code-header, .trait-impl > .code-header {
676 /* We use overflow-wrap: break-word for Safari, which doesn't recognize
677 `anywhere`: https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-wrap */
678 overflow-wrap: break-word;
679 /* Then override it with `anywhere`, which is required to make non-Safari browsers break
680 more aggressively when we want them to. */
681 overflow-wrap: anywhere;
682 background-color: var(--main-background-color);
685 .docblock code, .docblock-short code,
686 pre, .rustdoc.source .example-wrap {
687 background-color: var(--code-block-background-color);
696 width: calc(100% - 2px);
699 border-collapse: collapse;
704 border: 1px dashed var(--border-color);
711 border: 1px solid var(--border-color);
714 .content .item-list {
715 list-style-type: none;
719 /* Shift "where ..." part of method or fn definition down a line */
720 .content .method .where,
722 .content .where.fmt-newline {
731 .content .item-info code {
735 .content .item-info {
739 #main-content > .item-info {
753 nav.sum { text-align: right; }
754 nav.sub form { display: inline; }
757 text-decoration: none;
760 .small-section-header {
762 justify-content: space-between;
766 .small-section-header:hover > .anchor {
770 .in-band:hover > .anchor, .impl:hover > .anchor, .method.trait-impl:hover > .anchor,
771 .type.trait-impl:hover > .anchor, .associatedconstant.trait-impl:hover > .anchor,
772 .associatedtype.trait-impl:hover > .anchor {
773 display: inline-block;
780 background: none !important;
785 .small-section-header > .anchor {
789 h2.small-section-header > .anchor {
797 .docblock a:not(.srclink):not(.test-arrow):not(.scrape-help):hover,
798 .docblock-short a:not(.srclink):not(.test-arrow):not(.scrape-help):hover, .item-info a {
799 text-decoration: underline;
802 .block a.current.crate { font-weight: 500; }
804 /* In most contexts we use `overflow-wrap: anywhere` to ensure that we can wrap
805 as much as needed on mobile (see
806 src/test/rustdoc-gui/type-declaration-overflow.goml for an example of why
807 this matters). The `anywhere` value means:
809 "Soft wrap opportunities introduced by the word break are considered when
810 calculating min-content intrinsic sizes."
812 https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-wrap#values
814 For table layouts, that becomes a problem: the browser tries to make each
815 column as narrow as possible, and `overflow-wrap: anywhere` means it can do
816 so by breaking words - even if some other column could be shrunk without
817 breaking words! This shows up, for instance, in the `Structs` / `Modules` /
818 `Functions` (etcetera) sections of a module page, and when a docblock
821 So, for table layouts, override the default with break-word, which does
822 _not_ affect min-content intrinsic sizes.
826 overflow-wrap: break-word;
835 .item-left, .item-right {
839 padding-right: 1.25rem;
848 .search-container > * {
851 .search-results-title {
854 /* flex layout allows shrinking the <select> appropriately if it becomes too large */
855 display: inline-flex;
857 /* make things look like in a line, despite the fact that we're using a layout
858 with boxes (i.e. from the flex layout) */
859 align-items: baseline;
862 display: inline-block;
863 /* ensures that 100% in properties of #crate-search-div:after
864 are relative to the size of this div */
866 /* allows this div (and with it the <select>-element "#crate-search") to be shrunk */
872 /* keep these two in sync with "@-moz-document url-prefix()" below */
875 /* prevents the <select> from overflowing the containing div in case it's shrunk */
877 /* contents can overflow because of max-width limit, then show ellipsis */
878 text-overflow: ellipsis;
879 border: 1px solid var(--border-color);
883 -moz-appearance: none;
884 -webkit-appearance: none;
885 /* Removes default arrow from firefox */
887 background-color: var(--main-background-color);
889 /* cancel stylistic differences in padding in firefox
890 for "appearance: none"-style (or equivalent) <select>s */
891 @-moz-document url-prefix() {
893 padding-left: 0px; /* == 4px - 4px */
894 padding-right: 19px; /* == 23px - 4px */
897 /* pseudo-element for holding the dropdown-arrow image; needs to be a separate thing
898 so that we can apply CSS-filters to change the arrow color in themes */
899 #crate-search-div::after {
900 /* lets clicks through! */
901 pointer-events: none;
902 /* completely covers the underlying div */
909 background-repeat: no-repeat;
910 background-size: 20px;
911 background-position: calc(100% - 2px) 56%;
912 /* image is black color, themes should apply a "filter" property to change the color */
913 background-image: /* AUTOREPLACE: */url("down-arrow.svg");
915 #crate-search > option {
919 /* Override Normalize.css: it has a rule that sets
920 -webkit-appearance: textfield for search inputs. That
921 causes rounded corners and no border on iOS Safari. */
922 -webkit-appearance: none;
923 /* Override Normalize.css: we have margins and do
924 not want to overflow - the `moz` attribute is necessary
925 until Firefox 29, too early to drop at this point */
926 -moz-box-sizing: border-box !important;
927 box-sizing: border-box !important;
929 border: 1px solid var(--border-color);
934 background-color: var(--button-background-color);
936 .search-input:focus {
937 border-color: var(--search-input-focused-border-color);
945 .search-results.active {
947 /* prevent overhanging tabs from moving the first result */
951 .search-results .desc > span {
953 text-overflow: ellipsis;
958 .search-results > a {
960 /* A little margin ensures the browser's outlining of focused links has room to display. */
963 border-bottom: 1px solid #aaa3;
966 .search-results > a > div {
971 .search-results .result-name, .search-results div.desc, .search-results .result-description {
974 .search-results .result-name {
986 border: 1px solid var(--border-color);
990 /* This rule is to draw the little arrow connecting the settings menu to the gear icon. */
995 border: solid var(--border-color);
996 border-width: 1px 1px 0 0;
997 display: inline-block;
999 transform: rotate(-45deg);
1003 .popover, .popover::before {
1004 background-color: var(--main-background-color);
1005 color: var(--main-color);
1008 #help-button .popover {
1012 #help-button .popover::before {
1020 margin-right: 0.5rem;
1022 #help-button span.top, #help-button span.bottom {
1025 font-size: 1.125rem;
1027 #help-button span.top {
1029 border-bottom: 1px solid var(--border-color);
1030 padding-bottom: 4px;
1033 #help-button span.bottom {
1035 border-top: 1px solid var(--border-color);
1037 .side-by-side > div {
1040 padding: 0 20px 20px 17px;
1045 /* This min-height is needed to unify the height of the stab elements because some of them
1050 align-items: center;
1051 white-space: pre-wrap;
1056 font-size: 0.875rem;
1057 font-weight: normal;
1062 margin-right: 0.3rem;
1065 /* This is to prevent the `.stab` elements to overflow the .docblock elements. */
1071 /* Black one-pixel outline around emoji shapes */
1081 .import-item .stab {
1083 display: inline-block;
1084 font-size: 0.875rem;
1087 margin-left: 0.3125em;
1089 vertical-align: text-bottom;
1092 .module-item.unstable,
1093 .import-item.unstable {
1098 font-weight: normal;
1111 color: var(--right-side-color);
1114 pre.rust .question-mark {
1118 .example-wrap.compile_fail,
1119 .example-wrap.should_panic {
1120 border-left: 2px solid var(--codeblock-error-color);
1123 .ignore.example-wrap {
1124 border-left: 2px solid var(--codeblock-ignore-color);
1127 .example-wrap.compile_fail:hover,
1128 .example-wrap.should_panic:hover {
1129 border-left: 2px solid var(--codeblock-error-hover-color);
1132 .example-wrap.ignore:hover {
1133 border-left: 2px solid var(--codeblock-ignore-hover-color);
1136 .example-wrap.compile_fail .tooltip,
1137 .example-wrap.should_panic .tooltip {
1138 color: var(--codeblock-error-color);
1141 .example-wrap.ignore .tooltip {
1142 color: var(--codeblock-ignore-color);
1145 .example-wrap.compile_fail:hover .tooltip,
1146 .example-wrap.should_panic:hover .tooltip {
1147 color: var(--codeblock-error-hover-color);
1150 .example-wrap.ignore:hover .tooltip {
1151 color: var(--codeblock-ignore-hover-color);
1154 .example-wrap .tooltip {
1162 .example-wrap .tooltip::after {
1165 padding: 5px 3px 3px 3px;
1169 border: 1px solid var(--border-color);
1176 .example-wrap .tooltip::before {
1183 border-style: solid;
1188 .example-wrap.ignore .tooltip::after {
1189 content: "This example is not tested";
1191 .example-wrap.compile_fail .tooltip::after {
1192 content: "This example deliberately fails to compile";
1194 .example-wrap.should_panic .tooltip::after {
1195 content: "This example panics";
1197 .example-wrap.edition .tooltip::after {
1198 content: "This code runs with edition " attr(data-edition);
1201 .example-wrap .tooltip:hover::before, .example-wrap .tooltip:hover::after {
1205 .example-wrap.compile_fail .tooltip,
1206 .example-wrap.should_panic .tooltip,
1207 .example-wrap.ignore .tooltip {
1213 display: inline-block;
1216 padding: 5px 10px 5px 10px;
1218 font-size: 1.375rem;
1223 .example-wrap:hover .test-arrow {
1224 visibility: visible;
1226 a.test-arrow:hover {
1227 text-decoration: none;
1232 color: var(--code-attribute-color);
1240 .out-of-band > span.since {
1246 font-size: 1.125rem;
1247 margin-bottom: 10px;
1248 border-bottom: none;
1254 border-bottom: none;
1261 margin-bottom: 40px;
1264 .sub-variant > .sub-variant-field {
1268 :target > code, :target > .code-header {
1276 .notable-traits-tooltip {
1277 display: inline-block;
1281 .notable-traits:hover .notable-traits-tooltiptext,
1282 .notable-traits .notable-traits-tooltiptext.force-tooltip {
1283 display: inline-block;
1286 .notable-traits .notable-traits-tooltiptext {
1288 padding: 5px 3px 3px 3px;
1298 .notable-traits-tooltip::after {
1299 /* The margin on the tooltip does not capture hover events,
1300 this extends the area of hover enough so that mouse hover is not
1301 lost when moving the mouse to the tooltip */
1302 content: "\00a0\00a0\00a0";
1305 .notable-traits .notable, .notable-traits .docblock {
1309 .notable-traits .notable {
1311 margin-bottom: 13px;
1312 font-size: 1.1875rem;
1317 .notable-traits .docblock code.content {
1323 /* Example code has the "Run" button that needs to be positioned relative to the pre */
1324 pre.rust.rust-example-rendered {
1339 .search-failed.active {
1343 .search-failed > ul {
1352 flex-direction: row;
1359 font-size: 1.125rem;
1362 border-top: 2px solid;
1366 #titles > button > div.count {
1367 display: inline-block;
1383 border-bottom: 1px solid;
1386 justify-content: center;
1387 align-items: center;
1394 #source-sidebar > .title {
1397 border-bottom: 1px solid var(--border-color);
1400 #sidebar-toggle > button {
1412 /* work around button layout strangeness: https://stackoverflow.com/q/7271561 */
1414 /* iOS button gradient: https://stackoverflow.com/q/5438567 */
1415 -webkit-appearance: none;
1418 #settings-menu, #help-button {
1423 #settings-menu > a, #help-button > button, #copy-path {
1426 border: 1px solid var(--border-color);
1431 #settings-menu > a, #help-button > button {
1435 background-color: var(--button-background-color);
1439 color: var(--copy-path-button-color);
1442 filter: var(--copy-path-img-filter);
1444 #copy-path:hover > img {
1445 filter: var(--copy-path-img-hover-filter);
1448 @keyframes rotating {
1450 transform: rotate(0deg);
1453 transform: rotate(360deg);
1456 #settings-menu.rotate > a img {
1457 animation: rotating 2s linear infinite;
1460 .setting-line .radio-line input:checked {
1461 box-shadow: inset 0 0 0 3px var(--main-background-color);
1462 background-color: var(--settings-input-color);
1464 .setting-line .radio-line input:focus {
1465 box-shadow: 0 0 1px 1px var(--settings-input-color);
1467 /* In here we combine both `:focus` and `:checked` properties. */
1468 .setting-line .radio-line input:checked:focus {
1469 box-shadow: inset 0 0 0 3px var(--main-background-color),
1470 0 0 2px 2px var(--settings-input-color);
1472 .setting-line .radio-line input:hover {
1473 border-color: var(--settings-input-color) !important;
1475 input:checked + .slider {
1476 background-color: var(--settings-input-color);
1479 #help-button > button {
1481 /* Rare exception to specifying font sizes in rem. Since this is acting
1482 as an icon, it's okay to specify their sizes in pixels. */
1489 background-color: var(--main-background-color);
1497 display: inline-block;
1499 font: 15px monospace;
1501 vertical-align: middle;
1502 border: solid 1px var(--border-color);
1515 details.dir-entry > summary {
1517 list-style-position: outside;
1521 details.dir-entry div.folders, details.dir-entry div.files {
1525 details.dir-entry a {
1529 /* We use CSS containment on the details elements because most sizeable elements
1530 of the page are contained in one of these. This also makes re-rendering
1531 faster on document changes (like closing and opening toggles).
1532 Unfortunately we can't yet specify contain: content or contain: strict
1533 because the [-]/[+] toggles extend past the boundaries of the <details>
1534 https://developer.mozilla.org/en-US/docs/Web/CSS/contain */
1535 details.rustdoc-toggle {
1539 /* The hideme class is used on summary tags that contain a span with
1540 placeholder text shown only when the toggle is closed. For instance,
1541 "Expand description" or "Show methods". */
1542 details.rustdoc-toggle > summary.hideme {
1546 details.rustdoc-toggle > summary {
1549 details.rustdoc-toggle > summary::-webkit-details-marker,
1550 details.rustdoc-toggle > summary::marker {
1554 details.rustdoc-toggle > summary.hideme > span {
1558 details.rustdoc-toggle > summary::before {
1563 background-repeat: no-repeat;
1564 background-position: top left;
1565 display: inline-block;
1566 vertical-align: middle;
1570 details.rustdoc-toggle > summary.hideme > span,
1571 details.rustdoc-toggle > summary::before,
1572 .more-examples-toggle summary, .more-examples-toggle .hide-more {
1573 color: var(--toggles-color);
1576 /* Screen readers see the text version at the end the line.
1577 Visual readers see the icon at the start of the line, but small and transparent. */
1578 details.rustdoc-toggle > summary::after {
1586 details.rustdoc-toggle > summary.hideme::after {
1587 /* "hideme" toggles already have a description when they're contracted */
1591 details.rustdoc-toggle > summary:focus::before,
1592 details.rustdoc-toggle > summary:hover::before {
1596 details.rustdoc-toggle.top-doc > summary,
1597 details.rustdoc-toggle.top-doc > summary::before,
1598 details.rustdoc-toggle.non-exhaustive > summary,
1599 details.rustdoc-toggle.non-exhaustive > summary::before {
1603 details.non-exhaustive {
1607 details.rustdoc-toggle > summary.hideme::before {
1611 details.rustdoc-toggle > summary:not(.hideme)::before {
1617 .impl-items > details.rustdoc-toggle > summary:not(.hideme)::before {
1622 /* When a "hideme" summary is open and the "Expand description" or "Show
1623 methods" text is hidden, we want the [-] toggle that remains to not
1624 affect the layout of the items to its right. To do that, we use
1625 absolute positioning. Note that we also set position: relative
1626 on the parent <details> to make this work properly. */
1627 details.rustdoc-toggle[open] > summary.hideme {
1631 details.rustdoc-toggle {
1635 details.rustdoc-toggle[open] > summary.hideme > span {
1639 details.rustdoc-toggle[open] > summary::before,
1640 details.rustdoc-toggle[open] > summary.hideme::before {
1641 background-image: /* AUTOREPLACE: */url("toggle-minus.svg");
1644 details.rustdoc-toggle > summary::before {
1645 background-image: /* AUTOREPLACE: */url("toggle-plus.svg");
1648 details.rustdoc-toggle[open] > summary::before,
1649 details.rustdoc-toggle[open] > summary.hideme::before {
1652 background-repeat: no-repeat;
1653 background-position: top left;
1654 display: inline-block;
1658 details.rustdoc-toggle[open] > summary::after,
1659 details.rustdoc-toggle[open] > summary.hideme::after {
1660 content: "Collapse";
1663 /* This is needed in docblocks to have the "â–¶" element to be on the same line. */
1664 .docblock summary > * {
1665 display: inline-block;
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
1673 in storage.js plus the media query with (max-width: 700px)
1675 @media (min-width: 701px) {
1676 /* In case there is no documentation before a code block, we need to add some margin at the top
1677 to prevent an overlay between the "collapse toggle" and the information tooltip.
1678 However, it's not needed with smaller screen width because the doc/code block is always put
1679 "one line" below. */
1680 .docblock > .example-wrap:first-child .tooltip {
1684 /* When we expand the sidebar on the source code page, we hide the logo on the left of the
1685 search bar to have more space. */
1686 .source-sidebar-expanded .source .sidebar + main .width-limiter .sub-logo-container.rust-logo {
1690 .source-sidebar-expanded .source .sidebar {
1696 WARNING: RUSTDOC_MOBILE_BREAKPOINT MEDIA QUERY
1697 If you update this line, then you also need to update the line with the same warning
1698 in storage.js plus the media query with (min-width: 701px)
1700 @media (max-width: 700px) {
1701 /* When linking to an item with an `id` (for instance, by clicking a link in the sidebar,
1702 or visiting a URL with a fragment like `#method.new`, we don't want the item to be obscured
1703 by the topbar. Anything with an `id` gets scroll-margin-top equal to .mobile-topbar's size.
1706 scroll-margin-top: 45px;
1711 /* Sidebar should overlay main content, rather than pushing main content to the right.
1712 Turn off `display: flex` on the body element. */
1722 flex-direction: column;
1727 margin-left: initial;
1731 .out-of-band .since::before {
1739 /* Hide the logo and item name from the sidebar. Those are displayed
1740 in the mobile-topbar instead. */
1741 .sidebar .sidebar-logo,
1742 .sidebar .location {
1749 /* Hide the sidebar offscreen while not in use. Doing this instead of display: none means
1750 the sidebar stays visible for screen readers, which is useful for navigation. */
1756 /* Reduce height slightly to account for mobile topbar. */
1757 height: calc(100vh - 45px);
1760 /* The source view uses a different design for the sidebar toggle, and doesn't have a topbar,
1761 so don't bump down the main content or the sidebar. */
1763 .rustdoc.source .sidebar {
1771 .source-sidebar-expanded .source .sidebar,
1772 .sidebar:focus-within {
1776 .rustdoc.source > .sidebar {
1783 .mobile-topbar .location a {
1788 .mobile-topbar .location {
1791 margin: auto 0.5em auto auto;
1792 text-overflow: ellipsis;
1794 white-space: nowrap;
1795 /* Rare exception to specifying font sizes in rem. Since the topbar
1796 height is specified in pixels, this also has to be specified in
1797 pixels to avoid overflowing the topbar when the user sets a bigger
1802 .mobile-topbar .logo-container {
1806 .mobile-topbar .logo-container > img {
1816 flex-direction: row;
1826 .source .mobile-topbar {
1830 .sidebar-menu-toggle {
1832 /* Rare exception to specifying font sizes in rem. Since this is acting
1833 as an icon, it's okay to specify its sizes in pixels. */
1840 background-color: var(--sidebar-background-color);
1852 display: none !important;
1855 #titles > button > div.count {
1859 /* Because of ios, we need to actually have a full height sidebar title so the
1860 * actual sidebar can show up. But then we need to make it transparent so we don't
1861 * hide content. The filler just allows to create the background for the sidebar
1862 * title. But because of the absolute position, I had to lower the z-index.
1867 width: calc(100% - 45px);
1871 border-bottom: 1px solid;
1874 #main-content > details.rustdoc-toggle > summary::before,
1875 #main-content > div > details.rustdoc-toggle > summary::before {
1888 border-top-right-radius: 3px;
1889 border-bottom-right-radius: 3px;
1896 .source-sidebar-expanded #sidebar-toggle {
1900 border-top-right-radius: unset;
1901 border-bottom-right-radius: unset;
1904 border-bottom: 1px solid;
1907 .notable-traits .notable-traits-tooltiptext {
1912 /* We don't display the help button on mobile devices. */
1917 /* Display an alternating layout on tablets and phones */
1923 flex-flow: column wrap;
1925 .item-left, .item-right {
1929 /* Display an alternating layout on tablets and phones */
1930 .search-results > a {
1931 border-bottom: 1px solid #aaa9;
1934 .search-results .result-name, .search-results div.desc, .search-results .result-description {
1937 .search-results div.desc, .search-results .result-description, .item-right {
1941 .source-sidebar-expanded .source .sidebar {
1946 /* Position of the "[-]" element. */
1947 details.rustdoc-toggle:not(.top-doc) > summary {
1950 .impl-items > details.rustdoc-toggle > summary:not(.hideme)::before,
1951 #main-content > details.rustdoc-toggle:not(.top-doc) > summary::before,
1952 #main-content > div > details.rustdoc-toggle > summary::before {
1956 /* Align summary-nested and unnested item-info gizmos. */
1957 .content .impl-items > .item-info {
1963 nav.sidebar, nav.sub, .out-of-band, a.srclink, #copy-path,
1964 details.rustdoc-toggle[open] > summary::before, details.rustdoc-toggle > summary::before,
1965 details.rustdoc-toggle.top-doc > summary {
1978 @media (max-width: 464px) {
1988 overflow-wrap: break-word;
1989 overflow-wrap: anywhere;
1993 flex-direction: column;
1996 .sub-logo-container {
2000 .source .sub-logo-container > img {
2008 .source-sidebar-expanded #sidebar-toggle {
2013 .method-toggle summary,
2014 .implementors-toggle summary,
2016 margin-bottom: 0.75em;
2019 .method-toggle[open]:not(:last-child) {
2023 .implementors-toggle[open]:not(:last-child) {
2027 #trait-implementations-list .method-toggle:not(:last-child),
2028 #synthetic-implementations-list .method-toggle:not(:last-child),
2029 #blanket-implementations-list .method-toggle:not(:last-child) {
2033 /* Begin: styles for --scrape-examples feature */
2035 .scraped-example-list .scrape-help {
2038 font-weight: normal;
2042 background: transparent;
2044 border-style: solid;
2045 border-radius: 50px;
2048 .scraped-example .code-wrapper {
2051 flex-direction: row;
2056 .scraped-example:not(.expanded) .code-wrapper {
2060 .scraped-example:not(.expanded) .code-wrapper pre {
2066 .scraped-example:not(.expanded) .code-wrapper pre.src-line-numbers {
2070 .scraped-example .code-wrapper .prev {
2078 .scraped-example .code-wrapper .next {
2086 .scraped-example .code-wrapper .expand {
2094 .scraped-example:not(.expanded) .code-wrapper:before {
2103 .scraped-example:not(.expanded) .code-wrapper:after {
2112 .scraped-example .code-wrapper .src-line-numbers {
2117 .scraped-example .code-wrapper .src-line-numbers span {
2121 .scraped-example .code-wrapper .example-wrap {
2128 .scraped-example:not(.expanded) .code-wrapper .example-wrap {
2132 .scraped-example .code-wrapper .example-wrap pre.rust {
2133 overflow-x: inherit;
2139 .more-examples-toggle {
2140 max-width: calc(100% + 25px);
2145 .more-examples-toggle .hide-more {
2151 .more-scraped-examples {
2154 flex-direction: row;
2157 .more-scraped-examples-inner {
2158 /* 20px is width of toggle-line + toggle-line-inner */
2159 width: calc(100% - 20px);
2163 align-self: stretch;
2170 .toggle-line-inner {
2175 .more-scraped-examples .scraped-example {
2176 margin-bottom: 20px;
2179 .more-scraped-examples .scraped-example:last-child {
2191 /* End: styles for --scrape-examples feature */