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 */
788 /* make things look like in a line, despite the fact that we're using a layout
789 with boxes (i.e. from the flex layout) */
790 align-items: baseline;
793 /* ensures that 100% in properties of #crate-search-div:after
794 are relative to the size of this div */
796 /* allows this div (and with it the <select>-element "#crate-search") to be shrunk */
801 /* keep these two in sync with "@-moz-document url-prefix()" below */
802 padding: 0 23px 0 4px;
803 /* prevents the <select> from overflowing the containing div in case it's shrunk */
805 /* contents can overflow because of max-width limit, then show ellipsis */
806 text-overflow: ellipsis;
807 border: 1px solid var(--border-color);
811 -moz-appearance: none;
812 -webkit-appearance: none;
813 /* Removes default arrow from firefox */
815 background-color: var(--main-background-color);
820 #crate-search:hover, #crate-search:focus {
821 border-color: var(--crate-search-hover-border);
823 /* cancel stylistic differences in padding in firefox
824 for "appearance: none"-style (or equivalent) <select>s */
825 @-moz-document url-prefix() {
827 padding-left: 0px; /* == 4px - 4px */
828 padding-right: 19px; /* == 23px - 4px */
831 /* pseudo-element for holding the dropdown-arrow image; needs to be a separate thing
832 so that we can apply CSS-filters to change the arrow color in themes */
833 #crate-search-div::after {
834 /* lets clicks through! */
835 pointer-events: none;
836 /* completely covers the underlying div */
843 background-repeat: no-repeat;
844 background-size: 20px;
845 background-position: calc(100% - 2px) 56%;
846 /* image is black color */
847 background-image: url("down-arrow-927217e04c7463ac.svg");
848 /* changes the arrow image color */
849 filter: var(--crate-search-div-filter);
851 #crate-search-div:hover::after, #crate-search-div:focus-within::after {
852 filter: var(--crate-search-div-hover-filter);
854 #crate-search > option {
858 /* Override Normalize.css: it has a rule that sets
859 -webkit-appearance: textfield for search inputs. That
860 causes rounded corners and no border on iOS Safari. */
861 -webkit-appearance: none;
863 border: 1px solid var(--border-color);
868 background-color: var(--button-background-color);
869 color: var(--search-color);
871 .search-input:focus {
872 border-color: var(--search-input-focused-border-color);
879 .search-results.active {
883 .search-results > a {
885 /* A little margin ensures the browser's outlining of focused links has room to display. */
888 border-bottom: 1px solid var(--search-result-border-color);
892 .search-results > a > div {
896 .search-results > a > div.desc {
898 text-overflow: ellipsis;
903 .search-results a:hover,
904 .search-results a:focus {
905 background-color: var(--search-result-link-focus-background-color);
908 .search-results .result-name span.alias {
909 color: var(--search-results-alias-color);
911 .search-results .result-name span.grey {
912 color: var(--search-results-grey-color);
922 border: 1px solid var(--border-color);
923 --popover-arrow-offset: 11px;
926 /* This rule is to draw the little arrow connecting the settings menu to the gear icon. */
930 right: var(--popover-arrow-offset);
931 border: solid var(--border-color);
932 border-width: 1px 1px 0 0;
934 transform: rotate(-45deg);
938 .popover, .popover::before {
939 background-color: var(--main-background-color);
940 color: var(--main-color);
943 /* use larger max-width for help popover, but not for help.html */
946 --popover-arrow-offset: 48px;
953 margin-right: 0.5rem;
955 #help span.top, #help span.bottom {
962 border-bottom: 1px solid var(--border-color);
968 border-top: 1px solid var(--border-color);
970 .side-by-side > div {
973 padding: 0 20px 20px 17px;
978 /* This min-height is needed to unify the height of the stab elements because some of them
984 white-space: pre-wrap;
991 color: var(--main-color);
992 background-color: var(--stab-background-color);
995 .stab.portability > code {
997 color: var(--stab-code-color);
1002 margin-right: 0.3rem;
1005 /* This is to prevent the `.stab` elements to overflow the .docblock elements. */
1011 /* Black one-pixel outline around emoji shapes */
1021 .import-item .stab {
1023 display: inline-block;
1024 font-size: 0.875rem;
1027 margin-left: 0.3125em;
1029 vertical-align: text-bottom;
1032 .module-item.unstable,
1033 .import-item.unstable {
1038 font-weight: normal;
1049 color: var(--right-side-color);
1057 /* Code highlighting */
1059 color: var(--code-highlight-kw-color);
1062 color: var(--code-highlight-kw-2-color);
1064 pre.rust .lifetime {
1065 color: var(--code-highlight-lifetime-color);
1067 pre.rust .prelude-ty {
1068 color: var(--code-highlight-prelude-color);
1070 pre.rust .prelude-val {
1071 color: var(--code-highlight-prelude-val-color);
1074 color: var(--code-highlight-string-color);
1077 color: var(--code-highlight-number-color);
1079 pre.rust .bool-val {
1080 color: var(--code-highlight-literal-color);
1083 color: var(--code-highlight-self-color);
1086 color: var(--code-highlight-attribute-color);
1089 pre.rust .macro-nonterminal {
1090 color: var(--code-highlight-macro-color);
1092 pre.rust .question-mark {
1094 color: var(--code-highlight-question-mark-color);
1097 color: var(--code-highlight-comment-color);
1099 pre.rust .doccomment {
1100 color: var(--code-highlight-doc-comment-color);
1103 .example-wrap.compile_fail,
1104 .example-wrap.should_panic {
1105 border-left: 2px solid var(--codeblock-error-color);
1108 .ignore.example-wrap {
1109 border-left: 2px solid var(--codeblock-ignore-color);
1112 .example-wrap.compile_fail:hover,
1113 .example-wrap.should_panic:hover {
1114 border-left: 2px solid var(--codeblock-error-hover-color);
1117 .example-wrap.ignore:hover {
1118 border-left: 2px solid var(--codeblock-ignore-hover-color);
1121 .example-wrap.compile_fail .tooltip,
1122 .example-wrap.should_panic .tooltip {
1123 color: var(--codeblock-error-color);
1126 .example-wrap.ignore .tooltip {
1127 color: var(--codeblock-ignore-color);
1130 .example-wrap.compile_fail:hover .tooltip,
1131 .example-wrap.should_panic:hover .tooltip {
1132 color: var(--codeblock-error-hover-color);
1135 .example-wrap.ignore:hover .tooltip {
1136 color: var(--codeblock-ignore-hover-color);
1139 .example-wrap .tooltip {
1147 .example-wrap .tooltip::after {
1150 padding: 5px 3px 3px 3px;
1154 border: 1px solid var(--border-color);
1159 background-color: var(--tooltip-background-color);
1160 color: var(--tooltip-color);
1163 .example-wrap .tooltip::before {
1171 border: 5px solid transparent;
1172 border-right-color: var(--tooltip-background-color);
1175 .example-wrap.ignore .tooltip::after {
1176 content: "This example is not tested";
1178 .example-wrap.compile_fail .tooltip::after {
1179 content: "This example deliberately fails to compile";
1181 .example-wrap.should_panic .tooltip::after {
1182 content: "This example panics";
1184 .example-wrap.edition .tooltip::after {
1185 content: "This code runs with edition " attr(data-edition);
1188 .example-wrap .tooltip:hover::before, .example-wrap .tooltip:hover::after {
1192 .example-wrap.compile_fail .tooltip,
1193 .example-wrap.should_panic .tooltip,
1194 .example-wrap.ignore .tooltip {
1202 padding: 5px 10px 5px 10px;
1204 font-size: 1.375rem;
1208 color: var(--test-arrow-color);
1209 background-color: var(--test-arrow-background-color);
1211 a.test-arrow:hover {
1212 color: var(--test-arrow-hover-color);
1213 background-color: var(--test-arrow-hover-background-color);
1215 .example-wrap:hover .test-arrow {
1216 visibility: visible;
1221 color: var(--code-attribute-color);
1229 .out-of-band > span.since {
1242 margin-bottom: 40px;
1245 .sub-variant > .sub-variant-field {
1251 background-color: var(--target-background-color);
1252 border-right: 3px solid var(--target-border-color);
1261 /* placeholder thunk so that the mouse can easily travel from "(i)" to popover
1262 the resulting "hover tunnel" is a stepped triangle, approximating
1263 https://bjk5.com/post/44698559168/breaking-down-amazons-mega-dropdown */
1264 .notable-traits:hover::after {
1266 top: calc(100% - 10px);
1273 .notable .docblock {
1274 margin: 0.25em 0.5em;
1277 .notable .docblock pre, .notable .docblock code {
1278 background: transparent;
1282 white-space: pre-wrap;
1291 .search-failed.active {
1295 .search-failed > ul {
1304 flex-direction: row;
1311 font-size: 1.125rem;
1313 border-top: 2px solid;
1319 #titles > button > div.count {
1320 display: inline-block;
1329 border-bottom: 1px solid;
1332 justify-content: center;
1333 align-items: center;
1340 #source-sidebar > .title {
1343 border-bottom: 1px solid var(--border-color);
1346 #source-sidebar div.files > a:hover, details.dir-entry summary:hover,
1347 #source-sidebar div.files > a:focus, details.dir-entry summary:focus {
1348 background-color: var(--source-sidebar-background-hover);
1350 #source-sidebar div.files > a.selected {
1351 background-color: var(--source-sidebar-background-selected);
1353 #sidebar-toggle > button {
1366 /* work around button layout strangeness: https://stackoverflow.com/q/7271561 */
1368 /* iOS button gradient: https://stackoverflow.com/q/5438567 */
1369 -webkit-appearance: none;
1372 #settings-menu, #help-button {
1377 #settings-menu > a, #help-button > a, #copy-path {
1382 #settings-menu > a, #help-button > a {
1386 background-color: var(--button-background-color);
1387 border: 1px solid var(--border-color);
1389 color: var(--settings-button-color);
1392 #settings-menu > a:hover, #settings-menu > a:focus,
1393 #help-button > a:hover, #help-button > a:focus {
1394 border-color: var(--settings-button-border-focus);
1398 color: var(--copy-path-button-color);
1399 background: var(--main-background-color);
1407 filter: var(--copy-path-img-filter);
1409 #copy-path:hover > img {
1410 filter: var(--copy-path-img-hover-filter);
1413 @keyframes rotating {
1415 transform: rotate(0deg);
1418 transform: rotate(360deg);
1421 #settings-menu.rotate > a img {
1422 animation: rotating 2s linear infinite;
1427 /* Rare exception to specifying font sizes in rem. Since this is acting
1428 as an icon, it's okay to specify their sizes in pixels. */
1434 display: inline-block;
1436 font: 15px monospace;
1438 vertical-align: middle;
1439 border: solid 1px var(--border-color);
1442 color: var(--kbd--color);
1443 background-color: var(--kbd-background);
1444 box-shadow: inset 0 -1px 0 var(--kbd-box-shadow-color);
1455 details.dir-entry > summary::after {
1462 /* set width to cover gap between arrow and text */
1466 details[open].dir-entry > summary::after {
1470 details.dir-entry > summary::-webkit-details-marker,
1471 details.dir-entry > summary::marker {
1475 details.dir-entry > summary {
1482 details.dir-entry div.folders, details.dir-entry div.files {
1486 details.dir-entry a {
1490 /* We use CSS containment on the details elements because most sizeable elements
1491 of the page are contained in one of these. This also makes re-rendering
1492 faster on document changes (like closing and opening toggles).
1493 Unfortunately we can't yet specify contain: content or contain: strict
1494 because the [-]/[+] toggles extend past the boundaries of the <details>
1495 https://developer.mozilla.org/en-US/docs/Web/CSS/contain */
1496 details.rustdoc-toggle {
1501 /* The hideme class is used on summary tags that contain a span with
1502 placeholder text shown only when the toggle is closed. For instance,
1503 "Expand description" or "Show methods". */
1504 details.rustdoc-toggle > summary.hideme {
1508 details.rustdoc-toggle > summary {
1510 /* focus outline is shown on `::before` instead of this */
1513 details.rustdoc-toggle > summary::-webkit-details-marker,
1514 details.rustdoc-toggle > summary::marker {
1518 details.rustdoc-toggle > summary.hideme > span {
1522 details.rustdoc-toggle > summary::before {
1527 background-repeat: no-repeat;
1528 background-position: top left;
1529 display: inline-block;
1530 vertical-align: middle;
1534 details.rustdoc-toggle > summary.hideme > span,
1535 .more-examples-toggle summary, .more-examples-toggle .hide-more {
1536 color: var(--toggles-color);
1539 /* Screen readers see the text version at the end the line.
1540 Visual readers see the icon at the start of the line, but small and transparent. */
1541 details.rustdoc-toggle > summary::after {
1549 details.rustdoc-toggle > summary.hideme::after {
1550 /* "hideme" toggles already have a description when they're contracted */
1554 details.rustdoc-toggle > summary:focus::before,
1555 details.rustdoc-toggle > summary:hover::before {
1559 details.rustdoc-toggle > summary:focus-visible::before {
1560 /* The SVG is black, and gets turned white using a filter in the dark themes.
1561 Do the same with the outline.
1562 The dotted 1px style is copied from Firefox's focus ring style.
1564 outline: 1px dotted #000;
1565 outline-offset: 1px;
1568 details.rustdoc-toggle.top-doc > summary,
1569 details.rustdoc-toggle.top-doc > summary::before,
1570 details.rustdoc-toggle.non-exhaustive > summary,
1571 details.rustdoc-toggle.non-exhaustive > summary::before {
1575 details.non-exhaustive {
1579 details.rustdoc-toggle > summary.hideme::before {
1583 details.rustdoc-toggle > summary:not(.hideme)::before {
1589 .impl-items > details.rustdoc-toggle > summary:not(.hideme)::before {
1594 /* When a "hideme" summary is open and the "Expand description" or "Show
1595 methods" text is hidden, we want the [-] toggle that remains to not
1596 affect the layout of the items to its right. To do that, we use
1597 absolute positioning. Note that we also set position: relative
1598 on the parent <details> to make this work properly. */
1599 details.rustdoc-toggle[open] > summary.hideme {
1603 details.rustdoc-toggle[open] > summary.hideme > span {
1607 details.rustdoc-toggle[open] > summary::before,
1608 details.rustdoc-toggle[open] > summary.hideme::before {
1609 background-image: url("toggle-minus-31bbd6e4c77f5c96.svg");
1612 details.rustdoc-toggle > summary::before {
1613 background-image: url("toggle-plus-1092eb4930d581b0.svg");
1616 details.rustdoc-toggle[open] > summary::before,
1617 details.rustdoc-toggle[open] > summary.hideme::before {
1620 background-repeat: no-repeat;
1621 background-position: top left;
1622 display: inline-block;
1626 details.rustdoc-toggle[open] > summary::after,
1627 details.rustdoc-toggle[open] > summary.hideme::after {
1628 content: "Collapse";
1631 /* This is needed in docblocks to have the "â–¶" element to be on the same line. */
1632 .docblock summary > * {
1633 display: inline-block;
1636 /* In case there is no documentation before a code block, we need to add some margin at the top
1637 to prevent an overlay between the "collapse toggle" and the information tooltip.
1638 However, it's not needed with smaller screen width because the doc/code block is always put
1639 "one line" below. */
1640 .docblock > .example-wrap:first-child .tooltip {
1647 WARNING: RUSTDOC_MOBILE_BREAKPOINT MEDIA QUERY
1648 If you update this line, then you also need to update the line with the same warning
1651 @media (max-width: 700px) {
1652 /* When linking to an item with an `id` (for instance, by clicking a link in the sidebar,
1653 or visiting a URL with a fragment like `#method.new`, we don't want the item to be obscured
1654 by the topbar. Anything with an `id` gets scroll-margin-top equal to .mobile-topbar's size.
1657 scroll-margin-top: 45px;
1661 /* Sidebar should overlay main content, rather than pushing main content to the right.
1662 Turn off `display: flex` on the body element. */
1672 flex-direction: column;
1677 margin-left: initial;
1681 .out-of-band .since::before {
1689 /* Hide the logo and item name from the sidebar. Those are displayed
1690 in the mobile-topbar instead. */
1691 .sidebar .sidebar-logo,
1692 .sidebar .location {
1699 /* Hide the sidebar offscreen while not in use. Doing this instead of display: none means
1700 the sidebar stays visible for screen readers, which is useful for navigation. */
1705 /* Reduce height slightly to account for mobile topbar. */
1706 height: calc(100vh - 45px);
1710 /* The source view uses a different design for the sidebar toggle, and doesn't have a topbar,
1711 so don't bump down the main content or the sidebar. */
1713 .rustdoc.source .sidebar {
1721 .source-sidebar-expanded .source .sidebar,
1722 .sidebar:focus-within {
1726 .rustdoc.source > .sidebar {
1732 margin: auto 0.5em auto auto;
1734 /* Rare exception to specifying font sizes in rem. Since the topbar
1735 height is specified in pixels, this also has to be specified in
1736 pixels to avoid overflowing the topbar when the user sets a bigger
1741 .mobile-topbar h2 a {
1743 text-overflow: ellipsis;
1745 white-space: nowrap;
1748 .mobile-topbar .logo-container > img {
1751 margin: 5px 0 5px 20px;
1756 flex-direction: row;
1766 .sidebar-menu-toggle {
1768 /* Rare exception to specifying font sizes in rem. Since this is acting
1769 as an icon, it's okay to specify its sizes in pixels. */
1772 color: var(--main-color);
1784 display: none !important;
1787 #titles > button > div.count {
1791 #main-content > details.rustdoc-toggle > summary::before,
1792 #main-content > div > details.rustdoc-toggle > summary::before {
1805 border-top-right-radius: 3px;
1806 border-bottom-right-radius: 3px;
1811 .source-sidebar-expanded #sidebar-toggle {
1815 border-top-right-radius: unset;
1816 border-bottom-right-radius: unset;
1819 border-bottom: 1px solid;
1822 /* We don't display the help button on mobile devices. */
1827 /* Display an alternating layout on tablets and phones */
1828 .item-table, .item-row, .item-left, .item-right,
1829 .search-results > a, .search-results > a > div {
1833 /* Display an alternating layout on tablets and phones */
1834 .search-results > a {
1837 .search-results > a > div.desc, .item-right {
1841 .source-sidebar-expanded .source .sidebar {
1846 /* Position of the "[-]" element. */
1847 details.rustdoc-toggle:not(.top-doc) > summary {
1850 .impl-items > details.rustdoc-toggle > summary:not(.hideme)::before,
1851 #main-content > details.rustdoc-toggle:not(.top-doc) > summary::before,
1852 #main-content > div > details.rustdoc-toggle > summary::before {
1856 /* Align summary-nested and unnested item-info gizmos. */
1857 .impl-items > .item-info {
1868 nav.sidebar, nav.sub, .out-of-band, a.srclink, #copy-path,
1869 details.rustdoc-toggle[open] > summary::before, details.rustdoc-toggle > summary::before,
1870 details.rustdoc-toggle.top-doc > summary {
1883 @media (max-width: 464px) {
1889 overflow-wrap: break-word;
1890 overflow-wrap: anywhere;
1894 flex-direction: column;
1898 align-self: stretch;
1901 .sub-logo-container > img {
1909 .source-sidebar-expanded #sidebar-toggle {
1915 .implementors-toggle > summary,
1917 #implementors-list > .docblock,
1918 .impl-items > section,
1919 .impl-items > .rustdoc-toggle > summary,
1921 .methods > .rustdoc-toggle > summary
1923 margin-bottom: 0.75em;
1926 .variants > .docblock,
1927 .impl-items > .rustdoc-toggle[open]:not(:last-child),
1928 .methods > .rustdoc-toggle[open]:not(:last-child),
1929 .implementors-toggle[open]:not(:last-child) {
1933 #trait-implementations-list .impl-items > .rustdoc-toggle:not(:last-child),
1934 #synthetic-implementations-list .impl-items > .rustdoc-toggle:not(:last-child),
1935 #blanket-implementations-list .impl-items > .rustdoc-toggle:not(:last-child) {
1939 /* Begin: styles for --scrape-examples feature */
1941 .scraped-example-list .scrape-help {
1944 font-weight: normal;
1949 border-style: solid;
1950 border-radius: 50px;
1953 .scraped-example .code-wrapper {
1956 flex-direction: row;
1961 .scraped-example:not(.expanded) .code-wrapper {
1965 .scraped-example:not(.expanded) .code-wrapper pre {
1971 .scraped-example .code-wrapper .next,
1972 .scraped-example .code-wrapper .prev,
1973 .scraped-example .code-wrapper .expand {
1980 /* iOS button gradient: https://stackoverflow.com/q/5438567 */
1981 -webkit-appearance: none;
1984 .scraped-example .code-wrapper .prev {
1987 .scraped-example .code-wrapper .next {
1990 .scraped-example .code-wrapper .expand {
1994 .scraped-example:not(.expanded) .code-wrapper:before,
1995 .scraped-example:not(.expanded) .code-wrapper:after {
2002 .scraped-example:not(.expanded) .code-wrapper:before {
2005 .scraped-example:not(.expanded) .code-wrapper:after {
2009 .scraped-example .code-wrapper .src-line-numbers {
2014 .scraped-example .code-wrapper .src-line-numbers a,
2015 .scraped-example .code-wrapper .src-line-numbers span {
2019 .scraped-example .code-wrapper .example-wrap {
2026 .scraped-example:not(.expanded) .code-wrapper .example-wrap {
2030 .scraped-example .code-wrapper .example-wrap pre.rust {
2031 overflow-x: inherit;
2037 .more-examples-toggle {
2038 max-width: calc(100% + 25px);
2043 .more-examples-toggle .hide-more {
2049 .more-scraped-examples {
2052 flex-direction: row;
2055 .more-scraped-examples-inner {
2056 /* 20px is width of toggle-line + toggle-line-inner */
2057 width: calc(100% - 20px);
2061 align-self: stretch;
2068 .toggle-line-inner {
2073 .more-scraped-examples .scraped-example {
2074 margin-bottom: 20px;
2077 .more-scraped-examples .scraped-example:last-child {
2089 /* End: styles for --scrape-examples feature */