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: 20px 0 15px 0;
138 .docblock h3, .docblock h4, h5, h6 {
139 margin: 15px 0 5px 0;
144 border-bottom-color: var(--headings-border-bottom-color);
147 border-bottom-color: var(--headings-border-bottom-color);
152 justify-content: space-between;
156 .main-heading a:hover {
157 text-decoration: underline;
160 text-decoration: none;
162 /* The only headings that get underlines are:
163 Markdown-generated headings within the top-doc
164 Rustdoc-generated h2 section headings (e.g. "Implementations", "Required Methods", etc)
165 Underlines elsewhere in the documentation break up visual flow and tend to invert
166 section hierarchies. */
168 .top-doc .docblock > h3,
169 .top-doc .docblock > h4 {
170 border-bottom: 1px solid var(--headings-border-bottom-color);
173 font-size: 1.125rem; /* 18px */
180 border-bottom-style: none;
184 margin-bottom: 0.4em;
191 .impl-items .associatedconstant,
192 .methods .associatedconstant,
193 .impl-items .associatedtype,
194 .methods .associatedtype {
200 h1, h2, h3, h4, h5, h6,
205 .search-results .result-name,
209 details.rustdoc-toggle > summary::before,
210 .content ul.crate a.crate,
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. */
221 #main-content > ul.docblock > li > a {
222 font-family: "Fira Sans", Arial, NanumBarunGothic, sans-serif;
228 .small-section-header a,
238 .result-name .primitive > i, .result-name .keyword > i,
239 .content .method .where,
241 .content .where.fmt-newline {
242 color: var(--main-color);
248 ul ul, ol ul, ul ol, ol ol {
249 margin-bottom: .625em;
253 /* Paragraph spacing at least 1.5 times line spacing per Web Content Accessibility Guidelines.
254 Line-height is 1.5rem, so line spacing is .5rem; .75em is 1.5 times that.
255 https://www.w3.org/WAI/WCAG21/Understanding/visual-presentation.html */
263 /* Fix some style changes due to normalize.css 8 */
271 border-collapse: collapse;
285 /* Buttons on Safari have different default padding than other platforms. Make them the same. */
289 /* end tweaks for normalize.css 8 */
300 padding: 10px 15px 40px 45px;
313 .source .width-limiter {
317 details:not(.rustdoc-toggle) summary {
321 code, pre, a.test-arrow, .code-header {
322 font-family: "Source Code Pro", monospace;
324 .docblock code, .docblock-short code {
328 .docblock pre code, .docblock-short pre code {
334 .docblock.item-decl {
341 .source .content pre {
361 .sub-logo-container {
366 .source .sub-logo-container {
370 .source .sub-logo-container > img {
376 .sidebar, .mobile-topbar, .sidebar-menu-toggle {
377 background-color: var(--sidebar-background-color);
392 .sidebar > .location {
397 overflow-wrap: anywhere;
400 .rustdoc.source .sidebar {
407 border-right: 1px solid;
409 /* The sidebar is by default hidden */
413 .rustdoc.source .sidebar .sidebar-logo {
417 .source .sidebar, #sidebar-toggle, #source-sidebar {
418 background-color: var(--sidebar-background-color);
421 #sidebar-toggle > button:hover, #sidebar-toggle > button:focus {
422 background-color: var(--sidebar-background-color-hover);
425 .source .sidebar > *:not(#sidebar-toggle) {
430 .source-sidebar-expanded .source .sidebar {
434 .source-sidebar-expanded .source .sidebar > *:not(#sidebar-toggle) {
443 /* Improve the scrollbar display on firefox */
445 scrollbar-width: initial;
446 scrollbar-color: var(--scrollbar-color);
449 scrollbar-width: thin;
450 scrollbar-color: var(--scrollbar-color);
453 /* Improve the scrollbar display on webkit-based browsers */
454 ::-webkit-scrollbar {
457 .sidebar::-webkit-scrollbar {
460 ::-webkit-scrollbar-track {
461 -webkit-box-shadow: inset 0;
462 background-color: var(--scrollbar-track-background-color);
464 .sidebar::-webkit-scrollbar-track {
465 background-color: var(--scrollbar-track-background-color);
467 ::-webkit-scrollbar-thumb, .sidebar::-webkit-scrollbar-thumb {
468 background-color: var(--scrollbar-thumb-background-color);
471 /* Everything else */
474 display: none !important;
477 .sidebar .logo-container {
481 justify-content: center;
485 overflow-wrap: break-word;
488 .logo-container > img {
497 .location a:first-of-type {
504 .block ul, .block li {
514 margin-left: -0.25rem;
516 text-overflow: ellipsis;
526 margin-bottom: 0.7rem;
530 font-size: 1.125rem; /* 18px */
536 .sidebar-elems .block {
540 .sidebar-elems .block li a {
548 .source .content pre.rust {
554 .rustdoc .example-wrap {
555 display: inline-flex;
564 .example-wrap > pre.line-number {
569 border-top-left-radius: 5px;
570 border-bottom-left-radius: 5px;
573 .example-wrap > pre.rust a:hover {
574 text-decoration: underline;
580 .rustdoc:not(.source) .example-wrap > pre:not(.line-number) {
585 .rustdoc:not(.source) .example-wrap > pre.line-numbers {
590 .rustdoc .example-wrap > pre {
598 .content > .example-wrap pre.line-numbers {
600 -webkit-user-select: none;
601 -moz-user-select: none;
602 -ms-user-select: none;
610 overflow-wrap: break-word;
611 overflow-wrap: anywhere;
616 text-overflow: ellipsis;
619 /* Wrap non-pre code blocks (`text`) but not (```text```). */
620 .docblock > :not(pre) > code,
621 .docblock-short > :not(pre) > code {
622 white-space: pre-wrap;
625 .top-doc .docblock h2 { font-size: 1.375rem; }
626 .top-doc .docblock h3 { font-size: 1.25rem; }
627 .top-doc .docblock h4,
628 .top-doc .docblock h5 {
631 .top-doc .docblock h6 {
635 .docblock h5 { font-size: 1rem; }
636 .docblock h6 { font-size: 0.875rem; }
637 .docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5, .docblock h6 {
638 border-bottom-color: var(--headings-border-bottom-color);
646 .docblock > :not(.more-examples-toggle):not(.example-wrap) {
651 .content .out-of-band {
658 .method > .code-header, .trait-impl > .code-header {
659 max-width: calc(100% - 41px);
667 /* We use overflow-wrap: break-word for Safari, which doesn't recognize
668 `anywhere`: https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-wrap */
669 overflow-wrap: break-word;
670 /* Then override it with `anywhere`, which is required to make non-Safari browsers break
671 more aggressively when we want them to. */
672 overflow-wrap: anywhere;
673 background-color: var(--main-background-color);
676 .in-band > code, .in-band > .code-header {
677 display: inline-block;
680 .docblock code, .docblock-short code,
681 pre, .rustdoc.source .example-wrap {
682 background-color: var(--code-block-background-color);
691 width: calc(100% - 2px);
698 border: 1px dashed var(--border-color);
705 border: 1px solid var(--border-color);
708 .content .item-list {
709 list-style-type: none;
713 .content > .methods > .method {
717 /* Shift "where ..." part of method or fn definition down a line */
718 .content .method .where,
720 .content .where.fmt-newline {
729 .content .item-info code {
733 .content .item-info {
738 .content .impl-items .docblock, .content .impl-items .item-info {
742 #main-content > .item-info {
756 nav.sum { text-align: right; }
757 nav.sub form { display: inline; }
760 text-decoration: none;
761 background: transparent;
764 .small-section-header {
766 justify-content: space-between;
770 .small-section-header:hover > .anchor {
774 .in-band:hover > .anchor, .impl:hover > .anchor, .method.trait-impl:hover > .anchor,
775 .type.trait-impl:hover > .anchor, .associatedconstant.trait-impl:hover > .anchor,
776 .associatedtype.trait-impl:hover > .anchor {
777 display: inline-block;
784 background: none !important;
789 .small-section-header > .anchor {
793 h2.small-section-header > .anchor {
800 .docblock a:not(.srclink):not(.test-arrow):not(.scrape-help):hover,
801 .docblock-short a:not(.srclink):not(.test-arrow):not(.scrape-help):hover, .item-info a {
802 text-decoration: underline;
805 .block a.current.crate { font-weight: 500; }
807 /* In most contexts we use `overflow-wrap: anywhere` to ensure that we can wrap
808 as much as needed on mobile (see
809 src/test/rustdoc-gui/type-declaration-overflow.goml for an example of why
810 this matters). The `anywhere` value means:
812 "Soft wrap opportunities introduced by the word break are considered when
813 calculating min-content intrinsic sizes."
815 https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-wrap#values
817 For table layouts, that becomes a problem: the browser tries to make each
818 column as narrow as possible, and `overflow-wrap: anywhere` means it can do
819 so by breaking words - even if some other column could be shrunk without
820 breaking words! This shows up, for instance, in the `Structs` / `Modules` /
821 `Functions` (etcetera) sections of a module page, and when a docblock
824 So, for table layouts, override the default with break-word, which does
825 _not_ affect min-content intrinsic sizes.
829 overflow-wrap: break-word;
838 .item-left, .item-right {
842 padding-right: 1.25rem;
851 .search-container > * {
854 .search-results-title {
857 /* flex layout allows shrinking the <select> appropriately if it becomes too large */
858 display: inline-flex;
860 /* make things look like in a line, despite the fact that we're using a layout
861 with boxes (i.e. from the flex layout) */
862 align-items: baseline;
865 display: inline-block;
866 /* ensures that 100% in properties of #crate-search-div:after
867 are relative to the size of this div */
869 /* allows this div (and with it the <select>-element "#crate-search") to be shrunk */
875 /* keep these two in sync with "@-moz-document url-prefix()" below */
878 /* prevents the <select> from overflowing the containing div in case it's shrunk */
880 /* contents can overflow because of max-width limit, then show ellipsis */
881 text-overflow: ellipsis;
882 border: 1px solid var(--border-color);
886 -moz-appearance: none;
887 -webkit-appearance: none;
888 /* Removes default arrow from firefox */
890 background-color: var(--main-background-color);
892 /* cancel stylistic differences in padding in firefox
893 for "appearance: none"-style (or equivalent) <select>s */
894 @-moz-document url-prefix() {
896 padding-left: 0px; /* == 4px - 4px */
897 padding-right: 19px; /* == 23px - 4px */
900 /* pseudo-element for holding the dropdown-arrow image; needs to be a separate thing
901 so that we can apply CSS-filters to change the arrow color in themes */
902 #crate-search-div::after {
903 /* lets clicks through! */
904 pointer-events: none;
905 /* completely covers the underlying div */
912 background-repeat: no-repeat;
913 background-size: 20px;
914 background-position: calc(100% - 2px) 56%;
915 /* image is black color, themes should apply a "filter" property to change the color */
916 background-image: /* AUTOREPLACE: */url("down-arrow.svg");
918 #crate-search > option {
922 /* Override Normalize.css: it has a rule that sets
923 -webkit-appearance: textfield for search inputs. That
924 causes rounded corners and no border on iOS Safari. */
925 -webkit-appearance: none;
926 /* Override Normalize.css: we have margins and do
927 not want to overflow - the `moz` attribute is necessary
928 until Firefox 29, too early to drop at this point */
929 -moz-box-sizing: border-box !important;
930 box-sizing: border-box !important;
932 border: 1px solid var(--border-color);
937 background-color: var(--button-background-color);
939 .search-input:focus {
940 border-color: var(--search-input-focused-border-color);
948 .search-results.active {
950 /* prevent overhanging tabs from moving the first result */
954 .search-results .desc > span {
956 text-overflow: ellipsis;
961 .search-results > a {
963 /* A little margin ensures the browser's outlining of focused links has room to display. */
966 border-bottom: 1px solid #aaa3;
969 .search-results > a > div {
974 .search-results .result-name, .search-results div.desc, .search-results .result-description {
977 .search-results .result-name {
989 border: 1px solid var(--border-color);
993 /* This rule is to draw the little arrow connecting the settings menu to the gear icon. */
998 border: solid var(--border-color);
999 border-width: 1px 1px 0 0;
1000 display: inline-block;
1002 transform: rotate(-45deg);
1006 .popover, .popover::before {
1007 background-color: var(--main-background-color);
1008 color: var(--main-color);
1011 #help-button .popover {
1015 #help-button .popover::before {
1023 margin-right: 0.5rem;
1025 #help-button span.top, #help-button span.bottom {
1028 font-size: 1.125rem;
1030 #help-button span.top {
1034 border-bottom: 1px solid var(--border-color);
1035 padding-bottom: 4px;
1038 #help-button span.bottom {
1040 border-top: 1px solid var(--border-color);
1043 text-align: initial;
1045 .side-by-side > div {
1048 padding: 0 20px 20px 17px;
1053 /* This min-height is needed to unify the height of the stab elements because some of them
1058 align-items: center;
1059 white-space: pre-wrap;
1064 font-size: 0.875rem;
1065 font-weight: normal;
1074 margin-right: 0.3rem;
1077 /* Black one-pixel outline around emoji shapes */
1087 .import-item .stab {
1089 display: inline-block;
1090 font-size: 0.875rem;
1093 margin-left: 0.3125em;
1095 vertical-align: text-bottom;
1098 .module-item.unstable,
1099 .import-item.unstable {
1104 font-weight: normal;
1117 color: var(--right-side-color);
1121 .impl-items .srclink, .impl .srclink, .methods .srclink {
1122 /* Override header settings otherwise it's too bold */
1123 font-weight: normal;
1135 pre.rust .question-mark {
1139 .example-wrap.compile_fail,
1140 .example-wrap.should_panic {
1141 border-left: 2px solid var(--codeblock-error-color);
1144 .ignore.example-wrap {
1145 border-left: 2px solid var(--codeblock-ignore-color);
1148 .example-wrap.compile_fail:hover,
1149 .example-wrap.should_panic:hover {
1150 border-left: 2px solid var(--codeblock-error-hover-color);
1153 .example-wrap.ignore:hover {
1154 border-left: 2px solid var(--codeblock-ignore-hover-color);
1157 .example-wrap.compile_fail .tooltip,
1158 .example-wrap.should_panic .tooltip {
1159 color: var(--codeblock-error-color);
1162 .example-wrap.ignore .tooltip {
1163 color: var(--codeblock-ignore-color);
1166 .example-wrap.compile_fail:hover .tooltip,
1167 .example-wrap.should_panic:hover .tooltip {
1168 color: var(--codeblock-error-hover-color);
1171 .example-wrap.ignore:hover .tooltip {
1172 color: var(--codeblock-ignore-hover-color);
1175 .example-wrap .tooltip {
1183 .example-wrap .tooltip::after {
1186 padding: 5px 3px 3px 3px;
1190 border: 1px solid var(--border-color);
1197 .example-wrap .tooltip::before {
1204 border-style: solid;
1209 .example-wrap.ignore .tooltip::after {
1210 content: "This example is not tested";
1212 .example-wrap.compile_fail .tooltip::after {
1213 content: "This example deliberately fails to compile";
1215 .example-wrap.should_panic .tooltip::after {
1216 content: "This example panics";
1218 .example-wrap.edition .tooltip::after {
1219 content: "This code runs with edition " attr(data-edition);
1222 .example-wrap .tooltip:hover::before, .example-wrap .tooltip:hover::after {
1226 .example-wrap.compile_fail .tooltip,
1227 .example-wrap.should_panic .tooltip,
1228 .example-wrap.ignore .tooltip {
1234 display: inline-block;
1237 padding: 5px 10px 5px 10px;
1239 font-size: 1.375rem;
1244 .example-wrap:hover .test-arrow {
1245 visibility: visible;
1247 a.test-arrow:hover {
1248 text-decoration: none;
1253 color: var(--code-attribute-color);
1261 .out-of-band > span.since {
1267 font-size: 1.125rem;
1268 margin-bottom: 10px;
1269 border-bottom: none;
1275 border-bottom: none;
1282 margin-bottom: 40px;
1285 .sub-variant > .sub-variant-field {
1289 :target > code, :target > .code-header {
1297 .notable-traits-tooltip {
1298 display: inline-block;
1302 .notable-traits:hover .notable-traits-tooltiptext,
1303 .notable-traits .notable-traits-tooltiptext.force-tooltip {
1304 display: inline-block;
1307 .notable-traits .notable-traits-tooltiptext {
1309 padding: 5px 3px 3px 3px;
1319 .notable-traits-tooltip::after {
1320 /* The margin on the tooltip does not capture hover events,
1321 this extends the area of hover enough so that mouse hover is not
1322 lost when moving the mouse to the tooltip */
1323 content: "\00a0\00a0\00a0";
1326 .notable-traits .notable, .notable-traits .docblock {
1330 .notable-traits .notable {
1332 margin-bottom: 13px;
1333 font-size: 1.1875rem;
1338 .notable-traits .docblock code.content {
1344 /* Example code has the "Run" button that needs to be positioned relative to the pre */
1345 pre.rust.rust-example-rendered {
1360 .search-failed.active {
1364 .search-failed > ul {
1379 font-size: 1.125rem;
1382 border-top: 2px solid;
1385 #titles > button:first-child:last-child {
1387 width: calc(100% - 1px);
1390 #titles > button:not(:last-child) {
1392 width: calc(33.3% - 1px);
1395 #titles > button > div.count {
1396 display: inline-block;
1412 border-bottom: 1px solid;
1415 justify-content: center;
1416 align-items: center;
1424 #source-sidebar > .title {
1427 border-bottom: 1px solid var(--border-color);
1430 #sidebar-toggle > button {
1442 /* work around button layout strangeness: https://stackoverflow.com/q/7271561 */
1444 /* iOS button gradient: https://stackoverflow.com/q/5438567 */
1445 -webkit-appearance: none;
1448 #settings-menu, #help-button {
1453 #settings-menu > a, #help-button > button, #copy-path {
1456 border: 1px solid var(--border-color);
1461 #settings-menu > a, #help-button > button {
1465 background-color: var(--button-background-color);
1469 color: var(--copy-path-button-color);
1472 filter: var(--copy-path-img-filter);
1474 #copy-path:hover > img {
1475 filter: var(--copy-path-img-hover-filter);
1478 @keyframes rotating {
1480 transform: rotate(0deg);
1483 transform: rotate(360deg);
1486 #settings-menu.rotate > a img {
1487 animation: rotating 2s linear infinite;
1490 .setting-line .radio-line input:checked {
1491 box-shadow: inset 0 0 0 3px var(--main-background-color);
1492 background-color: var(--settings-input-color);
1494 .setting-line .radio-line input:focus {
1495 box-shadow: 0 0 1px 1px var(--settings-input-color);
1497 /* In here we combine both `:focus` and `:checked` properties. */
1498 .setting-line .radio-line input:checked:focus {
1499 box-shadow: inset 0 0 0 3px var(--main-background-color),
1500 0 0 2px 2px var(--settings-input-color);
1502 .setting-line .radio-line input:hover {
1503 border-color: var(--settings-input-color) !important;
1505 input:checked + .slider {
1506 background-color: var(--settings-input-color);
1509 #help-button > button {
1511 /* Rare exception to specifying font sizes in rem. Since this is acting
1512 as an icon, it's okay to specify their sizes in pixels. */
1519 background-color: var(--main-background-color);
1527 display: inline-block;
1529 font: 15px monospace;
1531 vertical-align: middle;
1532 border: solid 1px var(--border-color);
1537 #main-content > ul {
1540 #main-content > ul > li {
1552 details.dir-entry > summary {
1554 list-style-position: outside;
1558 details.dir-entry div.folders, details.dir-entry div.files {
1562 details.dir-entry a {
1566 /* The hideme class is used on summary tags that contain a span with
1567 placeholder text shown only when the toggle is closed. For instance,
1568 "Expand description" or "Show methods". */
1569 details.rustdoc-toggle > summary.hideme {
1573 details.rustdoc-toggle > summary {
1576 details.rustdoc-toggle > summary::-webkit-details-marker,
1577 details.rustdoc-toggle > summary::marker {
1581 details.rustdoc-toggle > summary.hideme > span {
1585 details.rustdoc-toggle > summary::before {
1590 background-repeat: no-repeat;
1591 background-position: top left;
1592 display: inline-block;
1593 vertical-align: middle;
1597 details.rustdoc-toggle > summary.hideme > span,
1598 details.rustdoc-toggle > summary::before,
1599 .more-examples-toggle summary, .more-examples-toggle .hide-more {
1600 color: var(--toggles-color);
1603 /* Screen readers see the text version at the end the line.
1604 Visual readers see the icon at the start of the line, but small and transparent. */
1605 details.rustdoc-toggle > summary::after {
1613 details.rustdoc-toggle > summary.hideme::after {
1614 /* "hideme" toggles already have a description when they're contracted */
1618 details.rustdoc-toggle > summary:focus::before,
1619 details.rustdoc-toggle > summary:hover::before {
1623 details.rustdoc-toggle.top-doc > summary,
1624 details.rustdoc-toggle.top-doc > summary::before,
1625 details.rustdoc-toggle.non-exhaustive > summary,
1626 details.rustdoc-toggle.non-exhaustive > summary::before {
1630 details.non-exhaustive {
1634 details.rustdoc-toggle > summary.hideme::before {
1638 details.rustdoc-toggle > summary:not(.hideme)::before {
1644 .impl-items > details.rustdoc-toggle > summary:not(.hideme)::before {
1649 /* When a "hideme" summary is open and the "Expand description" or "Show
1650 methods" text is hidden, we want the [-] toggle that remains to not
1651 affect the layout of the items to its right. To do that, we use
1652 absolute positioning. Note that we also set position: relative
1653 on the parent <details> to make this work properly. */
1654 details.rustdoc-toggle[open] > summary.hideme {
1658 details.rustdoc-toggle {
1662 details.rustdoc-toggle[open] > summary.hideme > span {
1666 details.rustdoc-toggle[open] > summary::before,
1667 details.rustdoc-toggle[open] > summary.hideme::before {
1668 background-image: /* AUTOREPLACE: */url("toggle-minus.svg");
1671 details.rustdoc-toggle > summary::before {
1672 background-image: /* AUTOREPLACE: */url("toggle-plus.svg");
1675 details.rustdoc-toggle[open] > summary::before,
1676 details.rustdoc-toggle[open] > summary.hideme::before {
1679 background-repeat: no-repeat;
1680 background-position: top left;
1681 display: inline-block;
1685 details.rustdoc-toggle[open] > summary::after,
1686 details.rustdoc-toggle[open] > summary.hideme::after {
1687 content: "Collapse";
1690 /* This is needed in docblocks to have the "â–¶" element to be on the same line. */
1691 .docblock summary > * {
1692 display: inline-block;
1698 WARNING: RUSTDOC_MOBILE_BREAKPOINT MEDIA QUERY;
1699 If you update this line, then you also need to update the line with the same warning
1700 in storage.js plus the media query with (max-width: 700px)
1702 @media (min-width: 701px) {
1703 /* In case there is no documentation before a code block, we need to add some margin at the top
1704 to prevent an overlay between the "collapse toggle" and the information tooltip.
1705 However, it's not needed with smaller screen width because the doc/code block is always put
1706 "one line" below. */
1707 .docblock > .example-wrap:first-child .tooltip {
1711 /* When we expand the sidebar on the source code page, we hide the logo on the left of the
1712 search bar to have more space. */
1713 .source-sidebar-expanded .source .sidebar + main .width-limiter .sub-logo-container.rust-logo {
1717 .source-sidebar-expanded .source .sidebar {
1723 WARNING: RUSTDOC_MOBILE_BREAKPOINT MEDIA QUERY
1724 If you update this line, then you also need to update the line with the same warning
1725 in storage.js plus the media query with (min-width: 701px)
1727 @media (max-width: 700px) {
1728 /* When linking to an item with an `id` (for instance, by clicking a link in the sidebar,
1729 or visiting a URL with a fragment like `#method.new`, we don't want the item to be obscured
1730 by the topbar. Anything with an `id` gets scroll-margin-top equal to .mobile-topbar's size.
1733 scroll-margin-top: 45px;
1738 /* Sidebar should overlay main content, rather than pushing main content to the right.
1739 Turn off `display: flex` on the body element. */
1749 flex-direction: column;
1752 .content .out-of-band {
1754 margin-left: initial;
1758 .content .out-of-band .since::before {
1766 /* Hide the logo and item name from the sidebar. Those are displayed
1767 in the mobile-topbar instead. */
1768 .sidebar .sidebar-logo,
1769 .sidebar .location {
1776 /* Hide the sidebar offscreen while not in use. Doing this instead of display: none means
1777 the sidebar stays visible for screen readers, which is useful for navigation. */
1783 /* Reduce height slightly to account for mobile topbar. */
1784 height: calc(100vh - 45px);
1787 /* The source view uses a different design for the sidebar toggle, and doesn't have a topbar,
1788 so don't bump down the main content or the sidebar. */
1790 .rustdoc.source .sidebar {
1798 .source-sidebar-expanded .source .sidebar,
1799 .sidebar:focus-within {
1803 .rustdoc.source > .sidebar {
1810 .mobile-topbar .location a {
1815 .mobile-topbar .location {
1818 margin: auto 0.5em auto auto;
1819 text-overflow: ellipsis;
1821 white-space: nowrap;
1822 /* Rare exception to specifying font sizes in rem. Since the topbar
1823 height is specified in pixels, this also has to be specified in
1824 pixels to avoid overflowing the topbar when the user sets a bigger
1829 .mobile-topbar .logo-container {
1833 .mobile-topbar .logo-container > img {
1843 flex-direction: row;
1853 .source .mobile-topbar {
1857 .sidebar-menu-toggle {
1859 /* Rare exception to specifying font sizes in rem. Since this is acting
1860 as an icon, it's okay to specify its sizes in pixels. */
1867 background-color: var(--sidebar-background-color);
1879 display: none !important;
1888 #titles > button > div.count {
1897 /* Because of ios, we need to actually have a full height sidebar title so the
1898 * actual sidebar can show up. But then we need to make it transparent so we don't
1899 * hide content. The filler just allows to create the background for the sidebar
1900 * title. But because of the absolute position, I had to lower the z-index.
1905 width: calc(100% - 45px);
1909 border-bottom: 1px solid;
1912 #main-content > details.rustdoc-toggle > summary::before,
1913 #main-content > div > details.rustdoc-toggle > summary::before {
1926 border-top-right-radius: 3px;
1927 border-bottom-right-radius: 3px;
1934 .source-sidebar-expanded #sidebar-toggle {
1938 border-top-right-radius: unset;
1939 border-bottom-right-radius: unset;
1942 border-bottom: 1px solid;
1949 #main-content > .line-numbers {
1953 .notable-traits .notable-traits-tooltiptext {
1958 /* We don't display the help button on mobile devices. */
1963 /* Display an alternating layout on tablets and phones */
1969 flex-flow: column wrap;
1971 .item-left, .item-right {
1975 /* Display an alternating layout on tablets and phones */
1976 .search-results > a {
1977 border-bottom: 1px solid #aaa9;
1980 .search-results .result-name, .search-results div.desc, .search-results .result-description {
1983 .search-results div.desc, .search-results .result-description, .item-right {
1987 .source-sidebar-expanded .source .sidebar {
1992 /* Position of the "[-]" element. */
1993 details.rustdoc-toggle:not(.top-doc) > summary {
1996 .impl-items > details.rustdoc-toggle > summary:not(.hideme)::before,
1997 #main-content > details.rustdoc-toggle:not(.top-doc) > summary::before,
1998 #main-content > div > details.rustdoc-toggle > summary::before {
2002 /* Align summary-nested and unnested item-info gizmos. */
2003 .content .impl-items > .item-info {
2009 nav.sidebar, nav.sub, .content .out-of-band, a.srclink, #copy-path,
2010 details.rustdoc-toggle[open] > summary::before, details.rustdoc-toggle > summary::before,
2011 details.rustdoc-toggle.top-doc > summary {
2024 @media (max-width: 464px) {
2025 #titles, #titles > button {
2038 overflow-wrap: break-word;
2039 overflow-wrap: anywhere;
2043 flex-direction: column;
2046 .sub-logo-container {
2050 .source .sub-logo-container > img {
2058 .source-sidebar-expanded #sidebar-toggle {
2063 .method-toggle summary,
2064 .implementors-toggle summary,
2066 margin-bottom: 0.75em;
2069 .method-toggle[open] {
2073 .implementors-toggle[open] {
2077 #trait-implementations-list .method-toggle,
2078 #synthetic-implementations-list .method-toggle,
2079 #blanket-implementations-list .method-toggle {
2083 /* Begin: styles for --scrape-examples feature */
2085 .scraped-example-list .scrape-help {
2088 font-weight: normal;
2092 background: transparent;
2094 border-style: solid;
2095 border-radius: 50px;
2098 .scraped-example .code-wrapper {
2101 flex-direction: row;
2106 .scraped-example:not(.expanded) .code-wrapper {
2110 .scraped-example:not(.expanded) .code-wrapper pre {
2116 .scraped-example:not(.expanded) .code-wrapper pre.line-numbers {
2120 .scraped-example .code-wrapper .prev {
2128 .scraped-example .code-wrapper .next {
2136 .scraped-example .code-wrapper .expand {
2144 .scraped-example:not(.expanded) .code-wrapper:before {
2153 .scraped-example:not(.expanded) .code-wrapper:after {
2162 .scraped-example .code-wrapper .line-numbers {
2167 .scraped-example .code-wrapper .line-numbers span {
2171 .scraped-example .code-wrapper .example-wrap {
2178 .scraped-example:not(.expanded) .code-wrapper .example-wrap {
2182 .scraped-example .code-wrapper .example-wrap pre.rust {
2183 overflow-x: inherit;
2189 .more-examples-toggle {
2190 max-width: calc(100% + 25px);
2195 .more-examples-toggle .hide-more {
2201 .more-scraped-examples {
2204 flex-direction: row;
2207 .more-scraped-examples-inner {
2208 /* 20px is width of toggle-line + toggle-line-inner */
2209 width: calc(100% - 20px);
2213 align-self: stretch;
2220 .toggle-line-inner {
2225 .more-scraped-examples .scraped-example {
2226 margin-bottom: 20px;
2229 .more-scraped-examples .scraped-example:last-child {
2241 /* End: styles for --scrape-examples feature */