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 {
155 justify-content: space-between;
159 .main-heading a:hover {
160 text-decoration: underline;
163 text-decoration: none;
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 */
183 border-bottom-style: none;
192 .impl-items .associatedconstant,
193 .methods .associatedconstant,
194 .impl-items .associatedtype,
195 .methods .associatedtype {
201 h1, h2, h3, h4, h5, h6,
206 .search-results .result-name,
210 details.rustdoc-toggle > summary::before,
212 #help-button > button,
213 details.rustdoc-toggle.top-doc > summary,
214 details.rustdoc-toggle.top-doc > summary::before,
215 details.rustdoc-toggle.non-exhaustive > summary,
216 details.rustdoc-toggle.non-exhaustive > summary::before,
217 .scraped-example-title,
218 .more-examples-toggle summary, .more-examples-toggle .hide-more,
220 /* This selector is for the items listed in the "all items" page. */
222 font-family: "Fira Sans", Arial, NanumBarunGothic, sans-serif;
227 .small-section-header a,
237 .result-name .primitive > i, .result-name .keyword > i,
238 .content .method .where,
240 .content .where.fmt-newline {
241 color: var(--main-color);
244 .content span.enum, .content a.enum,
245 .content span.struct, .content a.struct,
246 .content span.union, .content a.union,
247 .content span.primitive, .content a.primitive,
248 .content span.type, .content a.type,
249 .content span.foreigntype, .content a.foreigntype {
250 color: var(--type-link-color);
253 .content span.trait, .content a.trait,
254 .content span.traitalias, .content a.traitalias {
255 color: var(--trait-link-color);
258 .content span.associatedtype, .content a.associatedtype,
259 .content span.constant, .content a.constant,
260 .content span.static, .content a.static {
261 color: var(--assoc-item-link-color);
264 .content span.fn, .content a.fn,
266 .content span.method, .content a.method,
267 .content span.tymethod, .content a.tymethod {
268 color: var(--function-link-color);
271 .content span.attr, .content a.attr,
272 .content span.derive, .content a.derive,
273 .content span.macro, .content a.macro {
274 color: var(--macro-link-color);
277 .content span.mod, .content a.mod, .block a.current.mod {
278 color: var(--mod-link-color);
281 .content span.keyword, .content a.keyword {
282 color: var(--keyword-link-color);
286 color: var(--link-color);
292 ul ul, ol ul, ul ol, ol ol {
293 margin-bottom: .625em;
297 /* Paragraph spacing at least 1.5 times line spacing per Web Content Accessibility Guidelines.
298 Line-height is 1.5rem, so line spacing is .5rem; .75em is 1.5 times that.
299 https://www.w3.org/WAI/WCAG21/Understanding/visual-presentation.html */
302 /* For the last child of a div, the margin will be taken care of
303 by the margin-top of the next item. */
312 /* Fix some style changes due to normalize.css 8 */
315 /* Buttons on Safari have different default padding than other platforms. Make them the same. */
319 /* end tweaks for normalize.css 8 */
330 padding: 10px 15px 40px 45px;
343 .source .width-limiter {
347 details:not(.rustdoc-toggle) summary {
351 code, pre, a.test-arrow, .code-header {
352 font-family: "Source Code Pro", monospace;
354 .docblock code, .docblock-short code {
358 .docblock pre code, .docblock-short pre code {
368 .source .content pre {
386 .sub-logo-container {
391 .source .sub-logo-container {
395 .source .sub-logo-container > img {
401 .sidebar, .mobile-topbar, .sidebar-menu-toggle {
402 background-color: var(--sidebar-background-color);
417 .sidebar > .location {
422 overflow-wrap: anywhere;
425 .rustdoc.source .sidebar {
432 border-right: 1px solid;
434 /* The sidebar is by default hidden */
438 .rustdoc.source .sidebar .sidebar-logo {
442 .source .sidebar, #sidebar-toggle, #source-sidebar {
443 background-color: var(--sidebar-background-color);
446 #sidebar-toggle > button:hover, #sidebar-toggle > button:focus {
447 background-color: var(--sidebar-background-color-hover);
450 .source .sidebar > *:not(#sidebar-toggle) {
454 .source-sidebar-expanded .source .sidebar {
458 .source-sidebar-expanded .source .sidebar > *:not(#sidebar-toggle) {
466 /* Improve the scrollbar display on firefox */
468 scrollbar-width: initial;
469 scrollbar-color: var(--scrollbar-color);
472 scrollbar-width: thin;
473 scrollbar-color: var(--scrollbar-color);
476 /* Improve the scrollbar display on webkit-based browsers */
477 ::-webkit-scrollbar {
480 .sidebar::-webkit-scrollbar {
483 ::-webkit-scrollbar-track {
484 -webkit-box-shadow: inset 0;
485 background-color: var(--scrollbar-track-background-color);
487 .sidebar::-webkit-scrollbar-track {
488 background-color: var(--scrollbar-track-background-color);
490 ::-webkit-scrollbar-thumb, .sidebar::-webkit-scrollbar-thumb {
491 background-color: var(--scrollbar-thumb-background-color);
494 /* Everything else */
497 display: none !important;
500 .sidebar .logo-container {
504 justify-content: center;
508 overflow-wrap: break-word;
511 .logo-container > img {
516 .block ul, .block li {
526 margin-left: -0.25rem;
528 text-overflow: ellipsis;
538 margin-bottom: 0.7rem;
542 font-size: 1.125rem; /* 18px */
548 .sidebar-elems .block {
552 .sidebar-elems .block li a {
560 .source .content pre.rust {
566 .rustdoc .example-wrap {
570 .rustdoc .example-wrap {
573 /* For the last child of a div, the margin will be taken care of
574 by the margin-top of the next item. */
575 .rustdoc .example-wrap:last-child {
579 pre.example-line-numbers {
584 border-top-left-radius: 5px;
585 border-bottom-left-radius: 5px;
588 .example-wrap > pre.rust a:hover {
589 text-decoration: underline;
595 .rustdoc:not(.source) .example-wrap > pre:not(.example-line-numbers) {
600 .rustdoc:not(.source) .example-wrap > pre.src-line-numbers {
605 .rustdoc .example-wrap > pre {
613 .content > .example-wrap pre.src-line-numbers {
615 -webkit-user-select: none;
616 -moz-user-select: none;
617 -ms-user-select: none;
620 .src-line-numbers span {
625 overflow-wrap: break-word;
626 overflow-wrap: anywhere;
628 text-overflow: ellipsis;
630 /* Wrap non-pre code blocks (`text`) but not (```text```). */
631 .docblock > :not(pre) > code,
632 .docblock-short > code {
633 white-space: pre-wrap;
636 .top-doc .docblock h2 { font-size: 1.375rem; }
637 .top-doc .docblock h3 { font-size: 1.25rem; }
638 .top-doc .docblock h4,
639 .top-doc .docblock h5 {
642 .top-doc .docblock h6 {
646 .docblock h5 { font-size: 1rem; }
647 .docblock h6 { font-size: 0.875rem; }
654 .docblock > :not(.more-examples-toggle):not(.example-wrap) {
665 .method > .code-header, .trait-impl > .code-header {
673 /* We use overflow-wrap: break-word for Safari, which doesn't recognize
674 `anywhere`: https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-wrap */
675 overflow-wrap: break-word;
676 /* Then override it with `anywhere`, which is required to make non-Safari browsers break
677 more aggressively when we want them to. */
678 overflow-wrap: anywhere;
679 background-color: var(--main-background-color);
682 .docblock code, .docblock-short code,
683 pre, .rustdoc.source .example-wrap {
684 background-color: var(--code-block-background-color);
693 width: calc(100% - 2px);
696 border-collapse: collapse;
701 border: 1px dashed var(--border-color);
708 border: 1px solid var(--border-color);
711 .content .item-list {
712 list-style-type: none;
716 /* Shift "where ..." part of method or fn definition down a line */
717 .content .method .where,
719 .content .where.fmt-newline {
728 .content .item-info code {
732 .content .item-info {
736 #main-content > .item-info {
750 nav.sum { text-align: right; }
751 nav.sub form { display: inline; }
754 text-decoration: none;
757 .small-section-header {
759 justify-content: space-between;
763 .small-section-header:hover > .anchor {
767 .in-band:hover > .anchor, .impl:hover > .anchor, .method.trait-impl:hover > .anchor,
768 .type.trait-impl:hover > .anchor, .associatedconstant.trait-impl:hover > .anchor,
769 .associatedtype.trait-impl:hover > .anchor {
770 display: inline-block;
777 background: none !important;
782 .small-section-header > .anchor {
786 h2.small-section-header > .anchor {
794 .docblock a:not(.srclink):not(.test-arrow):not(.scrape-help):hover,
795 .docblock-short a:not(.srclink):not(.test-arrow):not(.scrape-help):hover, .item-info a {
796 text-decoration: underline;
799 .block a.current.crate { font-weight: 500; }
801 /* In most contexts we use `overflow-wrap: anywhere` to ensure that we can wrap
802 as much as needed on mobile (see
803 src/test/rustdoc-gui/type-declaration-overflow.goml for an example of why
804 this matters). The `anywhere` value means:
806 "Soft wrap opportunities introduced by the word break are considered when
807 calculating min-content intrinsic sizes."
809 https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-wrap#values
811 For table layouts, that becomes a problem: the browser tries to make each
812 column as narrow as possible, and `overflow-wrap: anywhere` means it can do
813 so by breaking words - even if some other column could be shrunk without
814 breaking words! This shows up, for instance, in the `Structs` / `Modules` /
815 `Functions` (etcetera) sections of a module page, and when a docblock
818 So, for table layouts, override the default with break-word, which does
819 _not_ affect min-content intrinsic sizes.
823 overflow-wrap: break-word;
832 .item-left, .item-right {
836 padding-right: 1.25rem;
845 .search-container > * {
848 .search-results-title {
851 /* flex layout allows shrinking the <select> appropriately if it becomes too large */
852 display: inline-flex;
854 /* make things look like in a line, despite the fact that we're using a layout
855 with boxes (i.e. from the flex layout) */
856 align-items: baseline;
859 display: inline-block;
860 /* ensures that 100% in properties of #crate-search-div:after
861 are relative to the size of this div */
863 /* allows this div (and with it the <select>-element "#crate-search") to be shrunk */
869 /* keep these two in sync with "@-moz-document url-prefix()" below */
872 /* prevents the <select> from overflowing the containing div in case it's shrunk */
874 /* contents can overflow because of max-width limit, then show ellipsis */
875 text-overflow: ellipsis;
876 border: 1px solid var(--border-color);
880 -moz-appearance: none;
881 -webkit-appearance: none;
882 /* Removes default arrow from firefox */
884 background-color: var(--main-background-color);
889 /* cancel stylistic differences in padding in firefox
890 for "appearance: none"-style (or equivalent) <select>s */
891 @-moz-document url-prefix() {
893 padding-left: 0px; /* == 4px - 4px */
894 padding-right: 19px; /* == 23px - 4px */
897 /* pseudo-element for holding the dropdown-arrow image; needs to be a separate thing
898 so that we can apply CSS-filters to change the arrow color in themes */
899 #crate-search-div::after {
900 /* lets clicks through! */
901 pointer-events: none;
902 /* completely covers the underlying div */
909 background-repeat: no-repeat;
910 background-size: 20px;
911 background-position: calc(100% - 2px) 56%;
912 /* image is black color, themes should apply a "filter" property to change the color */
913 background-image: /* AUTOREPLACE: */url("down-arrow.svg");
915 #crate-search > option {
919 /* Override Normalize.css: it has a rule that sets
920 -webkit-appearance: textfield for search inputs. That
921 causes rounded corners and no border on iOS Safari. */
922 -webkit-appearance: none;
923 /* Override Normalize.css: we have margins and do
924 not want to overflow - the `moz` attribute is necessary
925 until Firefox 29, too early to drop at this point */
926 -moz-box-sizing: border-box !important;
927 box-sizing: border-box !important;
929 border: 1px solid var(--border-color);
934 background-color: var(--button-background-color);
936 .search-input:focus {
937 border-color: var(--search-input-focused-border-color);
945 .search-results.active {
947 /* prevent overhanging tabs from moving the first result */
951 .search-results .desc > span {
953 text-overflow: ellipsis;
958 .search-results > a {
960 /* A little margin ensures the browser's outlining of focused links has room to display. */
963 border-bottom: 1px solid #aaa3;
966 .search-results > a > div {
971 .search-results .result-name, .search-results div.desc, .search-results .result-description {
974 .search-results .result-name {
986 border: 1px solid var(--border-color);
990 /* This rule is to draw the little arrow connecting the settings menu to the gear icon. */
995 border: solid var(--border-color);
996 border-width: 1px 1px 0 0;
997 display: inline-block;
999 transform: rotate(-45deg);
1003 .popover, .popover::before {
1004 background-color: var(--main-background-color);
1005 color: var(--main-color);
1008 #help-button .popover {
1012 #help-button .popover::before {
1020 margin-right: 0.5rem;
1022 #help-button span.top, #help-button span.bottom {
1025 font-size: 1.125rem;
1027 #help-button span.top {
1029 border-bottom: 1px solid var(--border-color);
1030 padding-bottom: 4px;
1033 #help-button span.bottom {
1035 border-top: 1px solid var(--border-color);
1037 .side-by-side > div {
1040 padding: 0 20px 20px 17px;
1045 /* This min-height is needed to unify the height of the stab elements because some of them
1050 align-items: center;
1051 white-space: pre-wrap;
1056 font-size: 0.875rem;
1057 font-weight: normal;
1062 margin-right: 0.3rem;
1065 /* This is to prevent the `.stab` elements to overflow the .docblock elements. */
1071 /* Black one-pixel outline around emoji shapes */
1081 .import-item .stab {
1083 display: inline-block;
1084 font-size: 0.875rem;
1087 margin-left: 0.3125em;
1089 vertical-align: text-bottom;
1092 .module-item.unstable,
1093 .import-item.unstable {
1098 font-weight: normal;
1111 color: var(--right-side-color);
1114 pre.rust .question-mark {
1118 .example-wrap.compile_fail,
1119 .example-wrap.should_panic {
1120 border-left: 2px solid var(--codeblock-error-color);
1123 .ignore.example-wrap {
1124 border-left: 2px solid var(--codeblock-ignore-color);
1127 .example-wrap.compile_fail:hover,
1128 .example-wrap.should_panic:hover {
1129 border-left: 2px solid var(--codeblock-error-hover-color);
1132 .example-wrap.ignore:hover {
1133 border-left: 2px solid var(--codeblock-ignore-hover-color);
1136 .example-wrap.compile_fail .tooltip,
1137 .example-wrap.should_panic .tooltip {
1138 color: var(--codeblock-error-color);
1141 .example-wrap.ignore .tooltip {
1142 color: var(--codeblock-ignore-color);
1145 .example-wrap.compile_fail:hover .tooltip,
1146 .example-wrap.should_panic:hover .tooltip {
1147 color: var(--codeblock-error-hover-color);
1150 .example-wrap.ignore:hover .tooltip {
1151 color: var(--codeblock-ignore-hover-color);
1154 .example-wrap .tooltip {
1162 .example-wrap .tooltip::after {
1165 padding: 5px 3px 3px 3px;
1169 border: 1px solid var(--border-color);
1176 .example-wrap .tooltip::before {
1183 border-style: solid;
1188 .example-wrap.ignore .tooltip::after {
1189 content: "This example is not tested";
1191 .example-wrap.compile_fail .tooltip::after {
1192 content: "This example deliberately fails to compile";
1194 .example-wrap.should_panic .tooltip::after {
1195 content: "This example panics";
1197 .example-wrap.edition .tooltip::after {
1198 content: "This code runs with edition " attr(data-edition);
1201 .example-wrap .tooltip:hover::before, .example-wrap .tooltip:hover::after {
1205 .example-wrap.compile_fail .tooltip,
1206 .example-wrap.should_panic .tooltip,
1207 .example-wrap.ignore .tooltip {
1213 display: inline-block;
1216 padding: 5px 10px 5px 10px;
1218 font-size: 1.375rem;
1223 .example-wrap:hover .test-arrow {
1224 visibility: visible;
1226 a.test-arrow:hover {
1227 text-decoration: none;
1232 color: var(--code-attribute-color);
1240 .out-of-band > span.since {
1246 font-size: 1.125rem;
1247 margin-bottom: 10px;
1248 border-bottom: none;
1254 border-bottom: none;
1261 margin-bottom: 40px;
1264 .sub-variant > .sub-variant-field {
1268 :target > code, :target > .code-header {
1276 .notable-traits-tooltip {
1277 display: inline-block;
1281 .notable-traits:hover .notable-traits-tooltiptext,
1282 .notable-traits .notable-traits-tooltiptext.force-tooltip {
1283 display: inline-block;
1286 .notable-traits .notable-traits-tooltiptext {
1288 padding: 5px 3px 3px 3px;
1298 .notable-traits-tooltip::after {
1299 /* The margin on the tooltip does not capture hover events,
1300 this extends the area of hover enough so that mouse hover is not
1301 lost when moving the mouse to the tooltip */
1302 content: "\00a0\00a0\00a0";
1305 .notable-traits .notable, .notable-traits .docblock {
1309 .notable-traits .notable {
1311 margin-bottom: 13px;
1312 font-size: 1.1875rem;
1317 .notable-traits .docblock code.content {
1334 .search-failed.active {
1338 .search-failed > ul {
1347 flex-direction: row;
1354 font-size: 1.125rem;
1357 border-top: 2px solid;
1363 #titles > button > div.count {
1364 display: inline-block;
1379 border-bottom: 1px solid;
1382 justify-content: center;
1383 align-items: center;
1390 #source-sidebar > .title {
1393 border-bottom: 1px solid var(--border-color);
1396 #sidebar-toggle > button {
1410 /* work around button layout strangeness: https://stackoverflow.com/q/7271561 */
1412 /* iOS button gradient: https://stackoverflow.com/q/5438567 */
1413 -webkit-appearance: none;
1416 #settings-menu, #help-button {
1421 #settings-menu > a, #help-button > button, #copy-path {
1424 border: 1px solid var(--border-color);
1430 #settings-menu > a, #help-button > button {
1434 background-color: var(--button-background-color);
1438 color: var(--copy-path-button-color);
1441 filter: var(--copy-path-img-filter);
1443 #copy-path:hover > img {
1444 filter: var(--copy-path-img-hover-filter);
1447 @keyframes rotating {
1449 transform: rotate(0deg);
1452 transform: rotate(360deg);
1455 #settings-menu.rotate > a img {
1456 animation: rotating 2s linear infinite;
1459 .setting-line .radio-line input:checked {
1460 box-shadow: inset 0 0 0 3px var(--main-background-color);
1461 background-color: var(--settings-input-color);
1463 .setting-line .radio-line input:focus {
1464 box-shadow: 0 0 1px 1px var(--settings-input-color);
1466 /* In here we combine both `:focus` and `:checked` properties. */
1467 .setting-line .radio-line input:checked:focus {
1468 box-shadow: inset 0 0 0 3px var(--main-background-color),
1469 0 0 2px 2px var(--settings-input-color);
1471 .setting-line .radio-line input:hover {
1472 border-color: var(--settings-input-color) !important;
1474 input:checked + .slider {
1475 background-color: var(--settings-input-color);
1478 #help-button > button {
1480 /* Rare exception to specifying font sizes in rem. Since this is acting
1481 as an icon, it's okay to specify their sizes in pixels. */
1488 background-color: var(--main-background-color);
1496 display: inline-block;
1498 font: 15px monospace;
1500 vertical-align: middle;
1501 border: solid 1px var(--border-color);
1514 details.dir-entry > summary {
1516 list-style-position: outside;
1520 details.dir-entry div.folders, details.dir-entry div.files {
1524 details.dir-entry a {
1528 /* We use CSS containment on the details elements because most sizeable elements
1529 of the page are contained in one of these. This also makes re-rendering
1530 faster on document changes (like closing and opening toggles).
1531 Unfortunately we can't yet specify contain: content or contain: strict
1532 because the [-]/[+] toggles extend past the boundaries of the <details>
1533 https://developer.mozilla.org/en-US/docs/Web/CSS/contain */
1534 details.rustdoc-toggle {
1538 /* The hideme class is used on summary tags that contain a span with
1539 placeholder text shown only when the toggle is closed. For instance,
1540 "Expand description" or "Show methods". */
1541 details.rustdoc-toggle > summary.hideme {
1545 details.rustdoc-toggle > summary {
1548 details.rustdoc-toggle > summary::-webkit-details-marker,
1549 details.rustdoc-toggle > summary::marker {
1553 details.rustdoc-toggle > summary.hideme > span {
1557 details.rustdoc-toggle > summary::before {
1562 background-repeat: no-repeat;
1563 background-position: top left;
1564 display: inline-block;
1565 vertical-align: middle;
1569 details.rustdoc-toggle > summary.hideme > span,
1570 details.rustdoc-toggle > summary::before,
1571 .more-examples-toggle summary, .more-examples-toggle .hide-more {
1572 color: var(--toggles-color);
1575 /* Screen readers see the text version at the end the line.
1576 Visual readers see the icon at the start of the line, but small and transparent. */
1577 details.rustdoc-toggle > summary::after {
1585 details.rustdoc-toggle > summary.hideme::after {
1586 /* "hideme" toggles already have a description when they're contracted */
1590 details.rustdoc-toggle > summary:focus::before,
1591 details.rustdoc-toggle > summary:hover::before {
1595 details.rustdoc-toggle.top-doc > summary,
1596 details.rustdoc-toggle.top-doc > summary::before,
1597 details.rustdoc-toggle.non-exhaustive > summary,
1598 details.rustdoc-toggle.non-exhaustive > summary::before {
1602 details.non-exhaustive {
1606 details.rustdoc-toggle > summary.hideme::before {
1610 details.rustdoc-toggle > summary:not(.hideme)::before {
1616 .impl-items > details.rustdoc-toggle > summary:not(.hideme)::before {
1621 /* When a "hideme" summary is open and the "Expand description" or "Show
1622 methods" text is hidden, we want the [-] toggle that remains to not
1623 affect the layout of the items to its right. To do that, we use
1624 absolute positioning. Note that we also set position: relative
1625 on the parent <details> to make this work properly. */
1626 details.rustdoc-toggle[open] > summary.hideme {
1630 details.rustdoc-toggle {
1634 details.rustdoc-toggle[open] > summary.hideme > span {
1638 details.rustdoc-toggle[open] > summary::before,
1639 details.rustdoc-toggle[open] > summary.hideme::before {
1640 background-image: /* AUTOREPLACE: */url("toggle-minus.svg");
1643 details.rustdoc-toggle > summary::before {
1644 background-image: /* AUTOREPLACE: */url("toggle-plus.svg");
1647 details.rustdoc-toggle[open] > summary::before,
1648 details.rustdoc-toggle[open] > summary.hideme::before {
1651 background-repeat: no-repeat;
1652 background-position: top left;
1653 display: inline-block;
1657 details.rustdoc-toggle[open] > summary::after,
1658 details.rustdoc-toggle[open] > summary.hideme::after {
1659 content: "Collapse";
1662 /* This is needed in docblocks to have the "â–¶" element to be on the same line. */
1663 .docblock summary > * {
1664 display: inline-block;
1670 WARNING: RUSTDOC_MOBILE_BREAKPOINT MEDIA QUERY;
1671 If you update this line, then you also need to update the line with the same warning
1672 in storage.js plus the media query with (max-width: 700px)
1674 @media (min-width: 701px) {
1675 /* In case there is no documentation before a code block, we need to add some margin at the top
1676 to prevent an overlay between the "collapse toggle" and the information tooltip.
1677 However, it's not needed with smaller screen width because the doc/code block is always put
1678 "one line" below. */
1679 .docblock > .example-wrap:first-child .tooltip {
1683 /* When we expand the sidebar on the source code page, we hide the logo on the left of the
1684 search bar to have more space. */
1685 .source-sidebar-expanded .source .sidebar + main .width-limiter .sub-logo-container.rust-logo {
1689 .source-sidebar-expanded .source .sidebar {
1695 WARNING: RUSTDOC_MOBILE_BREAKPOINT MEDIA QUERY
1696 If you update this line, then you also need to update the line with the same warning
1697 in storage.js plus the media query with (min-width: 701px)
1699 @media (max-width: 700px) {
1700 /* When linking to an item with an `id` (for instance, by clicking a link in the sidebar,
1701 or visiting a URL with a fragment like `#method.new`, we don't want the item to be obscured
1702 by the topbar. Anything with an `id` gets scroll-margin-top equal to .mobile-topbar's size.
1705 scroll-margin-top: 45px;
1710 /* Sidebar should overlay main content, rather than pushing main content to the right.
1711 Turn off `display: flex` on the body element. */
1721 flex-direction: column;
1726 margin-left: initial;
1730 .out-of-band .since::before {
1738 /* Hide the logo and item name from the sidebar. Those are displayed
1739 in the mobile-topbar instead. */
1740 .sidebar .sidebar-logo,
1741 .sidebar .location {
1748 /* Hide the sidebar offscreen while not in use. Doing this instead of display: none means
1749 the sidebar stays visible for screen readers, which is useful for navigation. */
1755 /* Reduce height slightly to account for mobile topbar. */
1756 height: calc(100vh - 45px);
1759 /* The source view uses a different design for the sidebar toggle, and doesn't have a topbar,
1760 so don't bump down the main content or the sidebar. */
1762 .rustdoc.source .sidebar {
1770 .source-sidebar-expanded .source .sidebar,
1771 .sidebar:focus-within {
1775 .rustdoc.source > .sidebar {
1779 .mobile-topbar .location a {
1784 .mobile-topbar .location {
1787 margin: auto 0.5em auto auto;
1788 text-overflow: ellipsis;
1790 white-space: nowrap;
1791 /* Rare exception to specifying font sizes in rem. Since the topbar
1792 height is specified in pixels, this also has to be specified in
1793 pixels to avoid overflowing the topbar when the user sets a bigger
1798 .mobile-topbar .logo-container {
1802 .mobile-topbar .logo-container > img {
1812 flex-direction: row;
1822 .source .mobile-topbar {
1826 .sidebar-menu-toggle {
1828 /* Rare exception to specifying font sizes in rem. Since this is acting
1829 as an icon, it's okay to specify its sizes in pixels. */
1836 background-color: var(--sidebar-background-color);
1848 display: none !important;
1851 #titles > button > div.count {
1855 /* Because of ios, we need to actually have a full height sidebar title so the
1856 * actual sidebar can show up. But then we need to make it transparent so we don't
1857 * hide content. The filler just allows to create the background for the sidebar
1858 * title. But because of the absolute position, I had to lower the z-index.
1863 width: calc(100% - 45px);
1867 border-bottom: 1px solid;
1870 #main-content > details.rustdoc-toggle > summary::before,
1871 #main-content > div > details.rustdoc-toggle > summary::before {
1884 border-top-right-radius: 3px;
1885 border-bottom-right-radius: 3px;
1891 .source-sidebar-expanded #sidebar-toggle {
1895 border-top-right-radius: unset;
1896 border-bottom-right-radius: unset;
1899 border-bottom: 1px solid;
1902 .notable-traits .notable-traits-tooltiptext {
1907 /* We don't display the help button on mobile devices. */
1912 /* Display an alternating layout on tablets and phones */
1918 flex-flow: column wrap;
1920 .item-left, .item-right {
1924 /* Display an alternating layout on tablets and phones */
1925 .search-results > a {
1926 border-bottom: 1px solid #aaa9;
1929 .search-results .result-name, .search-results div.desc, .search-results .result-description {
1932 .search-results div.desc, .search-results .result-description, .item-right {
1936 .source-sidebar-expanded .source .sidebar {
1941 /* Position of the "[-]" element. */
1942 details.rustdoc-toggle:not(.top-doc) > summary {
1945 .impl-items > details.rustdoc-toggle > summary:not(.hideme)::before,
1946 #main-content > details.rustdoc-toggle:not(.top-doc) > summary::before,
1947 #main-content > div > details.rustdoc-toggle > summary::before {
1951 /* Align summary-nested and unnested item-info gizmos. */
1952 .content .impl-items > .item-info {
1958 nav.sidebar, nav.sub, .out-of-band, a.srclink, #copy-path,
1959 details.rustdoc-toggle[open] > summary::before, details.rustdoc-toggle > summary::before,
1960 details.rustdoc-toggle.top-doc > summary {
1973 @media (max-width: 464px) {
1983 overflow-wrap: break-word;
1984 overflow-wrap: anywhere;
1988 flex-direction: column;
1991 .sub-logo-container {
1995 .source .sub-logo-container > img {
2003 .source-sidebar-expanded #sidebar-toggle {
2008 .method-toggle summary,
2009 .implementors-toggle summary,
2011 #implementors-list > .docblock {
2012 margin-bottom: 0.75em;
2015 .method-toggle[open]:not(:last-child) {
2019 .implementors-toggle[open]:not(:last-child) {
2023 #trait-implementations-list .method-toggle:not(:last-child),
2024 #synthetic-implementations-list .method-toggle:not(:last-child),
2025 #blanket-implementations-list .method-toggle:not(:last-child) {
2029 /* Begin: styles for --scrape-examples feature */
2031 .scraped-example-list .scrape-help {
2034 font-weight: normal;
2038 background: transparent;
2040 border-style: solid;
2041 border-radius: 50px;
2044 .scraped-example .code-wrapper {
2047 flex-direction: row;
2052 .scraped-example:not(.expanded) .code-wrapper {
2056 .scraped-example:not(.expanded) .code-wrapper pre {
2062 .scraped-example:not(.expanded) .code-wrapper pre.src-line-numbers {
2066 .scraped-example .code-wrapper .prev {
2074 .scraped-example .code-wrapper .next {
2082 .scraped-example .code-wrapper .expand {
2090 .scraped-example:not(.expanded) .code-wrapper:before {
2099 .scraped-example:not(.expanded) .code-wrapper:after {
2108 .scraped-example .code-wrapper .src-line-numbers {
2113 .scraped-example .code-wrapper .src-line-numbers span {
2117 .scraped-example .code-wrapper .example-wrap {
2124 .scraped-example:not(.expanded) .code-wrapper .example-wrap {
2128 .scraped-example .code-wrapper .example-wrap pre.rust {
2129 overflow-x: inherit;
2135 .more-examples-toggle {
2136 max-width: calc(100% + 25px);
2141 .more-examples-toggle .hide-more {
2147 .more-scraped-examples {
2150 flex-direction: row;
2153 .more-scraped-examples-inner {
2154 /* 20px is width of toggle-line + toggle-line-inner */
2155 width: calc(100% - 20px);
2159 align-self: stretch;
2166 .toggle-line-inner {
2171 .more-scraped-examples .scraped-example {
2172 margin-bottom: 20px;
2175 .more-scraped-examples .scraped-example:last-child {
2187 /* End: styles for --scrape-examples feature */