1 /* See FiraSans-LICENSE.txt for the Fira Sans license. */
3 font-family: 'Fira Sans';
6 src: local('Fira Sans'),
7 url("FiraSans-Regular-018c141bf0843ffd.woff2") format("woff2");
11 font-family: 'Fira Sans';
14 src: local('Fira Sans Medium'),
15 url("FiraSans-Medium-8f9a781e4970d388.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-1f7d512b176f0f72.ttf.woff2") format("woff2");
29 font-family: 'Source Serif 4';
32 src: local('Source Serif 4 Italic'),
33 url("SourceSerif4-It-d034fe4ef9d0fa00.ttf.woff2") format("woff2");
37 font-family: 'Source Serif 4';
40 src: local('Source Serif 4 Bold'),
41 url("SourceSerif4-Bold-124a1ca42af929b6.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-562dcc5011b6de7d.ttf.woff2") format("woff2");
56 font-family: 'Source Code Pro';
59 src: url("SourceCodePro-It-1cc31594bf4f1f79.ttf.woff2") format("woff2");
63 font-family: 'Source Code Pro';
66 src: url("SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2") format("woff2");
70 /* Avoid using legacy CJK serif fonts in Windows like Batang. */
72 font-family: 'NanumBarunGothic';
73 src: url("NanumBarunGothic-0f09457c7a19b7c6.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;
165 /* The only headings that get underlines are:
166 Markdown-generated headings within the top-doc
167 Rustdoc-generated h2 section headings (e.g. "Implementations", "Required Methods", etc)
168 Underlines elsewhere in the documentation break up visual flow and tend to invert
169 section hierarchies. */
171 .top-doc .docblock > h3,
172 .top-doc .docblock > h4 {
173 border-bottom: 1px solid var(--headings-border-bottom-color);
176 font-size: 1.125rem; /* 18px */
188 h1, h2, h3, h4, h5, h6,
192 .search-results .result-name,
198 details.rustdoc-toggle.top-doc > summary,
199 details.rustdoc-toggle.non-exhaustive > summary,
200 .scraped-example-title,
201 .more-examples-toggle summary, .more-examples-toggle .hide-more,
203 /* This selector is for the items listed in the "all items" page. */
205 font-family: "Fira Sans", Arial, NanumBarunGothic, sans-serif;
210 .small-section-header a,
220 .result-name .primitive > i, .result-name .keyword > i {
221 color: var(--main-color);
224 .content span.enum, .content a.enum,
225 .content span.struct, .content a.struct,
226 .content span.union, .content a.union,
227 .content span.primitive, .content a.primitive,
228 .content span.type, .content a.type,
229 .content span.foreigntype, .content a.foreigntype {
230 color: var(--type-link-color);
233 .content span.trait, .content a.trait,
234 .content span.traitalias, .content a.traitalias {
235 color: var(--trait-link-color);
238 .content span.associatedtype, .content a.associatedtype,
239 .content span.constant, .content a.constant,
240 .content span.static, .content a.static {
241 color: var(--assoc-item-link-color);
244 .content span.fn, .content a.fn,
246 .content span.method, .content a.method,
247 .content span.tymethod, .content a.tymethod {
248 color: var(--function-link-color);
251 .content span.attr, .content a.attr,
252 .content span.derive, .content a.derive,
253 .content span.macro, .content a.macro {
254 color: var(--macro-link-color);
257 .content span.mod, .content a.mod {
258 color: var(--mod-link-color);
261 .content span.keyword, .content a.keyword {
262 color: var(--keyword-link-color);
266 color: var(--link-color);
272 ul ul, ol ul, ul ol, ol ol {
273 margin-bottom: .625em;
277 /* Paragraph spacing at least 1.5 times line spacing per Web Content Accessibility Guidelines.
278 Line-height is 1.5rem, so line spacing is .5rem; .75em is 1.5 times that.
279 https://www.w3.org/WAI/WCAG21/Understanding/visual-presentation.html */
282 /* For the last child of a div, the margin will be taken care of
283 by the margin-top of the next item. */
288 /* Fix some style changes due to normalize.css 8 */
291 /* Buttons on Safari have different default padding than other platforms. Make them the same. */
293 /* Opinionated tweak: use pointer cursor as clickability signifier. */
297 /* end tweaks for normalize.css 8 */
299 button#toggle-all-docs {
303 /* iOS button gradient: https://stackoverflow.com/q/5438567 */
304 -webkit-appearance: none;
317 padding: 10px 15px 40px 45px;
330 .source .width-limiter {
334 details:not(.rustdoc-toggle) summary {
338 code, pre, a.test-arrow, .code-header {
339 font-family: "Source Code Pro", monospace;
341 .docblock code, .docblock-short code {
345 .docblock pre code, .docblock-short pre code {
355 .source .content pre {
367 .sub-logo-container, .logo-container {
368 /* zero text boxes so that computed line height = image height exactly */
372 .sub-logo-container > img {
379 filter: var(--rust-logo-filter);
382 .sidebar, .mobile-topbar, .sidebar-menu-toggle {
383 background-color: var(--sidebar-background-color);
396 .rustdoc.source .sidebar {
398 border-right: 1px solid;
400 /* The sidebar is by default hidden */
404 .source .sidebar, #sidebar-toggle, #source-sidebar {
405 background-color: var(--sidebar-background-color);
408 #sidebar-toggle > button:hover, #sidebar-toggle > button:focus {
409 background-color: var(--sidebar-background-color-hover);
412 .source .sidebar > *:not(#sidebar-toggle) {
416 .source-sidebar-expanded .source .sidebar {
421 .source-sidebar-expanded .source .sidebar > *:not(#sidebar-toggle) {
429 /* Improve the scrollbar display on firefox */
431 scrollbar-width: initial;
432 scrollbar-color: var(--scrollbar-color);
435 scrollbar-width: thin;
436 scrollbar-color: var(--scrollbar-color);
439 /* Improve the scrollbar display on webkit-based browsers */
440 ::-webkit-scrollbar {
443 .sidebar::-webkit-scrollbar {
446 ::-webkit-scrollbar-track {
447 -webkit-box-shadow: inset 0;
448 background-color: var(--scrollbar-track-background-color);
450 .sidebar::-webkit-scrollbar-track {
451 background-color: var(--scrollbar-track-background-color);
453 ::-webkit-scrollbar-thumb, .sidebar::-webkit-scrollbar-thumb {
454 background-color: var(--scrollbar-thumb-background-color);
457 /* Everything else */
460 display: none !important;
463 .sidebar .logo-container {
470 overflow-wrap: break-word;
473 .logo-container > img {
478 ul.block, .block li {
489 margin-left: -0.25rem;
491 text-overflow: ellipsis;
496 overflow-wrap: anywhere;
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 a, .src-line-numbers span {
574 color: var(--src-line-numbers-span-color);
576 .src-line-numbers :target {
577 background-color: transparent;
581 .src-line-numbers .line-highlighted {
582 background-color: var(--src-line-number-highlighted-background-color);
590 overflow-wrap: break-word;
591 overflow-wrap: anywhere;
593 text-overflow: ellipsis;
595 /* Wrap non-pre code blocks (`text`) but not (```text```). */
596 .docblock > :not(pre) > code,
597 .docblock-short > code {
598 white-space: pre-wrap;
601 .top-doc .docblock h2 { font-size: 1.375rem; }
602 .top-doc .docblock h3 { font-size: 1.25rem; }
603 .top-doc .docblock h4,
604 .top-doc .docblock h5 {
607 .top-doc .docblock h6 {
611 .docblock h5 { font-size: 1rem; }
612 .docblock h6 { font-size: 0.875rem; }
619 .docblock > :not(.more-examples-toggle):not(.example-wrap) {
629 .docblock code, .docblock-short code,
630 pre, .rustdoc.source .example-wrap {
631 background-color: var(--code-block-background-color);
640 width: calc(100% - 2px);
643 border-collapse: collapse;
648 border: 1px dashed var(--border-color);
655 border: 1px solid var(--border-color);
658 /* Shift "where ..." part of method or fn definition down a line */
675 #main-content > .item-info {
681 flex-flow: row nowrap;
682 margin: 4px 0 25px 0;
695 .source .search-form {
700 text-decoration: none;
703 .small-section-header {
704 /* fields use <span> tags, but should get their own lines */
709 .small-section-header:hover > .anchor {
713 .impl:hover > .anchor, .trait-impl:hover > .anchor, .variant:hover > .anchor {
714 display: inline-block;
721 background: none !important;
726 .small-section-header > .anchor {
730 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;
783 .search-results-title {
786 /* flex layout allows shrinking the <select> appropriately if it becomes too large */
787 display: inline-flex;
789 /* make things look like in a line, despite the fact that we're using a layout
790 with boxes (i.e. from the flex layout) */
791 align-items: baseline;
794 /* ensures that 100% in properties of #crate-search-div:after
795 are relative to the size of this div */
797 /* allows this div (and with it the <select>-element "#crate-search") to be shrunk */
802 /* keep these two in sync with "@-moz-document url-prefix()" below */
803 padding: 0 23px 0 4px;
804 /* prevents the <select> from overflowing the containing div in case it's shrunk */
806 /* contents can overflow because of max-width limit, then show ellipsis */
807 text-overflow: ellipsis;
808 border: 1px solid var(--border-color);
812 -moz-appearance: none;
813 -webkit-appearance: none;
814 /* Removes default arrow from firefox */
816 background-color: var(--main-background-color);
821 #crate-search:hover, #crate-search:focus {
822 border-color: var(--crate-search-hover-border);
824 /* cancel stylistic differences in padding in firefox
825 for "appearance: none"-style (or equivalent) <select>s */
826 @-moz-document url-prefix() {
828 padding-left: 0px; /* == 4px - 4px */
829 padding-right: 19px; /* == 23px - 4px */
832 /* pseudo-element for holding the dropdown-arrow image; needs to be a separate thing
833 so that we can apply CSS-filters to change the arrow color in themes */
834 #crate-search-div::after {
835 /* lets clicks through! */
836 pointer-events: none;
837 /* completely covers the underlying div */
844 background-repeat: no-repeat;
845 background-size: 20px;
846 background-position: calc(100% - 2px) 56%;
847 /* image is black color */
848 background-image: url("down-arrow-927217e04c7463ac.svg");
849 /* changes the arrow image color */
850 filter: var(--crate-search-div-filter);
852 #crate-search-div:hover::after, #crate-search-div:focus-within::after {
853 filter: var(--crate-search-div-hover-filter);
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;
864 border: 1px solid var(--border-color);
869 background-color: var(--button-background-color);
870 color: var(--search-color);
872 .search-input:focus {
873 border-color: var(--search-input-focused-border-color);
880 .search-results.active {
884 .search-results > a {
886 /* A little margin ensures the browser's outlining of focused links has room to display. */
889 border-bottom: 1px solid var(--search-result-border-color);
893 .search-results > a > div {
897 .search-results > a > div.desc {
899 text-overflow: ellipsis;
904 .search-results a:hover,
905 .search-results a:focus {
906 background-color: var(--search-result-link-focus-background-color);
909 .search-results .result-name span.alias {
910 color: var(--search-results-alias-color);
912 .search-results .result-name span.grey {
913 color: var(--search-results-grey-color);
923 border: 1px solid var(--border-color);
924 --popover-arrow-offset: 11px;
927 /* This rule is to draw the little arrow connecting the settings menu to the gear icon. */
931 right: var(--popover-arrow-offset);
932 border: solid var(--border-color);
933 border-width: 1px 1px 0 0;
935 transform: rotate(-45deg);
939 .popover, .popover::before {
940 background-color: var(--main-background-color);
941 color: var(--main-color);
944 /* use larger max-width for help popover, but not for help.html */
947 --popover-arrow-offset: 48px;
954 margin-right: 0.5rem;
956 #help span.top, #help span.bottom {
963 border-bottom: 1px solid var(--border-color);
969 border-top: 1px solid var(--border-color);
971 .side-by-side > div {
974 padding: 0 20px 20px 17px;
979 /* This min-height is needed to unify the height of the stab elements because some of them
985 white-space: pre-wrap;
992 color: var(--main-color);
993 background-color: var(--stab-background-color);
996 .stab.portability > code {
998 color: var(--stab-code-color);
1003 margin-right: 0.3rem;
1006 /* This is to prevent the `.stab` elements to overflow the .docblock elements. */
1012 /* Black one-pixel outline around emoji shapes */
1022 .import-item .stab {
1024 display: inline-block;
1025 font-size: 0.875rem;
1028 margin-left: 0.3125em;
1030 vertical-align: text-bottom;
1033 .module-item.unstable,
1034 .import-item.unstable {
1039 font-weight: normal;
1050 color: var(--right-side-color);
1058 /* Code highlighting */
1060 color: var(--code-highlight-kw-color);
1063 color: var(--code-highlight-kw-2-color);
1065 pre.rust .lifetime {
1066 color: var(--code-highlight-lifetime-color);
1068 pre.rust .prelude-ty {
1069 color: var(--code-highlight-prelude-color);
1071 pre.rust .prelude-val {
1072 color: var(--code-highlight-prelude-val-color);
1075 color: var(--code-highlight-string-color);
1078 color: var(--code-highlight-number-color);
1080 pre.rust .bool-val {
1081 color: var(--code-highlight-literal-color);
1084 color: var(--code-highlight-self-color);
1087 color: var(--code-highlight-attribute-color);
1090 pre.rust .macro-nonterminal {
1091 color: var(--code-highlight-macro-color);
1093 pre.rust .question-mark {
1095 color: var(--code-highlight-question-mark-color);
1098 color: var(--code-highlight-comment-color);
1100 pre.rust .doccomment {
1101 color: var(--code-highlight-doc-comment-color);
1104 .example-wrap.compile_fail,
1105 .example-wrap.should_panic {
1106 border-left: 2px solid var(--codeblock-error-color);
1109 .ignore.example-wrap {
1110 border-left: 2px solid var(--codeblock-ignore-color);
1113 .example-wrap.compile_fail:hover,
1114 .example-wrap.should_panic:hover {
1115 border-left: 2px solid var(--codeblock-error-hover-color);
1118 .example-wrap.ignore:hover {
1119 border-left: 2px solid var(--codeblock-ignore-hover-color);
1122 .example-wrap.compile_fail .tooltip,
1123 .example-wrap.should_panic .tooltip {
1124 color: var(--codeblock-error-color);
1127 .example-wrap.ignore .tooltip {
1128 color: var(--codeblock-ignore-color);
1131 .example-wrap.compile_fail:hover .tooltip,
1132 .example-wrap.should_panic:hover .tooltip {
1133 color: var(--codeblock-error-hover-color);
1136 .example-wrap.ignore:hover .tooltip {
1137 color: var(--codeblock-ignore-hover-color);
1140 .example-wrap .tooltip {
1148 .example-wrap .tooltip::after {
1151 padding: 5px 3px 3px 3px;
1155 border: 1px solid var(--border-color);
1160 background-color: var(--tooltip-background-color);
1161 color: var(--tooltip-color);
1164 .example-wrap .tooltip::before {
1172 border: 5px solid transparent;
1173 border-right-color: var(--tooltip-background-color);
1176 .example-wrap.ignore .tooltip::after {
1177 content: "This example is not tested";
1179 .example-wrap.compile_fail .tooltip::after {
1180 content: "This example deliberately fails to compile";
1182 .example-wrap.should_panic .tooltip::after {
1183 content: "This example panics";
1185 .example-wrap.edition .tooltip::after {
1186 content: "This code runs with edition " attr(data-edition);
1189 .example-wrap .tooltip:hover::before, .example-wrap .tooltip:hover::after {
1193 .example-wrap.compile_fail .tooltip,
1194 .example-wrap.should_panic .tooltip,
1195 .example-wrap.ignore .tooltip {
1203 padding: 5px 10px 5px 10px;
1205 font-size: 1.375rem;
1209 color: var(--test-arrow-color);
1210 background-color: var(--test-arrow-background-color);
1212 a.test-arrow:hover {
1213 color: var(--test-arrow-hover-color);
1214 background-color: var(--test-arrow-hover-background-color);
1216 .example-wrap:hover .test-arrow {
1217 visibility: visible;
1222 color: var(--code-attribute-color);
1230 .out-of-band > span.since {
1243 margin-bottom: 40px;
1246 .sub-variant > .sub-variant-field {
1252 background-color: var(--target-background-color);
1253 border-right: 3px solid var(--target-border-color);
1262 /* placeholder thunk so that the mouse can easily travel from "(i)" to popover
1263 the resulting "hover tunnel" is a stepped triangle, approximating
1264 https://bjk5.com/post/44698559168/breaking-down-amazons-mega-dropdown */
1265 .notable-traits:hover::after {
1267 top: calc(100% - 10px);
1274 .notable .docblock {
1275 margin: 0.25em 0.5em;
1278 .notable .docblock pre, .notable .docblock code {
1279 background: transparent;
1283 white-space: pre-wrap;
1292 .search-failed.active {
1296 .search-failed > ul {
1305 flex-direction: row;
1312 font-size: 1.125rem;
1314 border-top: 2px solid;
1320 #titles > button > div.count {
1321 display: inline-block;
1330 border-bottom: 1px solid;
1333 justify-content: center;
1334 align-items: center;
1341 #source-sidebar > .title {
1344 border-bottom: 1px solid var(--border-color);
1347 #sidebar-toggle > button {
1360 /* work around button layout strangeness: https://stackoverflow.com/q/7271561 */
1362 /* iOS button gradient: https://stackoverflow.com/q/5438567 */
1363 -webkit-appearance: none;
1366 #settings-menu, #help-button {
1371 #settings-menu > a, #help-button > a, #copy-path {
1376 #settings-menu > a, #help-button > a {
1380 background-color: var(--button-background-color);
1381 border: 1px solid var(--border-color);
1383 color: var(--settings-button-color);
1386 #settings-menu > a:hover, #settings-menu > a:focus,
1387 #help-button > a:hover, #help-button > a:focus {
1388 border-color: var(--settings-button-border-focus);
1392 color: var(--copy-path-button-color);
1393 background: var(--main-background-color);
1401 filter: var(--copy-path-img-filter);
1403 #copy-path:hover > img {
1404 filter: var(--copy-path-img-hover-filter);
1407 @keyframes rotating {
1409 transform: rotate(0deg);
1412 transform: rotate(360deg);
1415 #settings-menu.rotate > a img {
1416 animation: rotating 2s linear infinite;
1421 /* Rare exception to specifying font sizes in rem. Since this is acting
1422 as an icon, it's okay to specify their sizes in pixels. */
1428 display: inline-block;
1430 font: 15px monospace;
1432 vertical-align: middle;
1433 border: solid 1px var(--border-color);
1436 color: var(--kbd--color);
1437 background-color: var(--kbd-background);
1438 box-shadow: inset 0 -1px 0 var(--kbd-box-shadow-color);
1449 details.dir-entry > summary::after {
1456 /* set width to cover gap between arrow and text */
1460 details[open].dir-entry > summary::after {
1464 details.dir-entry > summary::-webkit-details-marker,
1465 details.dir-entry > summary::marker {
1469 details.dir-entry > summary {
1476 details.dir-entry div.folders, details.dir-entry div.files {
1480 details.dir-entry a {
1484 /* We use CSS containment on the details elements because most sizeable elements
1485 of the page are contained in one of these. This also makes re-rendering
1486 faster on document changes (like closing and opening toggles).
1487 Unfortunately we can't yet specify contain: content or contain: strict
1488 because the [-]/[+] toggles extend past the boundaries of the <details>
1489 https://developer.mozilla.org/en-US/docs/Web/CSS/contain */
1490 details.rustdoc-toggle {
1495 /* The hideme class is used on summary tags that contain a span with
1496 placeholder text shown only when the toggle is closed. For instance,
1497 "Expand description" or "Show methods". */
1498 details.rustdoc-toggle > summary.hideme {
1502 details.rustdoc-toggle > summary {
1504 /* focus outline is shown on `::before` instead of this */
1507 details.rustdoc-toggle > summary::-webkit-details-marker,
1508 details.rustdoc-toggle > summary::marker {
1512 details.rustdoc-toggle > summary.hideme > span {
1516 details.rustdoc-toggle > summary::before {
1521 background-repeat: no-repeat;
1522 background-position: top left;
1523 display: inline-block;
1524 vertical-align: middle;
1528 details.rustdoc-toggle > summary.hideme > span,
1529 .more-examples-toggle summary, .more-examples-toggle .hide-more {
1530 color: var(--toggles-color);
1533 /* Screen readers see the text version at the end the line.
1534 Visual readers see the icon at the start of the line, but small and transparent. */
1535 details.rustdoc-toggle > summary::after {
1543 details.rustdoc-toggle > summary.hideme::after {
1544 /* "hideme" toggles already have a description when they're contracted */
1548 details.rustdoc-toggle > summary:focus::before,
1549 details.rustdoc-toggle > summary:hover::before {
1553 details.rustdoc-toggle > summary:focus-visible::before {
1554 /* The SVG is black, and gets turned white using a filter in the dark themes.
1555 Do the same with the outline.
1556 The dotted 1px style is copied from Firefox's focus ring style.
1558 outline: 1px dotted #000;
1559 outline-offset: 1px;
1562 details.rustdoc-toggle.top-doc > summary,
1563 details.rustdoc-toggle.top-doc > summary::before,
1564 details.rustdoc-toggle.non-exhaustive > summary,
1565 details.rustdoc-toggle.non-exhaustive > summary::before {
1569 details.non-exhaustive {
1573 details.rustdoc-toggle > summary.hideme::before {
1577 details.rustdoc-toggle > summary:not(.hideme)::before {
1583 .impl-items > details.rustdoc-toggle > summary:not(.hideme)::before {
1588 /* When a "hideme" summary is open and the "Expand description" or "Show
1589 methods" text is hidden, we want the [-] toggle that remains to not
1590 affect the layout of the items to its right. To do that, we use
1591 absolute positioning. Note that we also set position: relative
1592 on the parent <details> to make this work properly. */
1593 details.rustdoc-toggle[open] > summary.hideme {
1597 details.rustdoc-toggle[open] > summary.hideme > span {
1601 details.rustdoc-toggle[open] > summary::before,
1602 details.rustdoc-toggle[open] > summary.hideme::before {
1603 background-image: url("toggle-minus-31bbd6e4c77f5c96.svg");
1606 details.rustdoc-toggle > summary::before {
1607 background-image: url("toggle-plus-1092eb4930d581b0.svg");
1610 details.rustdoc-toggle[open] > summary::before,
1611 details.rustdoc-toggle[open] > summary.hideme::before {
1614 background-repeat: no-repeat;
1615 background-position: top left;
1616 display: inline-block;
1620 details.rustdoc-toggle[open] > summary::after,
1621 details.rustdoc-toggle[open] > summary.hideme::after {
1622 content: "Collapse";
1625 /* This is needed in docblocks to have the "â–¶" element to be on the same line. */
1626 .docblock summary > * {
1627 display: inline-block;
1630 /* In case there is no documentation before a code block, we need to add some margin at the top
1631 to prevent an overlay between the "collapse toggle" and the information tooltip.
1632 However, it's not needed with smaller screen width because the doc/code block is always put
1633 "one line" below. */
1634 .docblock > .example-wrap:first-child .tooltip {
1641 WARNING: RUSTDOC_MOBILE_BREAKPOINT MEDIA QUERY
1642 If you update this line, then you also need to update the line with the same warning
1645 @media (max-width: 700px) {
1646 /* When linking to an item with an `id` (for instance, by clicking a link in the sidebar,
1647 or visiting a URL with a fragment like `#method.new`, we don't want the item to be obscured
1648 by the topbar. Anything with an `id` gets scroll-margin-top equal to .mobile-topbar's size.
1651 scroll-margin-top: 45px;
1655 /* Sidebar should overlay main content, rather than pushing main content to the right.
1656 Turn off `display: flex` on the body element. */
1666 flex-direction: column;
1671 margin-left: initial;
1675 .out-of-band .since::before {
1683 /* Hide the logo and item name from the sidebar. Those are displayed
1684 in the mobile-topbar instead. */
1685 .sidebar .sidebar-logo,
1686 .sidebar .location {
1693 /* Hide the sidebar offscreen while not in use. Doing this instead of display: none means
1694 the sidebar stays visible for screen readers, which is useful for navigation. */
1699 /* Reduce height slightly to account for mobile topbar. */
1700 height: calc(100vh - 45px);
1704 /* The source view uses a different design for the sidebar toggle, and doesn't have a topbar,
1705 so don't bump down the main content or the sidebar. */
1707 .rustdoc.source .sidebar {
1715 .source-sidebar-expanded .source .sidebar,
1716 .sidebar:focus-within {
1720 .rustdoc.source > .sidebar {
1726 margin: auto 0.5em auto auto;
1728 /* Rare exception to specifying font sizes in rem. Since the topbar
1729 height is specified in pixels, this also has to be specified in
1730 pixels to avoid overflowing the topbar when the user sets a bigger
1735 .mobile-topbar h2 a {
1737 text-overflow: ellipsis;
1739 white-space: nowrap;
1742 .mobile-topbar .logo-container > img {
1745 margin: 5px 0 5px 20px;
1750 flex-direction: row;
1760 .sidebar-menu-toggle {
1762 /* Rare exception to specifying font sizes in rem. Since this is acting
1763 as an icon, it's okay to specify its sizes in pixels. */
1766 color: var(--main-color);
1778 display: none !important;
1781 #titles > button > div.count {
1785 #main-content > details.rustdoc-toggle > summary::before,
1786 #main-content > div > details.rustdoc-toggle > summary::before {
1799 border-top-right-radius: 3px;
1800 border-bottom-right-radius: 3px;
1805 .source-sidebar-expanded #sidebar-toggle {
1809 border-top-right-radius: unset;
1810 border-bottom-right-radius: unset;
1813 border-bottom: 1px solid;
1816 /* We don't display the help button on mobile devices. */
1821 /* Display an alternating layout on tablets and phones */
1822 .item-table, .item-row, .item-left, .item-right,
1823 .search-results > a, .search-results > a > div {
1827 /* Display an alternating layout on tablets and phones */
1828 .search-results > a {
1831 .search-results > a > div.desc, .item-right {
1835 .source-sidebar-expanded .source .sidebar {
1840 /* Position of the "[-]" element. */
1841 details.rustdoc-toggle:not(.top-doc) > summary {
1844 .impl-items > details.rustdoc-toggle > summary:not(.hideme)::before,
1845 #main-content > details.rustdoc-toggle:not(.top-doc) > summary::before,
1846 #main-content > div > details.rustdoc-toggle > summary::before {
1850 /* Align summary-nested and unnested item-info gizmos. */
1851 .impl-items > .item-info {
1862 nav.sidebar, nav.sub, .out-of-band, a.srclink, #copy-path,
1863 details.rustdoc-toggle[open] > summary::before, details.rustdoc-toggle > summary::before,
1864 details.rustdoc-toggle.top-doc > summary {
1877 @media (max-width: 464px) {
1883 overflow-wrap: break-word;
1884 overflow-wrap: anywhere;
1888 flex-direction: column;
1892 align-self: stretch;
1895 .sub-logo-container > img {
1903 .source-sidebar-expanded #sidebar-toggle {
1909 .implementors-toggle > summary,
1911 #implementors-list > .docblock,
1912 .impl-items > section,
1913 .impl-items > .rustdoc-toggle > summary,
1915 .methods > .rustdoc-toggle > summary
1917 margin-bottom: 0.75em;
1920 .variants > .docblock,
1921 .impl-items > .rustdoc-toggle[open]:not(:last-child),
1922 .methods > .rustdoc-toggle[open]:not(:last-child),
1923 .implementors-toggle[open]:not(:last-child) {
1927 #trait-implementations-list .impl-items > .rustdoc-toggle:not(:last-child),
1928 #synthetic-implementations-list .impl-items > .rustdoc-toggle:not(:last-child),
1929 #blanket-implementations-list .impl-items > .rustdoc-toggle:not(:last-child) {
1933 /* Begin: styles for --scrape-examples feature */
1935 .scraped-example-list .scrape-help {
1938 font-weight: normal;
1943 border-style: solid;
1944 border-radius: 50px;
1947 .scraped-example .code-wrapper {
1950 flex-direction: row;
1955 .scraped-example:not(.expanded) .code-wrapper {
1959 .scraped-example:not(.expanded) .code-wrapper pre {
1965 .scraped-example .code-wrapper .next,
1966 .scraped-example .code-wrapper .prev,
1967 .scraped-example .code-wrapper .expand {
1974 /* iOS button gradient: https://stackoverflow.com/q/5438567 */
1975 -webkit-appearance: none;
1978 .scraped-example .code-wrapper .prev {
1981 .scraped-example .code-wrapper .next {
1984 .scraped-example .code-wrapper .expand {
1988 .scraped-example:not(.expanded) .code-wrapper:before,
1989 .scraped-example:not(.expanded) .code-wrapper:after {
1996 .scraped-example:not(.expanded) .code-wrapper:before {
1999 .scraped-example:not(.expanded) .code-wrapper:after {
2003 .scraped-example .code-wrapper .src-line-numbers {
2008 .scraped-example .code-wrapper .src-line-numbers a,
2009 .scraped-example .code-wrapper .src-line-numbers span {
2013 .scraped-example .code-wrapper .example-wrap {
2020 .scraped-example:not(.expanded) .code-wrapper .example-wrap {
2024 .scraped-example .code-wrapper .example-wrap pre.rust {
2025 overflow-x: inherit;
2031 .more-examples-toggle {
2032 max-width: calc(100% + 25px);
2037 .more-examples-toggle .hide-more {
2043 .more-scraped-examples {
2046 flex-direction: row;
2049 .more-scraped-examples-inner {
2050 /* 20px is width of toggle-line + toggle-line-inner */
2051 width: calc(100% - 20px);
2055 align-self: stretch;
2062 .toggle-line-inner {
2067 .more-scraped-examples .scraped-example {
2068 margin-bottom: 20px;
2071 .more-scraped-examples .scraped-example:last-child {
2083 /* End: styles for --scrape-examples feature */