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 {
707 .small-section-header:hover > .anchor {
711 .impl:hover > .anchor, .trait-impl:hover > .anchor, .variant:hover > .anchor {
712 display: inline-block;
719 background: none !important;
724 .small-section-header > .anchor {
728 h2.small-section-header > .anchor {
735 .main-heading a:hover,
736 .example-wrap > pre.rust a:hover,
738 .docblock a:not(.test-arrow):not(.scrape-help):hover,
739 .docblock-short a:not(.test-arrow):not(.scrape-help):hover,
741 text-decoration: underline;
744 .crate.block a.current { font-weight: 500; }
746 /* In most contexts we use `overflow-wrap: anywhere` to ensure that we can wrap
747 as much as needed on mobile (see
748 src/test/rustdoc-gui/type-declaration-overflow.goml for an example of why
749 this matters). The `anywhere` value means:
751 "Soft wrap opportunities introduced by the word break are considered when
752 calculating min-content intrinsic sizes."
754 https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-wrap#values
756 For table layouts, that becomes a problem: the browser tries to make each
757 column as narrow as possible, and `overflow-wrap: anywhere` means it can do
758 so by breaking words - even if some other column could be shrunk without
759 breaking words! This shows up, for instance, in the `Structs` / `Modules` /
760 `Functions` (etcetera) sections of a module page, and when a docblock
763 So, for table layouts, override the default with break-word, which does
764 _not_ affect min-content intrinsic sizes.
768 overflow-wrap: break-word;
777 .item-left, .item-right {
781 padding-right: 1.25rem;
784 .search-results-title {
787 /* flex layout allows shrinking the <select> appropriately if it becomes too large */
788 display: inline-flex;
790 /* make things look like in a line, despite the fact that we're using a layout
791 with boxes (i.e. from the flex layout) */
792 align-items: baseline;
795 /* ensures that 100% in properties of #crate-search-div:after
796 are relative to the size of this div */
798 /* allows this div (and with it the <select>-element "#crate-search") to be shrunk */
803 /* keep these two in sync with "@-moz-document url-prefix()" below */
804 padding: 0 23px 0 4px;
805 /* prevents the <select> from overflowing the containing div in case it's shrunk */
807 /* contents can overflow because of max-width limit, then show ellipsis */
808 text-overflow: ellipsis;
809 border: 1px solid var(--border-color);
813 -moz-appearance: none;
814 -webkit-appearance: none;
815 /* Removes default arrow from firefox */
817 background-color: var(--main-background-color);
822 #crate-search:hover, #crate-search:focus {
823 border-color: var(--crate-search-hover-border);
825 /* cancel stylistic differences in padding in firefox
826 for "appearance: none"-style (or equivalent) <select>s */
827 @-moz-document url-prefix() {
829 padding-left: 0px; /* == 4px - 4px */
830 padding-right: 19px; /* == 23px - 4px */
833 /* pseudo-element for holding the dropdown-arrow image; needs to be a separate thing
834 so that we can apply CSS-filters to change the arrow color in themes */
835 #crate-search-div::after {
836 /* lets clicks through! */
837 pointer-events: none;
838 /* completely covers the underlying div */
845 background-repeat: no-repeat;
846 background-size: 20px;
847 background-position: calc(100% - 2px) 56%;
848 /* image is black color */
849 background-image: url("down-arrow-927217e04c7463ac.svg");
850 /* changes the arrow image color */
851 filter: var(--crate-search-div-filter);
853 #crate-search-div:hover::after, #crate-search-div:focus-within::after {
854 filter: var(--crate-search-div-hover-filter);
856 #crate-search > option {
860 /* Override Normalize.css: it has a rule that sets
861 -webkit-appearance: textfield for search inputs. That
862 causes rounded corners and no border on iOS Safari. */
863 -webkit-appearance: none;
865 border: 1px solid var(--border-color);
870 background-color: var(--button-background-color);
871 color: var(--search-color);
873 .search-input:focus {
874 border-color: var(--search-input-focused-border-color);
881 .search-results.active {
885 .search-results > a {
887 /* A little margin ensures the browser's outlining of focused links has room to display. */
890 border-bottom: 1px solid var(--search-result-border-color);
894 .search-results > a > div {
898 .search-results > a > div.desc {
900 text-overflow: ellipsis;
905 .search-results a:hover,
906 .search-results a:focus {
907 background-color: var(--search-result-link-focus-background-color);
910 .search-results .result-name span.alias {
911 color: var(--search-results-alias-color);
913 .search-results .result-name span.grey {
914 color: var(--search-results-grey-color);
924 border: 1px solid var(--border-color);
925 --popover-arrow-offset: 11px;
928 /* This rule is to draw the little arrow connecting the settings menu to the gear icon. */
932 right: var(--popover-arrow-offset);
933 border: solid var(--border-color);
934 border-width: 1px 1px 0 0;
935 display: inline-block;
937 transform: rotate(-45deg);
941 .popover, .popover::before {
942 background-color: var(--main-background-color);
943 color: var(--main-color);
946 /* use larger max-width for help popover, but not for help.html */
949 --popover-arrow-offset: 48px;
956 margin-right: 0.5rem;
958 #help span.top, #help span.bottom {
965 border-bottom: 1px solid var(--border-color);
971 border-top: 1px solid var(--border-color);
973 .side-by-side > div {
976 padding: 0 20px 20px 17px;
981 /* This min-height is needed to unify the height of the stab elements because some of them
987 white-space: pre-wrap;
994 color: var(--main-color);
995 background-color: var(--stab-background-color);
998 .stab.portability > code {
1000 color: var(--stab-code-color);
1005 margin-right: 0.3rem;
1008 /* This is to prevent the `.stab` elements to overflow the .docblock elements. */
1014 /* Black one-pixel outline around emoji shapes */
1024 .import-item .stab {
1026 display: inline-block;
1027 font-size: 0.875rem;
1030 margin-left: 0.3125em;
1032 vertical-align: text-bottom;
1035 .module-item.unstable,
1036 .import-item.unstable {
1041 font-weight: normal;
1052 color: var(--right-side-color);
1060 /* Code highlighting */
1062 color: var(--code-highlight-kw-color);
1065 color: var(--code-highlight-kw-2-color);
1067 pre.rust .lifetime {
1068 color: var(--code-highlight-lifetime-color);
1070 pre.rust .prelude-ty {
1071 color: var(--code-highlight-prelude-color);
1073 pre.rust .prelude-val {
1074 color: var(--code-highlight-prelude-val-color);
1077 color: var(--code-highlight-string-color);
1080 color: var(--code-highlight-number-color);
1082 pre.rust .bool-val {
1083 color: var(--code-highlight-literal-color);
1086 color: var(--code-highlight-self-color);
1089 color: var(--code-highlight-attribute-color);
1092 pre.rust .macro-nonterminal {
1093 color: var(--code-highlight-macro-color);
1095 pre.rust .question-mark {
1097 color: var(--code-highlight-question-mark-color);
1100 color: var(--code-highlight-comment-color);
1102 pre.rust .doccomment {
1103 color: var(--code-highlight-doc-comment-color);
1106 .example-wrap.compile_fail,
1107 .example-wrap.should_panic {
1108 border-left: 2px solid var(--codeblock-error-color);
1111 .ignore.example-wrap {
1112 border-left: 2px solid var(--codeblock-ignore-color);
1115 .example-wrap.compile_fail:hover,
1116 .example-wrap.should_panic:hover {
1117 border-left: 2px solid var(--codeblock-error-hover-color);
1120 .example-wrap.ignore:hover {
1121 border-left: 2px solid var(--codeblock-ignore-hover-color);
1124 .example-wrap.compile_fail .tooltip,
1125 .example-wrap.should_panic .tooltip {
1126 color: var(--codeblock-error-color);
1129 .example-wrap.ignore .tooltip {
1130 color: var(--codeblock-ignore-color);
1133 .example-wrap.compile_fail:hover .tooltip,
1134 .example-wrap.should_panic:hover .tooltip {
1135 color: var(--codeblock-error-hover-color);
1138 .example-wrap.ignore:hover .tooltip {
1139 color: var(--codeblock-ignore-hover-color);
1142 .example-wrap .tooltip {
1150 .example-wrap .tooltip::after {
1153 padding: 5px 3px 3px 3px;
1157 border: 1px solid var(--border-color);
1162 background-color: var(--tooltip-background-color);
1163 color: var(--tooltip-color);
1166 .example-wrap .tooltip::before {
1174 border: 5px solid transparent;
1175 border-right-color: var(--tooltip-background-color);
1178 .example-wrap.ignore .tooltip::after {
1179 content: "This example is not tested";
1181 .example-wrap.compile_fail .tooltip::after {
1182 content: "This example deliberately fails to compile";
1184 .example-wrap.should_panic .tooltip::after {
1185 content: "This example panics";
1187 .example-wrap.edition .tooltip::after {
1188 content: "This code runs with edition " attr(data-edition);
1191 .example-wrap .tooltip:hover::before, .example-wrap .tooltip:hover::after {
1195 .example-wrap.compile_fail .tooltip,
1196 .example-wrap.should_panic .tooltip,
1197 .example-wrap.ignore .tooltip {
1203 display: inline-block;
1206 padding: 5px 10px 5px 10px;
1208 font-size: 1.375rem;
1212 color: var(--test-arrow-color);
1213 background-color: var(--test-arrow-background-color);
1215 a.test-arrow:hover {
1216 color: var(--test-arrow-hover-color);
1217 background-color: var(--test-arrow-hover-background-color);
1219 .example-wrap:hover .test-arrow {
1220 visibility: visible;
1225 color: var(--code-attribute-color);
1233 .out-of-band > span.since {
1246 margin-bottom: 40px;
1249 .sub-variant > .sub-variant-field {
1255 background-color: var(--target-background-color);
1256 border-right: 3px solid var(--target-border-color);
1265 /* placeholder thunk so that the mouse can easily travel from "(i)" to popover
1266 the resulting "hover tunnel" is a stepped triangle, approximating
1267 https://bjk5.com/post/44698559168/breaking-down-amazons-mega-dropdown */
1268 .notable-traits:hover::after {
1270 top: calc(100% - 10px);
1277 .notable .docblock {
1278 margin: 0.25em 0.5em;
1281 .notable .docblock pre, .notable .docblock code {
1282 background: transparent;
1286 white-space: pre-wrap;
1295 .search-failed.active {
1299 .search-failed > ul {
1308 flex-direction: row;
1315 font-size: 1.125rem;
1317 border-top: 2px solid;
1323 #titles > button > div.count {
1324 display: inline-block;
1333 border-bottom: 1px solid;
1336 justify-content: center;
1337 align-items: center;
1344 #source-sidebar > .title {
1347 border-bottom: 1px solid var(--border-color);
1350 #sidebar-toggle > button {
1363 /* work around button layout strangeness: https://stackoverflow.com/q/7271561 */
1365 /* iOS button gradient: https://stackoverflow.com/q/5438567 */
1366 -webkit-appearance: none;
1369 #settings-menu, #help-button {
1374 #settings-menu > a, #help-button > a, #copy-path {
1379 #settings-menu > a, #help-button > a {
1383 background-color: var(--button-background-color);
1384 border: 1px solid var(--border-color);
1386 color: var(--settings-button-color);
1389 #settings-menu > a:hover, #settings-menu > a:focus,
1390 #help-button > a:hover, #help-button > a:focus {
1391 border-color: var(--settings-button-border-focus);
1395 color: var(--copy-path-button-color);
1396 background: var(--main-background-color);
1404 filter: var(--copy-path-img-filter);
1406 #copy-path:hover > img {
1407 filter: var(--copy-path-img-hover-filter);
1410 @keyframes rotating {
1412 transform: rotate(0deg);
1415 transform: rotate(360deg);
1418 #settings-menu.rotate > a img {
1419 animation: rotating 2s linear infinite;
1424 /* Rare exception to specifying font sizes in rem. Since this is acting
1425 as an icon, it's okay to specify their sizes in pixels. */
1431 display: inline-block;
1433 font: 15px monospace;
1435 vertical-align: middle;
1436 border: solid 1px var(--border-color);
1439 color: var(--kbd--color);
1440 background-color: var(--kbd-background);
1441 box-shadow: inset 0 -1px 0 var(--kbd-box-shadow-color);
1452 details.dir-entry > summary::after {
1459 /* set width to cover gap between arrow and text */
1463 details[open].dir-entry > summary::after {
1467 details.dir-entry > summary::-webkit-details-marker,
1468 details.dir-entry > summary::marker {
1472 details.dir-entry > summary {
1479 details.dir-entry div.folders, details.dir-entry div.files {
1483 details.dir-entry a {
1487 /* We use CSS containment on the details elements because most sizeable elements
1488 of the page are contained in one of these. This also makes re-rendering
1489 faster on document changes (like closing and opening toggles).
1490 Unfortunately we can't yet specify contain: content or contain: strict
1491 because the [-]/[+] toggles extend past the boundaries of the <details>
1492 https://developer.mozilla.org/en-US/docs/Web/CSS/contain */
1493 details.rustdoc-toggle {
1498 /* The hideme class is used on summary tags that contain a span with
1499 placeholder text shown only when the toggle is closed. For instance,
1500 "Expand description" or "Show methods". */
1501 details.rustdoc-toggle > summary.hideme {
1505 details.rustdoc-toggle > summary {
1507 /* focus outline is shown on `::before` instead of this */
1510 details.rustdoc-toggle > summary::-webkit-details-marker,
1511 details.rustdoc-toggle > summary::marker {
1515 details.rustdoc-toggle > summary.hideme > span {
1519 details.rustdoc-toggle > summary::before {
1524 background-repeat: no-repeat;
1525 background-position: top left;
1526 display: inline-block;
1527 vertical-align: middle;
1531 details.rustdoc-toggle > summary.hideme > span,
1532 .more-examples-toggle summary, .more-examples-toggle .hide-more {
1533 color: var(--toggles-color);
1536 /* Screen readers see the text version at the end the line.
1537 Visual readers see the icon at the start of the line, but small and transparent. */
1538 details.rustdoc-toggle > summary::after {
1546 details.rustdoc-toggle > summary.hideme::after {
1547 /* "hideme" toggles already have a description when they're contracted */
1551 details.rustdoc-toggle > summary:focus::before,
1552 details.rustdoc-toggle > summary:hover::before {
1556 details.rustdoc-toggle > summary:focus-visible::before {
1557 /* The SVG is black, and gets turned white using a filter in the dark themes.
1558 Do the same with the outline.
1559 The dotted 1px style is copied from Firefox's focus ring style.
1561 outline: 1px dotted #000;
1562 outline-offset: 1px;
1565 details.rustdoc-toggle.top-doc > summary,
1566 details.rustdoc-toggle.top-doc > summary::before,
1567 details.rustdoc-toggle.non-exhaustive > summary,
1568 details.rustdoc-toggle.non-exhaustive > summary::before {
1572 details.non-exhaustive {
1576 details.rustdoc-toggle > summary.hideme::before {
1580 details.rustdoc-toggle > summary:not(.hideme)::before {
1586 .impl-items > details.rustdoc-toggle > summary:not(.hideme)::before {
1591 /* When a "hideme" summary is open and the "Expand description" or "Show
1592 methods" text is hidden, we want the [-] toggle that remains to not
1593 affect the layout of the items to its right. To do that, we use
1594 absolute positioning. Note that we also set position: relative
1595 on the parent <details> to make this work properly. */
1596 details.rustdoc-toggle[open] > summary.hideme {
1600 details.rustdoc-toggle[open] > summary.hideme > span {
1604 details.rustdoc-toggle[open] > summary::before,
1605 details.rustdoc-toggle[open] > summary.hideme::before {
1606 background-image: url("toggle-minus-31bbd6e4c77f5c96.svg");
1609 details.rustdoc-toggle > summary::before {
1610 background-image: url("toggle-plus-1092eb4930d581b0.svg");
1613 details.rustdoc-toggle[open] > summary::before,
1614 details.rustdoc-toggle[open] > summary.hideme::before {
1617 background-repeat: no-repeat;
1618 background-position: top left;
1619 display: inline-block;
1623 details.rustdoc-toggle[open] > summary::after,
1624 details.rustdoc-toggle[open] > summary.hideme::after {
1625 content: "Collapse";
1628 /* This is needed in docblocks to have the "â–¶" element to be on the same line. */
1629 .docblock summary > * {
1630 display: inline-block;
1633 /* In case there is no documentation before a code block, we need to add some margin at the top
1634 to prevent an overlay between the "collapse toggle" and the information tooltip.
1635 However, it's not needed with smaller screen width because the doc/code block is always put
1636 "one line" below. */
1637 .docblock > .example-wrap:first-child .tooltip {
1644 WARNING: RUSTDOC_MOBILE_BREAKPOINT MEDIA QUERY
1645 If you update this line, then you also need to update the line with the same warning
1648 @media (max-width: 700px) {
1649 /* When linking to an item with an `id` (for instance, by clicking a link in the sidebar,
1650 or visiting a URL with a fragment like `#method.new`, we don't want the item to be obscured
1651 by the topbar. Anything with an `id` gets scroll-margin-top equal to .mobile-topbar's size.
1654 scroll-margin-top: 45px;
1658 /* Sidebar should overlay main content, rather than pushing main content to the right.
1659 Turn off `display: flex` on the body element. */
1669 flex-direction: column;
1674 margin-left: initial;
1678 .out-of-band .since::before {
1686 /* Hide the logo and item name from the sidebar. Those are displayed
1687 in the mobile-topbar instead. */
1688 .sidebar .sidebar-logo,
1689 .sidebar .location {
1696 /* Hide the sidebar offscreen while not in use. Doing this instead of display: none means
1697 the sidebar stays visible for screen readers, which is useful for navigation. */
1702 /* Reduce height slightly to account for mobile topbar. */
1703 height: calc(100vh - 45px);
1707 /* The source view uses a different design for the sidebar toggle, and doesn't have a topbar,
1708 so don't bump down the main content or the sidebar. */
1710 .rustdoc.source .sidebar {
1718 .source-sidebar-expanded .source .sidebar,
1719 .sidebar:focus-within {
1723 .rustdoc.source > .sidebar {
1729 margin: auto 0.5em auto auto;
1731 /* Rare exception to specifying font sizes in rem. Since the topbar
1732 height is specified in pixels, this also has to be specified in
1733 pixels to avoid overflowing the topbar when the user sets a bigger
1738 .mobile-topbar h2 a {
1740 text-overflow: ellipsis;
1742 white-space: nowrap;
1745 .mobile-topbar .logo-container > img {
1748 margin: 5px 0 5px 20px;
1753 flex-direction: row;
1763 .sidebar-menu-toggle {
1765 /* Rare exception to specifying font sizes in rem. Since this is acting
1766 as an icon, it's okay to specify its sizes in pixels. */
1769 color: var(--main-color);
1781 display: none !important;
1784 #titles > button > div.count {
1788 #main-content > details.rustdoc-toggle > summary::before,
1789 #main-content > div > details.rustdoc-toggle > summary::before {
1802 border-top-right-radius: 3px;
1803 border-bottom-right-radius: 3px;
1808 .source-sidebar-expanded #sidebar-toggle {
1812 border-top-right-radius: unset;
1813 border-bottom-right-radius: unset;
1816 border-bottom: 1px solid;
1819 /* We don't display the help button on mobile devices. */
1824 /* Display an alternating layout on tablets and phones */
1825 .item-table, .item-row, .item-left, .item-right,
1826 .search-results > a, .search-results > a > div {
1830 /* Display an alternating layout on tablets and phones */
1831 .search-results > a {
1834 .search-results > a > div.desc, .item-right {
1838 .source-sidebar-expanded .source .sidebar {
1843 /* Position of the "[-]" element. */
1844 details.rustdoc-toggle:not(.top-doc) > summary {
1847 .impl-items > details.rustdoc-toggle > summary:not(.hideme)::before,
1848 #main-content > details.rustdoc-toggle:not(.top-doc) > summary::before,
1849 #main-content > div > details.rustdoc-toggle > summary::before {
1853 /* Align summary-nested and unnested item-info gizmos. */
1854 .impl-items > .item-info {
1865 nav.sidebar, nav.sub, .out-of-band, a.srclink, #copy-path,
1866 details.rustdoc-toggle[open] > summary::before, details.rustdoc-toggle > summary::before,
1867 details.rustdoc-toggle.top-doc > summary {
1880 @media (max-width: 464px) {
1886 overflow-wrap: break-word;
1887 overflow-wrap: anywhere;
1891 flex-direction: column;
1895 align-self: stretch;
1898 .sub-logo-container > img {
1906 .source-sidebar-expanded #sidebar-toggle {
1912 .implementors-toggle > summary,
1914 #implementors-list > .docblock,
1915 .impl-items > section,
1916 .impl-items > .rustdoc-toggle > summary,
1918 .methods > .rustdoc-toggle > summary
1920 margin-bottom: 0.75em;
1923 .variants > .docblock,
1924 .impl-items > .rustdoc-toggle[open]:not(:last-child),
1925 .methods > .rustdoc-toggle[open]:not(:last-child),
1926 .implementors-toggle[open]:not(:last-child) {
1930 #trait-implementations-list .impl-items > .rustdoc-toggle:not(:last-child),
1931 #synthetic-implementations-list .impl-items > .rustdoc-toggle:not(:last-child),
1932 #blanket-implementations-list .impl-items > .rustdoc-toggle:not(:last-child) {
1936 /* Begin: styles for --scrape-examples feature */
1938 .scraped-example-list .scrape-help {
1941 font-weight: normal;
1946 border-style: solid;
1947 border-radius: 50px;
1950 .scraped-example .code-wrapper {
1953 flex-direction: row;
1958 .scraped-example:not(.expanded) .code-wrapper {
1962 .scraped-example:not(.expanded) .code-wrapper pre {
1968 .scraped-example .code-wrapper .next,
1969 .scraped-example .code-wrapper .prev,
1970 .scraped-example .code-wrapper .expand {
1977 /* iOS button gradient: https://stackoverflow.com/q/5438567 */
1978 -webkit-appearance: none;
1981 .scraped-example .code-wrapper .prev {
1984 .scraped-example .code-wrapper .next {
1987 .scraped-example .code-wrapper .expand {
1991 .scraped-example:not(.expanded) .code-wrapper:before,
1992 .scraped-example:not(.expanded) .code-wrapper:after {
1999 .scraped-example:not(.expanded) .code-wrapper:before {
2002 .scraped-example:not(.expanded) .code-wrapper:after {
2006 .scraped-example .code-wrapper .src-line-numbers {
2011 .scraped-example .code-wrapper .src-line-numbers a,
2012 .scraped-example .code-wrapper .src-line-numbers span {
2016 .scraped-example .code-wrapper .example-wrap {
2023 .scraped-example:not(.expanded) .code-wrapper .example-wrap {
2027 .scraped-example .code-wrapper .example-wrap pre.rust {
2028 overflow-x: inherit;
2034 .more-examples-toggle {
2035 max-width: calc(100% + 25px);
2040 .more-examples-toggle .hide-more {
2046 .more-scraped-examples {
2049 flex-direction: row;
2052 .more-scraped-examples-inner {
2053 /* 20px is width of toggle-line + toggle-line-inner */
2054 width: calc(100% - 20px);
2058 align-self: stretch;
2065 .toggle-line-inner {
2070 .more-scraped-examples .scraped-example {
2071 margin-bottom: 20px;
2074 .more-scraped-examples .scraped-example:last-child {
2086 /* End: styles for --scrape-examples feature */