1 /* See FiraSans-LICENSE.txt for the Fira Sans license. */
3 font-family: 'Fira Sans';
6 src: local('Fira Sans'),
7 url("FiraSans-Regular.woff2") format("woff2");
11 font-family: 'Fira Sans';
14 src: local('Fira Sans Medium'),
15 url("FiraSans-Medium.woff2") format("woff2");
19 /* See SourceSerif4-LICENSE.md for the Source Serif 4 license. */
21 font-family: 'Source Serif 4';
24 src: local('Source Serif 4'),
25 url("SourceSerif4-Regular.ttf.woff2") format("woff2");
29 font-family: 'Source Serif 4';
32 src: local('Source Serif 4 Italic'),
33 url("SourceSerif4-It.ttf.woff2") format("woff2");
37 font-family: 'Source Serif 4';
40 src: local('Source Serif 4 Bold'),
41 url("SourceSerif4-Bold.ttf.woff2") format("woff2");
45 /* See SourceCodePro-LICENSE.txt for the Source Code Pro license. */
47 font-family: 'Source Code Pro';
50 /* Avoid using locally installed font because bad versions are in circulation:
51 * see https://github.com/rust-lang/rust/issues/24355 */
52 src: url("SourceCodePro-Regular.ttf.woff2") format("woff2");
56 font-family: 'Source Code Pro';
59 src: url("SourceCodePro-It.ttf.woff2") format("woff2");
63 font-family: 'Source Code Pro';
66 src: url("SourceCodePro-Semibold.ttf.woff2") format("woff2");
70 /* Avoid using legacy CJK serif fonts in Windows like Batang. */
72 font-family: 'NanumBarunGothic';
73 src: url("NanumBarunGothic.ttf.woff2") format("woff2");
75 unicode-range: U+AC00-D7AF, U+1100-11FF, U+3130-318F, U+A960-A97F, U+D7B0-D7FF;
79 -webkit-box-sizing: border-box;
80 -moz-box-sizing: border-box;
81 box-sizing: border-box;
84 /* This part handles the "default" theme being used depending on the system one. */
88 @media (prefers-color-scheme: light) {
93 @media (prefers-color-scheme: dark) {
99 /* General structure and fonts */
102 /* Line spacing at least 1.5 per Web Content Accessibility Guidelines
103 https://www.w3.org/WAI/WCAG21/Understanding/visual-presentation.html */
104 font: 1rem/1.5 "Source Serif 4", NanumBarunGothic, serif;
107 /* We use overflow-wrap: break-word for Safari, which doesn't recognize
108 `anywhere`: https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-wrap */
109 overflow-wrap: break-word;
110 /* Then override it with `anywhere`, which is required to make non-Safari browsers break
111 more aggressively when we want them to. */
112 overflow-wrap: anywhere;
114 -webkit-font-feature-settings: "kern", "liga";
115 -moz-font-feature-settings: "kern", "liga";
116 font-feature-settings: "kern", "liga";
118 background-color: var(--main-background-color);
119 color: var(--main-color);
123 font-size: 1.5rem; /* 24px */
126 font-size: 1.375rem; /* 22px */
129 font-size: 1.25rem; /* 20px */
131 h1, h2, h3, h4, h5, h6 {
135 margin: 25px 0 15px 0;
138 .docblock h3, .docblock h4, h5, h6 {
139 margin: 15px 0 5px 0;
141 .docblock > h2:first-child,
142 .docblock > h3:first-child,
143 .docblock > h4:first-child,
144 .docblock > h5:first-child,
145 .docblock > h6:first-child {
152 /* We use overflow-wrap: break-word for Safari, which doesn't recognize
153 `anywhere`: https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-wrap */
154 overflow-wrap: break-word;
155 /* Then override it with `anywhere`, which is required to make non-Safari browsers break
156 more aggressively when we want them to. */
157 overflow-wrap: anywhere;
162 justify-content: space-between;
166 /* The only headings that get underlines are:
167 Markdown-generated headings within the top-doc
168 Rustdoc-generated h2 section headings (e.g. "Implementations", "Required Methods", etc)
169 Underlines elsewhere in the documentation break up visual flow and tend to invert
170 section hierarchies. */
172 .top-doc .docblock > h3,
173 .top-doc .docblock > h4 {
174 border-bottom: 1px solid var(--headings-border-bottom-color);
177 font-size: 1.125rem; /* 18px */
189 h1, h2, h3, h4, h5, h6,
193 .search-results .result-name,
199 details.rustdoc-toggle.top-doc > summary,
200 details.rustdoc-toggle.non-exhaustive > summary,
201 .scraped-example-title,
202 .more-examples-toggle summary, .more-examples-toggle .hide-more,
204 /* This selector is for the items listed in the "all items" page. */
206 font-family: "Fira Sans", Arial, NanumBarunGothic, sans-serif;
211 .small-section-header a,
221 .result-name .primitive > i, .result-name .keyword > i,
225 color: var(--main-color);
228 .content span.enum, .content a.enum,
229 .content span.struct, .content a.struct,
230 .content span.union, .content a.union,
231 .content span.primitive, .content a.primitive,
232 .content span.type, .content a.type,
233 .content span.foreigntype, .content a.foreigntype {
234 color: var(--type-link-color);
237 .content span.trait, .content a.trait,
238 .content span.traitalias, .content a.traitalias {
239 color: var(--trait-link-color);
242 .content span.associatedtype, .content a.associatedtype,
243 .content span.constant, .content a.constant,
244 .content span.static, .content a.static {
245 color: var(--assoc-item-link-color);
248 .content span.fn, .content a.fn,
250 .content span.method, .content a.method,
251 .content span.tymethod, .content a.tymethod {
252 color: var(--function-link-color);
255 .content span.attr, .content a.attr,
256 .content span.derive, .content a.derive,
257 .content span.macro, .content a.macro {
258 color: var(--macro-link-color);
261 .content span.mod, .content a.mod {
262 color: var(--mod-link-color);
265 .content span.keyword, .content a.keyword {
266 color: var(--keyword-link-color);
270 color: var(--link-color);
276 ul ul, ol ul, ul ol, ol ol {
277 margin-bottom: .625em;
281 /* Paragraph spacing at least 1.5 times line spacing per Web Content Accessibility Guidelines.
282 Line-height is 1.5rem, so line spacing is .5rem; .75em is 1.5 times that.
283 https://www.w3.org/WAI/WCAG21/Understanding/visual-presentation.html */
286 /* For the last child of a div, the margin will be taken care of
287 by the margin-top of the next item. */
292 /* Fix some style changes due to normalize.css 8 */
295 /* Buttons on Safari have different default padding than other platforms. Make them the same. */
299 button#toggle-all-docs {
304 /* iOS button gradient: https://stackoverflow.com/q/5438567 */
305 -webkit-appearance: none;
309 /* end tweaks for normalize.css 8 */
320 padding: 10px 15px 40px 45px;
333 .source .width-limiter {
337 details:not(.rustdoc-toggle) summary {
341 code, pre, a.test-arrow, .code-header {
342 font-family: "Source Code Pro", monospace;
344 .docblock code, .docblock-short code {
348 .docblock pre code, .docblock-short pre code {
358 .source .content pre {
370 .sub-logo-container {
374 .sub-logo-container > img {
380 .sidebar, .mobile-topbar, .sidebar-menu-toggle {
381 background-color: var(--sidebar-background-color);
395 .rustdoc.source .sidebar {
402 border-right: 1px solid;
404 /* The sidebar is by default hidden */
408 .source .sidebar, #sidebar-toggle, #source-sidebar {
409 background-color: var(--sidebar-background-color);
412 #sidebar-toggle > button:hover, #sidebar-toggle > button:focus {
413 background-color: var(--sidebar-background-color-hover);
416 .source .sidebar > *:not(#sidebar-toggle) {
420 .source-sidebar-expanded .source .sidebar {
425 .source-sidebar-expanded .source .sidebar > *:not(#sidebar-toggle) {
433 /* Improve the scrollbar display on firefox */
435 scrollbar-width: initial;
436 scrollbar-color: var(--scrollbar-color);
439 scrollbar-width: thin;
440 scrollbar-color: var(--scrollbar-color);
443 /* Improve the scrollbar display on webkit-based browsers */
444 ::-webkit-scrollbar {
447 .sidebar::-webkit-scrollbar {
450 ::-webkit-scrollbar-track {
451 -webkit-box-shadow: inset 0;
452 background-color: var(--scrollbar-track-background-color);
454 .sidebar::-webkit-scrollbar-track {
455 background-color: var(--scrollbar-track-background-color);
457 ::-webkit-scrollbar-thumb, .sidebar::-webkit-scrollbar-thumb {
458 background-color: var(--scrollbar-thumb-background-color);
461 /* Everything else */
464 display: none !important;
467 .sidebar .logo-container {
471 justify-content: center;
475 overflow-wrap: break-word;
478 .logo-container > img {
483 ul.block, .block li {
494 margin-left: -0.25rem;
496 text-overflow: ellipsis;
501 overflow-wrap: anywhere;
507 font-size: 1.125rem; /* 18px */
517 .sidebar a, .sidebar .current {
518 color: var(--sidebar-link-color);
522 background-color: var(--sidebar-current-link-background-color);
525 .sidebar-elems .block {
529 .sidebar-elems .block li a {
537 .source .content pre.rust {
542 .rustdoc .example-wrap {
547 /* For the last child of a div, the margin will be taken care of
548 by the margin-top of the next item. */
549 .rustdoc .example-wrap:last-child {
553 .rustdoc .example-wrap > pre {
559 .rustdoc .example-wrap > pre.example-line-numbers,
560 .rustdoc .example-wrap > pre.src-line-numbers {
564 -webkit-user-select: none;
565 -moz-user-select: none;
566 -ms-user-select: none;
570 .example-line-numbers {
573 border-top-left-radius: 5px;
574 border-bottom-left-radius: 5px;
575 border-color: var(--example-line-numbers-border-color);
578 .src-line-numbers span {
580 color: var(--src-line-numbers-span-color);
582 .src-line-numbers .line-highlighted {
583 background-color: var(--src-line-number-highlighted-background-color);
585 .src-line-numbers :target {
586 background-color: transparent;
594 overflow-wrap: break-word;
595 overflow-wrap: anywhere;
597 text-overflow: ellipsis;
599 /* Wrap non-pre code blocks (`text`) but not (```text```). */
600 .docblock > :not(pre) > code,
601 .docblock-short > code {
602 white-space: pre-wrap;
605 .top-doc .docblock h2 { font-size: 1.375rem; }
606 .top-doc .docblock h3 { font-size: 1.25rem; }
607 .top-doc .docblock h4,
608 .top-doc .docblock h5 {
611 .top-doc .docblock h6 {
615 .docblock h5 { font-size: 1rem; }
616 .docblock h6 { font-size: 0.875rem; }
623 .docblock > :not(.more-examples-toggle):not(.example-wrap) {
633 .docblock code, .docblock-short code,
634 pre, .rustdoc.source .example-wrap {
635 background-color: var(--code-block-background-color);
644 width: calc(100% - 2px);
647 border-collapse: collapse;
652 border: 1px dashed var(--border-color);
659 border: 1px solid var(--border-color);
662 /* Shift "where ..." part of method or fn definition down a line */
679 #main-content > .item-info {
686 flex-flow: row nowrap;
687 margin: 4px 0 25px 0;
700 .source .search-form {
705 text-decoration: none;
708 .small-section-header {
710 justify-content: space-between;
714 .small-section-header:hover > .anchor {
718 .impl:hover > .anchor, .trait-impl:hover > .anchor {
719 display: inline-block;
726 background: none !important;
731 .small-section-header > .anchor {
735 h2.small-section-header > .anchor {
742 .main-heading a:hover,
743 .example-wrap > pre.rust a:hover,
745 .docblock a:not(.test-arrow):not(.scrape-help):hover,
746 .docblock-short a:not(.test-arrow):not(.scrape-help):hover,
748 text-decoration: underline;
751 .crate.block a.current { font-weight: 500; }
753 /* In most contexts we use `overflow-wrap: anywhere` to ensure that we can wrap
754 as much as needed on mobile (see
755 src/test/rustdoc-gui/type-declaration-overflow.goml for an example of why
756 this matters). The `anywhere` value means:
758 "Soft wrap opportunities introduced by the word break are considered when
759 calculating min-content intrinsic sizes."
761 https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-wrap#values
763 For table layouts, that becomes a problem: the browser tries to make each
764 column as narrow as possible, and `overflow-wrap: anywhere` means it can do
765 so by breaking words - even if some other column could be shrunk without
766 breaking words! This shows up, for instance, in the `Structs` / `Modules` /
767 `Functions` (etcetera) sections of a module page, and when a docblock
770 So, for table layouts, override the default with break-word, which does
771 _not_ affect min-content intrinsic sizes.
775 overflow-wrap: break-word;
784 .item-left, .item-right {
788 padding-right: 1.25rem;
791 .search-results-title {
794 /* flex layout allows shrinking the <select> appropriately if it becomes too large */
795 display: inline-flex;
797 /* make things look like in a line, despite the fact that we're using a layout
798 with boxes (i.e. from the flex layout) */
799 align-items: baseline;
802 display: inline-block;
803 /* ensures that 100% in properties of #crate-search-div:after
804 are relative to the size of this div */
806 /* allows this div (and with it the <select>-element "#crate-search") to be shrunk */
811 /* keep these two in sync with "@-moz-document url-prefix()" below */
812 padding: 0 23px 0 4px;
813 /* prevents the <select> from overflowing the containing div in case it's shrunk */
815 /* contents can overflow because of max-width limit, then show ellipsis */
816 text-overflow: ellipsis;
817 border: 1px solid var(--border-color);
821 -moz-appearance: none;
822 -webkit-appearance: none;
823 /* Removes default arrow from firefox */
825 background-color: var(--main-background-color);
830 /* cancel stylistic differences in padding in firefox
831 for "appearance: none"-style (or equivalent) <select>s */
832 @-moz-document url-prefix() {
834 padding-left: 0px; /* == 4px - 4px */
835 padding-right: 19px; /* == 23px - 4px */
838 /* pseudo-element for holding the dropdown-arrow image; needs to be a separate thing
839 so that we can apply CSS-filters to change the arrow color in themes */
840 #crate-search-div::after {
841 /* lets clicks through! */
842 pointer-events: none;
843 /* completely covers the underlying div */
850 background-repeat: no-repeat;
851 background-size: 20px;
852 background-position: calc(100% - 2px) 56%;
853 /* image is black color, themes should apply a "filter" property to change the color */
854 background-image: /* AUTOREPLACE: */url("down-arrow.svg");
856 #crate-search > option {
860 /* Override Normalize.css: it has a rule that sets
861 -webkit-appearance: textfield for search inputs. That
862 causes rounded corners and no border on iOS Safari. */
863 -webkit-appearance: none;
865 border: 1px solid var(--border-color);
870 background-color: var(--button-background-color);
871 color: var(--search-color);
873 .search-input:focus {
874 border-color: var(--search-input-focused-border-color);
881 .search-results.active {
885 .search-results .desc > span {
887 text-overflow: ellipsis;
892 .search-results > a {
894 /* A little margin ensures the browser's outlining of focused links has room to display. */
897 border-bottom: 1px solid #aaa3;
900 .search-results > a > div {
905 .search-results .result-name, .search-results div.desc {
908 .search-results .result-name {
912 .search-results a:hover,
913 .search-results a:focus {
914 background-color: var(--search-result-link-focus-background-color);
925 border: 1px solid var(--border-color);
929 /* This rule is to draw the little arrow connecting the settings menu to the gear icon. */
934 border: solid var(--border-color);
935 border-width: 1px 1px 0 0;
936 display: inline-block;
938 transform: rotate(-45deg);
942 .popover, .popover::before {
943 background-color: var(--main-background-color);
944 color: var(--main-color);
947 /* use larger max-width for help popover, but not for help.html */
952 #help.popover::before {
960 margin-right: 0.5rem;
962 #help span.top, #help span.bottom {
969 border-bottom: 1px solid var(--border-color);
975 border-top: 1px solid var(--border-color);
977 .side-by-side > div {
980 padding: 0 20px 20px 17px;
985 /* This min-height is needed to unify the height of the stab elements because some of them
991 white-space: pre-wrap;
998 color: var(--main-color);
999 background-color: var(--stab-background-color);
1002 .stab.portability > code {
1004 color: var(--stab-code-color);
1009 margin-right: 0.3rem;
1012 /* This is to prevent the `.stab` elements to overflow the .docblock elements. */
1018 /* Black one-pixel outline around emoji shapes */
1028 .import-item .stab {
1030 display: inline-block;
1031 font-size: 0.875rem;
1034 margin-left: 0.3125em;
1036 vertical-align: text-bottom;
1039 .module-item.unstable,
1040 .import-item.unstable {
1045 font-weight: normal;
1057 color: var(--right-side-color);
1065 /* Code highlighting */
1067 color: var(--code-highlight-kw-color);
1070 color: var(--code-highlight-kw-2-color);
1072 pre.rust .lifetime {
1073 color: var(--code-highlight-lifetime-color);
1075 pre.rust .prelude-ty {
1076 color: var(--code-highlight-prelude-color);
1078 pre.rust .prelude-val {
1079 color: var(--code-highlight-prelude-val-color);
1082 color: var(--code-highlight-string-color);
1085 color: var(--code-highlight-number-color);
1087 pre.rust .bool-val {
1088 color: var(--code-highlight-literal-color);
1091 color: var(--code-highlight-self-color);
1094 color: var(--code-highlight-attribute-color);
1097 pre.rust .macro-nonterminal {
1098 color: var(--code-highlight-macro-color);
1100 pre.rust .question-mark {
1102 color: var(--code-highlight-question-mark-color);
1105 color: var(--code-highlight-comment-color);
1107 pre.rust .doccomment {
1108 color: var(--code-highlight-doc-comment-color);
1111 .example-wrap.compile_fail,
1112 .example-wrap.should_panic {
1113 border-left: 2px solid var(--codeblock-error-color);
1116 .ignore.example-wrap {
1117 border-left: 2px solid var(--codeblock-ignore-color);
1120 .example-wrap.compile_fail:hover,
1121 .example-wrap.should_panic:hover {
1122 border-left: 2px solid var(--codeblock-error-hover-color);
1125 .example-wrap.ignore:hover {
1126 border-left: 2px solid var(--codeblock-ignore-hover-color);
1129 .example-wrap.compile_fail .tooltip,
1130 .example-wrap.should_panic .tooltip {
1131 color: var(--codeblock-error-color);
1134 .example-wrap.ignore .tooltip {
1135 color: var(--codeblock-ignore-color);
1138 .example-wrap.compile_fail:hover .tooltip,
1139 .example-wrap.should_panic:hover .tooltip {
1140 color: var(--codeblock-error-hover-color);
1143 .example-wrap.ignore:hover .tooltip {
1144 color: var(--codeblock-ignore-hover-color);
1147 .example-wrap .tooltip {
1155 .example-wrap .tooltip::after {
1158 padding: 5px 3px 3px 3px;
1162 border: 1px solid var(--border-color);
1169 .example-wrap .tooltip::before {
1176 border-style: solid;
1181 .example-wrap.ignore .tooltip::after {
1182 content: "This example is not tested";
1184 .example-wrap.compile_fail .tooltip::after {
1185 content: "This example deliberately fails to compile";
1187 .example-wrap.should_panic .tooltip::after {
1188 content: "This example panics";
1190 .example-wrap.edition .tooltip::after {
1191 content: "This code runs with edition " attr(data-edition);
1194 .example-wrap .tooltip:hover::before, .example-wrap .tooltip:hover::after {
1198 .example-wrap.compile_fail .tooltip,
1199 .example-wrap.should_panic .tooltip,
1200 .example-wrap.ignore .tooltip {
1206 display: inline-block;
1209 padding: 5px 10px 5px 10px;
1211 font-size: 1.375rem;
1216 .example-wrap:hover .test-arrow {
1217 visibility: visible;
1222 color: var(--code-attribute-color);
1230 .out-of-band > span.since {
1236 font-size: 1.125rem;
1237 margin-bottom: 10px;
1249 margin-bottom: 40px;
1252 .sub-variant > .sub-variant-field {
1256 :target > code, :target > .code-header {
1264 .notable-traits-tooltip {
1265 display: inline-block;
1269 .notable-traits:hover .notable-traits-tooltiptext,
1270 .notable-traits .notable-traits-tooltiptext.force-tooltip {
1271 display: inline-block;
1274 .notable-traits .notable-traits-tooltiptext {
1276 padding: 5px 3px 3px 3px;
1286 .notable-traits-tooltip::after {
1287 /* The margin on the tooltip does not capture hover events,
1288 this extends the area of hover enough so that mouse hover is not
1289 lost when moving the mouse to the tooltip */
1290 content: "\00a0\00a0\00a0";
1293 .notable-traits .docblock {
1297 .notable-traits .notable {
1299 margin-bottom: 13px;
1300 font-size: 1.1875rem;
1305 .notable-traits .docblock code.content {
1317 .search-failed.active {
1321 .search-failed > ul {
1330 flex-direction: row;
1337 font-size: 1.125rem;
1340 border-top: 2px solid;
1346 #titles > button > div.count {
1347 display: inline-block;
1362 border-bottom: 1px solid;
1365 justify-content: center;
1366 align-items: center;
1373 #source-sidebar > .title {
1376 border-bottom: 1px solid var(--border-color);
1379 #sidebar-toggle > button {
1393 /* work around button layout strangeness: https://stackoverflow.com/q/7271561 */
1395 /* iOS button gradient: https://stackoverflow.com/q/5438567 */
1396 -webkit-appearance: none;
1399 #settings-menu, #help-button {
1404 #settings-menu > a, #help-button > a, #copy-path {
1410 #settings-menu > a, #help-button > a {
1414 background-color: var(--button-background-color);
1415 border: 1px solid var(--border-color);
1420 color: var(--copy-path-button-color);
1421 background: var(--main-background-color);
1429 filter: var(--copy-path-img-filter);
1431 #copy-path:hover > img {
1432 filter: var(--copy-path-img-hover-filter);
1435 @keyframes rotating {
1437 transform: rotate(0deg);
1440 transform: rotate(360deg);
1443 #settings-menu.rotate > a img {
1444 animation: rotating 2s linear infinite;
1449 /* Rare exception to specifying font sizes in rem. Since this is acting
1450 as an icon, it's okay to specify their sizes in pixels. */
1456 display: inline-block;
1458 font: 15px monospace;
1460 vertical-align: middle;
1461 border: solid 1px var(--border-color);
1474 details.dir-entry > summary::after {
1481 /* set width to cover gap between arrow and text */
1485 details[open].dir-entry > summary::after {
1489 details.dir-entry > summary::-webkit-details-marker,
1490 details.dir-entry > summary::marker {
1494 details.dir-entry > summary {
1501 details.dir-entry div.folders, details.dir-entry div.files {
1505 details.dir-entry a {
1509 /* We use CSS containment on the details elements because most sizeable elements
1510 of the page are contained in one of these. This also makes re-rendering
1511 faster on document changes (like closing and opening toggles).
1512 Unfortunately we can't yet specify contain: content or contain: strict
1513 because the [-]/[+] toggles extend past the boundaries of the <details>
1514 https://developer.mozilla.org/en-US/docs/Web/CSS/contain */
1515 details.rustdoc-toggle {
1520 /* The hideme class is used on summary tags that contain a span with
1521 placeholder text shown only when the toggle is closed. For instance,
1522 "Expand description" or "Show methods". */
1523 details.rustdoc-toggle > summary.hideme {
1527 details.rustdoc-toggle > summary {
1529 /* focus outline is shown on `::before` instead of this */
1532 details.rustdoc-toggle > summary::-webkit-details-marker,
1533 details.rustdoc-toggle > summary::marker {
1537 details.rustdoc-toggle > summary.hideme > span {
1541 details.rustdoc-toggle > summary::before {
1546 background-repeat: no-repeat;
1547 background-position: top left;
1548 display: inline-block;
1549 vertical-align: middle;
1553 details.rustdoc-toggle > summary.hideme > span,
1554 .more-examples-toggle summary, .more-examples-toggle .hide-more {
1555 color: var(--toggles-color);
1558 /* Screen readers see the text version at the end the line.
1559 Visual readers see the icon at the start of the line, but small and transparent. */
1560 details.rustdoc-toggle > summary::after {
1568 details.rustdoc-toggle > summary.hideme::after {
1569 /* "hideme" toggles already have a description when they're contracted */
1573 details.rustdoc-toggle > summary:focus::before,
1574 details.rustdoc-toggle > summary:hover::before {
1578 details.rustdoc-toggle > summary:focus-visible::before {
1579 /* The SVG is black, and gets turned white using a filter in the dark themes.
1580 Do the same with the outline.
1581 The dotted 1px style is copied from Firefox's focus ring style.
1583 outline: 1px dotted #000;
1584 outline-offset: 1px;
1587 details.rustdoc-toggle.top-doc > summary,
1588 details.rustdoc-toggle.top-doc > summary::before,
1589 details.rustdoc-toggle.non-exhaustive > summary,
1590 details.rustdoc-toggle.non-exhaustive > summary::before {
1594 details.non-exhaustive {
1598 details.rustdoc-toggle > summary.hideme::before {
1602 details.rustdoc-toggle > summary:not(.hideme)::before {
1608 .impl-items > details.rustdoc-toggle > summary:not(.hideme)::before {
1613 /* When a "hideme" summary is open and the "Expand description" or "Show
1614 methods" text is hidden, we want the [-] toggle that remains to not
1615 affect the layout of the items to its right. To do that, we use
1616 absolute positioning. Note that we also set position: relative
1617 on the parent <details> to make this work properly. */
1618 details.rustdoc-toggle[open] > summary.hideme {
1622 details.rustdoc-toggle[open] > summary.hideme > span {
1626 details.rustdoc-toggle[open] > summary::before,
1627 details.rustdoc-toggle[open] > summary.hideme::before {
1628 background-image: /* AUTOREPLACE: */url("toggle-minus.svg");
1631 details.rustdoc-toggle > summary::before {
1632 background-image: /* AUTOREPLACE: */url("toggle-plus.svg");
1635 details.rustdoc-toggle[open] > summary::before,
1636 details.rustdoc-toggle[open] > summary.hideme::before {
1639 background-repeat: no-repeat;
1640 background-position: top left;
1641 display: inline-block;
1645 details.rustdoc-toggle[open] > summary::after,
1646 details.rustdoc-toggle[open] > summary.hideme::after {
1647 content: "Collapse";
1650 /* This is needed in docblocks to have the "â–¶" element to be on the same line. */
1651 .docblock summary > * {
1652 display: inline-block;
1655 /* In case there is no documentation before a code block, we need to add some margin at the top
1656 to prevent an overlay between the "collapse toggle" and the information tooltip.
1657 However, it's not needed with smaller screen width because the doc/code block is always put
1658 "one line" below. */
1659 .docblock > .example-wrap:first-child .tooltip {
1666 WARNING: RUSTDOC_MOBILE_BREAKPOINT MEDIA QUERY
1667 If you update this line, then you also need to update the line with the same warning
1670 @media (max-width: 700px) {
1671 /* When linking to an item with an `id` (for instance, by clicking a link in the sidebar,
1672 or visiting a URL with a fragment like `#method.new`, we don't want the item to be obscured
1673 by the topbar. Anything with an `id` gets scroll-margin-top equal to .mobile-topbar's size.
1676 scroll-margin-top: 45px;
1681 /* Sidebar should overlay main content, rather than pushing main content to the right.
1682 Turn off `display: flex` on the body element. */
1692 flex-direction: column;
1697 margin-left: initial;
1701 .out-of-band .since::before {
1709 /* Hide the logo and item name from the sidebar. Those are displayed
1710 in the mobile-topbar instead. */
1711 .sidebar .sidebar-logo,
1712 .sidebar .location {
1719 /* Hide the sidebar offscreen while not in use. Doing this instead of display: none means
1720 the sidebar stays visible for screen readers, which is useful for navigation. */
1725 /* Reduce height slightly to account for mobile topbar. */
1726 height: calc(100vh - 45px);
1729 /* The source view uses a different design for the sidebar toggle, and doesn't have a topbar,
1730 so don't bump down the main content or the sidebar. */
1732 .rustdoc.source .sidebar {
1740 .source-sidebar-expanded .source .sidebar,
1741 .sidebar:focus-within {
1745 .rustdoc.source > .sidebar {
1751 margin: auto 0.5em auto auto;
1753 /* Rare exception to specifying font sizes in rem. Since the topbar
1754 height is specified in pixels, this also has to be specified in
1755 pixels to avoid overflowing the topbar when the user sets a bigger
1760 .mobile-topbar h2 a {
1762 text-overflow: ellipsis;
1764 white-space: nowrap;
1767 .mobile-topbar .logo-container {
1771 .mobile-topbar .logo-container > img {
1774 margin: 5px 0 5px 20px;
1779 flex-direction: row;
1789 .sidebar-menu-toggle {
1791 /* Rare exception to specifying font sizes in rem. Since this is acting
1792 as an icon, it's okay to specify its sizes in pixels. */
1795 color: var(--main-color);
1800 background-color: var(--sidebar-background-color);
1808 display: none !important;
1811 #titles > button > div.count {
1815 /* Because of ios, we need to actually have a full height sidebar title so the
1816 * actual sidebar can show up. But then we need to make it transparent so we don't
1817 * hide content. The filler just allows to create the background for the sidebar
1818 * title. But because of the absolute position, I had to lower the z-index.
1823 width: calc(100% - 45px);
1827 border-bottom: 1px solid;
1830 #main-content > details.rustdoc-toggle > summary::before,
1831 #main-content > div > details.rustdoc-toggle > summary::before {
1844 border-top-right-radius: 3px;
1845 border-bottom-right-radius: 3px;
1851 .source-sidebar-expanded #sidebar-toggle {
1855 border-top-right-radius: unset;
1856 border-bottom-right-radius: unset;
1859 border-bottom: 1px solid;
1862 .notable-traits .notable-traits-tooltiptext {
1867 /* We don't display the help button on mobile devices. */
1872 /* Display an alternating layout on tablets and phones */
1878 flex-flow: column wrap;
1880 .item-left, .item-right {
1884 /* Display an alternating layout on tablets and phones */
1885 .search-results > a {
1886 border-bottom: 1px solid #aaa9;
1889 .search-results .result-name, .search-results div.desc {
1892 .search-results div.desc, .item-right {
1896 .source-sidebar-expanded .source .sidebar {
1901 /* Position of the "[-]" element. */
1902 details.rustdoc-toggle:not(.top-doc) > summary {
1905 .impl-items > details.rustdoc-toggle > summary:not(.hideme)::before,
1906 #main-content > details.rustdoc-toggle:not(.top-doc) > summary::before,
1907 #main-content > div > details.rustdoc-toggle > summary::before {
1911 /* Align summary-nested and unnested item-info gizmos. */
1912 .impl-items > .item-info {
1923 nav.sidebar, nav.sub, .out-of-band, a.srclink, #copy-path,
1924 details.rustdoc-toggle[open] > summary::before, details.rustdoc-toggle > summary::before,
1925 details.rustdoc-toggle.top-doc > summary {
1938 @media (max-width: 464px) {
1944 overflow-wrap: break-word;
1945 overflow-wrap: anywhere;
1949 flex-direction: column;
1953 align-self: stretch;
1956 .sub-logo-container > img {
1964 .source-sidebar-expanded #sidebar-toggle {
1969 .implementors-toggle > summary,
1971 #implementors-list > .docblock,
1972 .impl-items > section,
1973 .impl-items > .rustdoc-toggle > summary,
1975 .methods > .rustdoc-toggle > summary
1977 margin-bottom: 0.75em;
1980 .impl-items > .rustdoc-toggle[open]:not(:last-child),
1981 .methods > .rustdoc-toggle[open]:not(:last-child),
1982 .implementors-toggle[open]:not(:last-child) {
1986 #trait-implementations-list .impl-items > .rustdoc-toggle:not(:last-child),
1987 #synthetic-implementations-list .impl-items > .rustdoc-toggle:not(:last-child),
1988 #blanket-implementations-list .impl-items > .rustdoc-toggle:not(:last-child) {
1992 /* Begin: styles for --scrape-examples feature */
1994 .scraped-example-list .scrape-help {
1997 font-weight: normal;
2001 background: transparent;
2003 border-style: solid;
2004 border-radius: 50px;
2007 .scraped-example .code-wrapper {
2010 flex-direction: row;
2015 .scraped-example:not(.expanded) .code-wrapper {
2019 .scraped-example:not(.expanded) .code-wrapper pre {
2025 .scraped-example .code-wrapper .next,
2026 .scraped-example .code-wrapper .prev,
2027 .scraped-example .code-wrapper .expand {
2033 .scraped-example .code-wrapper .prev {
2036 .scraped-example .code-wrapper .next {
2039 .scraped-example .code-wrapper .expand {
2043 .scraped-example:not(.expanded) .code-wrapper:before,
2044 .scraped-example:not(.expanded) .code-wrapper:after {
2051 .scraped-example:not(.expanded) .code-wrapper:before {
2054 .scraped-example:not(.expanded) .code-wrapper:after {
2058 .scraped-example .code-wrapper .src-line-numbers {
2063 .scraped-example .code-wrapper .src-line-numbers span {
2067 .scraped-example .code-wrapper .example-wrap {
2074 .scraped-example:not(.expanded) .code-wrapper .example-wrap {
2078 .scraped-example .code-wrapper .example-wrap pre.rust {
2079 overflow-x: inherit;
2085 .more-examples-toggle {
2086 max-width: calc(100% + 25px);
2091 .more-examples-toggle .hide-more {
2097 .more-scraped-examples {
2100 flex-direction: row;
2103 .more-scraped-examples-inner {
2104 /* 20px is width of toggle-line + toggle-line-inner */
2105 width: calc(100% - 20px);
2109 align-self: stretch;
2116 .toggle-line-inner {
2121 .more-scraped-examples .scraped-example {
2122 margin-bottom: 20px;
2125 .more-scraped-examples .scraped-example:last-child {
2137 /* End: styles for --scrape-examples feature */