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 #source-sidebar, #sidebar-toggle,
210 details.rustdoc-toggle > summary::before,
211 .content ul.crate a.crate,
213 #help-button > button,
214 details.rustdoc-toggle.top-doc > summary,
215 details.rustdoc-toggle.top-doc > summary::before,
216 details.rustdoc-toggle.non-exhaustive > summary,
217 details.rustdoc-toggle.non-exhaustive > summary::before,
218 .scraped-example-title,
219 .more-examples-toggle summary, .more-examples-toggle .hide-more,
221 /* This selector is for the items listed in the "all items" page. */
222 #main-content > ul.docblock > li > a {
223 font-family: "Fira Sans", Arial, NanumBarunGothic, sans-serif;
229 .small-section-header a,
239 .result-name .primitive > i, .result-name .keyword > i,
240 .content .method .where,
242 .content .where.fmt-newline {
243 color: var(--main-color);
249 ul ul, ol ul, ul ol, ol ol {
250 margin-bottom: .625em;
254 /* Paragraph spacing at least 1.5 times line spacing per Web Content Accessibility Guidelines.
255 Line-height is 1.5rem, so line spacing is .5rem; .75em is 1.5 times that.
256 https://www.w3.org/WAI/WCAG21/Understanding/visual-presentation.html */
264 /* Fix some style changes due to normalize.css 8 */
272 border-collapse: collapse;
286 /* Buttons on Safari have different default padding than other platforms. Make them the same. */
290 /* end tweaks for normalize.css 8 */
301 padding: 10px 15px 40px 45px;
314 .source .width-limiter {
318 details:not(.rustdoc-toggle) summary {
322 code, pre, a.test-arrow, .code-header {
323 font-family: "Source Code Pro", monospace;
325 .docblock code, .docblock-short code {
329 .docblock pre code, .docblock-short pre code {
335 .docblock.item-decl {
342 .source .content pre {
366 .sub-logo-container {
371 .source .sub-logo-container {
375 .source .sub-logo-container > img {
381 .sidebar, .mobile-topbar, .sidebar-menu-toggle {
382 background-color: var(--sidebar-background-color);
397 .sidebar > .location {
402 overflow-wrap: anywhere;
405 .rustdoc.source .sidebar {
412 border-right: 1px solid;
414 /* The sidebar is by default hidden */
418 .rustdoc.source .sidebar .sidebar-logo {
422 .source .sidebar, #sidebar-toggle, #source-sidebar {
423 background-color: var(--sidebar-background-color);
426 #sidebar-toggle > button:hover, #sidebar-toggle > button:focus {
427 background-color: var(--sidebar-background-color-hover);
430 .source .sidebar > *:not(#sidebar-toggle) {
435 .source-sidebar-expanded .source .sidebar {
439 .source-sidebar-expanded .source .sidebar > *:not(#sidebar-toggle) {
448 /* Improve the scrollbar display on firefox */
450 scrollbar-width: initial;
451 scrollbar-color: var(--scrollbar-color);
454 scrollbar-width: thin;
455 scrollbar-color: var(--scrollbar-color);
458 /* Improve the scrollbar display on webkit-based browsers */
459 ::-webkit-scrollbar {
462 .sidebar::-webkit-scrollbar {
465 ::-webkit-scrollbar-track {
466 -webkit-box-shadow: inset 0;
467 background-color: var(--scrollbar-track-background-color);
469 .sidebar::-webkit-scrollbar-track {
470 background-color: var(--scrollbar-track-background-color);
472 ::-webkit-scrollbar-thumb, .sidebar::-webkit-scrollbar-thumb {
473 background-color: var(--scrollbar-thumb-background-color);
476 /* Everything else */
479 display: none !important;
482 .sidebar .logo-container {
486 justify-content: center;
490 overflow-wrap: break-word;
493 .logo-container > img {
502 .location a:first-of-type {
509 .block ul, .block li {
519 margin-left: -0.25rem;
521 text-overflow: ellipsis;
531 margin-bottom: 0.7rem;
535 font-size: 1.125rem; /* 18px */
541 .sidebar-elems .block {
545 .sidebar-elems .block li a {
553 .source .content pre.rust {
559 .rustdoc .example-wrap {
560 display: inline-flex;
569 .example-wrap > pre.line-number {
574 border-top-left-radius: 5px;
575 border-bottom-left-radius: 5px;
578 .example-wrap > pre.rust a:hover {
579 text-decoration: underline;
585 .rustdoc:not(.source) .example-wrap > pre:not(.line-number) {
590 .rustdoc:not(.source) .example-wrap > pre.line-numbers {
595 .rustdoc .example-wrap > pre {
607 .content > .example-wrap pre.line-numbers {
609 -webkit-user-select: none;
610 -moz-user-select: none;
611 -ms-user-select: none;
619 overflow-wrap: break-word;
620 overflow-wrap: anywhere;
625 text-overflow: ellipsis;
628 /* Wrap non-pre code blocks (`text`) but not (```text```). */
629 .docblock > :not(pre) > code,
630 .docblock-short > :not(pre) > code {
631 white-space: pre-wrap;
634 .top-doc .docblock h2 { font-size: 1.375rem; }
635 .top-doc .docblock h3 { font-size: 1.25rem; }
636 .top-doc .docblock h4,
637 .top-doc .docblock h5 {
640 .top-doc .docblock h6 {
644 .docblock h5 { font-size: 1rem; }
645 .docblock h6 { font-size: 0.875rem; }
646 .docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5, .docblock h6 {
647 border-bottom-color: var(--headings-border-bottom-color);
655 .docblock > :not(.information):not(.more-examples-toggle) {
660 .content .out-of-band {
667 .method > .code-header, .trait-impl > .code-header {
668 max-width: calc(100% - 41px);
676 /* We use overflow-wrap: break-word for Safari, which doesn't recognize
677 `anywhere`: https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-wrap */
678 overflow-wrap: break-word;
679 /* Then override it with `anywhere`, which is required to make non-Safari browsers break
680 more aggressively when we want them to. */
681 overflow-wrap: anywhere;
682 background-color: var(--main-background-color);
685 .in-band > code, .in-band > .code-header {
686 display: inline-block;
689 .docblock code, .docblock-short code,
690 pre, .rustdoc.source .example-wrap {
691 background-color: var(--code-block-background-color);
699 border-spacing: 0 5px;
701 .content td { vertical-align: top; }
702 .content td:first-child { padding-right: 20px; }
703 .content td p:first-child { margin-top: 0; }
704 .content td h1, .content td h2 { margin-left: 0; font-size: 1.125rem; }
705 .content tr:first-child td { border-top: 0; }
709 width: calc(100% - 2px);
716 border: 1px dashed var(--border-color);
722 border: 1px solid var(--border-color);
725 .content .item-list {
726 list-style-type: none;
730 .content > .methods > .method {
734 /* Shift "where ..." part of method or fn definition down a line */
735 .content .method .where,
737 .content .where.fmt-newline {
746 .content .item-info code {
750 .content .item-info {
755 .content .impl-items .docblock, .content .impl-items .item-info {
759 #main-content > .item-info {
773 nav.sum { text-align: right; }
774 nav.sub form { display: inline; }
777 text-decoration: none;
778 background: transparent;
781 .small-section-header {
783 justify-content: space-between;
787 .small-section-header:hover > .anchor {
791 .in-band:hover > .anchor, .impl:hover > .anchor, .method.trait-impl:hover > .anchor,
792 .type.trait-impl:hover > .anchor, .associatedconstant.trait-impl:hover > .anchor,
793 .associatedtype.trait-impl:hover > .anchor {
794 display: inline-block;
801 background: none !important;
806 .small-section-header > .anchor {
810 h2.small-section-header > .anchor {
817 .docblock a:not(.srclink):not(.test-arrow):not(.scrape-help):hover,
818 .docblock-short a:not(.srclink):not(.test-arrow):not(.scrape-help):hover, .item-info a {
819 text-decoration: underline;
822 .block a.current.crate { font-weight: 500; }
824 /* In most contexts we use `overflow-wrap: anywhere` to ensure that we can wrap
825 as much as needed on mobile (see
826 src/test/rustdoc-gui/type-declaration-overflow.goml for an example of why
827 this matters). The `anywhere` value means:
829 "Soft wrap opportunities introduced by the word break are considered when
830 calculating min-content intrinsic sizes."
832 https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-wrap#values
834 For table layouts, that becomes a problem: the browser tries to make each
835 column as narrow as possible, and `overflow-wrap: anywhere` means it can do
836 so by breaking words - even if some other column could be shrunk without
837 breaking words! This shows up, for instance, in the `Structs` / `Modules` /
838 `Functions` (etcetera) sections of a module page, and when a docblock
841 So, for table layouts, override the default with break-word, which does
842 _not_ affect min-content intrinsic sizes.
846 overflow-wrap: break-word;
855 .item-left, .item-right {
859 padding-right: 1.25rem;
868 .search-container > * {
871 .search-results-title {
874 /* flex layout allows shrinking the <select> appropriately if it becomes too large */
875 display: inline-flex;
877 /* make things look like in a line, despite the fact that we're using a layout
878 with boxes (i.e. from the flex layout) */
879 align-items: baseline;
882 display: inline-block;
883 /* ensures that 100% in properties of #crate-search-div:after
884 are relative to the size of this div */
886 /* allows this div (and with it the <select>-element "#crate-search") to be shrunk */
892 /* keep these two in sync with "@-moz-document url-prefix()" below */
895 /* prevents the <select> from overflowing the containing div in case it's shrunk */
897 /* contents can overflow because of max-width limit, then show ellipsis */
898 text-overflow: ellipsis;
899 border: 1px solid var(--border-color);
903 -moz-appearance: none;
904 -webkit-appearance: none;
905 /* Removes default arrow from firefox */
907 background-color: var(--main-background-color);
909 /* cancel stylistic differences in padding in firefox
910 for "appearance: none"-style (or equivalent) <select>s */
911 @-moz-document url-prefix() {
913 padding-left: 0px; /* == 4px - 4px */
914 padding-right: 19px; /* == 23px - 4px */
917 /* pseudo-element for holding the dropdown-arrow image; needs to be a separate thing
918 so that we can apply CSS-filters to change the arrow color in themes */
919 #crate-search-div::after {
920 /* lets clicks through! */
921 pointer-events: none;
922 /* completely covers the underlying div */
929 background-repeat: no-repeat;
930 background-size: 20px;
931 background-position: calc(100% - 2px) 56%;
932 /* image is black color, themes should apply a "filter" property to change the color */
933 background-image: /* AUTOREPLACE: */url("down-arrow.svg");
935 #crate-search > option {
939 /* Override Normalize.css: it has a rule that sets
940 -webkit-appearance: textfield for search inputs. That
941 causes rounded corners and no border on iOS Safari. */
942 -webkit-appearance: none;
943 /* Override Normalize.css: we have margins and do
944 not want to overflow - the `moz` attribute is necessary
945 until Firefox 29, too early to drop at this point */
946 -moz-box-sizing: border-box !important;
947 box-sizing: border-box !important;
949 border: 1px solid var(--border-color);
954 background-color: var(--button-background-color);
956 .search-input:focus {
957 border-color: var(--search-input-focused-border-color);
965 .search-results.active {
967 /* prevent overhanging tabs from moving the first result */
971 .search-results .desc > span {
973 text-overflow: ellipsis;
978 .search-results > a {
981 /* A little margin ensures the browser's outlining of focused links has room to display. */
984 border-bottom: 1px solid #aaa3;
987 .search-results > a > div {
992 .search-results .result-name, .search-results div.desc, .search-results .result-description {
995 .search-results .result-name {
999 .search-results .result-name > span {
1000 display: inline-block;
1002 font-weight: normal;
1013 border: 1px solid var(--border-color);
1017 /* This rule is to draw the little arrow connecting the settings menu to the gear icon. */
1022 border: solid var(--border-color);
1023 border-width: 1px 1px 0 0;
1024 display: inline-block;
1026 transform: rotate(-45deg);
1030 .popover, .popover::before {
1031 background-color: var(--main-background-color);
1032 color: var(--main-color);
1035 #help-button .popover {
1039 #help-button .popover::before {
1047 margin-right: 0.5rem;
1049 #help-button span.top, #help-button span.bottom {
1052 font-size: 1.125rem;
1054 #help-button span.top {
1058 border-bottom: 1px solid var(--border-color);
1059 padding-bottom: 4px;
1062 #help-button span.bottom {
1064 border-top: 1px solid var(--border-color);
1067 text-align: initial;
1069 .side-by-side > div {
1072 padding: 0 20px 20px 17px;
1077 /* This min-height is needed to unify the height of the stab elements because some of them
1082 align-items: center;
1083 white-space: pre-wrap;
1088 font-size: 0.875rem;
1089 font-weight: normal;
1098 margin-right: 0.3rem;
1101 /* Black one-pixel outline around emoji shapes */
1111 .import-item .stab {
1113 display: inline-block;
1114 font-size: 0.875rem;
1117 margin-left: 0.3125em;
1119 vertical-align: text-bottom;
1122 .module-item.unstable,
1123 .import-item.unstable {
1128 font-weight: normal;
1141 color: var(--right-side-color);
1145 .impl-items .srclink, .impl .srclink, .methods .srclink {
1146 /* Override header settings otherwise it's too bold */
1147 font-weight: normal;
1159 pre.rust .question-mark {
1164 display: inline-block;
1167 padding: 5px 10px 5px 10px;
1169 font-size: 1.375rem;
1174 .example-wrap:hover .test-arrow {
1175 visibility: visible;
1177 a.test-arrow:hover {
1178 text-decoration: none;
1183 color: var(--code-attribute-color);
1191 .out-of-band > span.since {
1198 font-size: 1.125rem;
1199 margin-bottom: 10px;
1200 border-bottom: none;
1206 border-bottom: none;
1213 margin-bottom: 40px;
1216 .sub-variant > .sub-variant-field {
1220 :target > code, :target > .code-header {
1237 display: inline-block;
1244 padding: 5px 3px 3px 3px;
1248 border: 1px solid var(--border-color);
1251 .tooltip.ignore::after {
1252 content: "This example is not tested";
1254 .tooltip.compile_fail::after {
1255 content: "This example deliberately fails to compile";
1257 .tooltip.should_panic::after {
1258 content: "This example panics";
1260 .tooltip.edition::after {
1261 content: "This code runs with edition " attr(data-edition);
1271 border-style: solid;
1275 .tooltip:hover::before, .tooltip:hover::after {
1279 .tooltip.compile_fail, .tooltip.should_panic, .tooltip.ignore {
1284 .notable-traits-tooltip {
1285 display: inline-block;
1289 .notable-traits:hover .notable-traits-tooltiptext,
1290 .notable-traits .notable-traits-tooltiptext.force-tooltip {
1291 display: inline-block;
1294 .notable-traits .notable-traits-tooltiptext {
1296 padding: 5px 3px 3px 3px;
1306 .notable-traits-tooltip::after {
1307 /* The margin on the tooltip does not capture hover events,
1308 this extends the area of hover enough so that mouse hover is not
1309 lost when moving the mouse to the tooltip */
1310 content: "\00a0\00a0\00a0";
1313 .notable-traits .notable, .notable-traits .docblock {
1317 .notable-traits .notable {
1319 margin-bottom: 13px;
1320 font-size: 1.1875rem;
1325 .notable-traits .docblock code.content{
1331 /* Example code has the "Run" button that needs to be positioned relative to the pre */
1332 pre.rust.rust-example-rendered {
1347 .search-failed.active {
1351 .search-failed > ul {
1366 font-size: 1.125rem;
1369 border-top: 2px solid;
1372 #titles > button:first-child:last-child {
1374 width: calc(100% - 1px);
1377 #titles > button:not(:last-child) {
1379 width: calc(33.3% - 1px);
1382 #titles > button > div.count {
1383 display: inline-block;
1399 border-bottom: 1px solid;
1402 justify-content: center;
1403 align-items: center;
1411 #source-sidebar > .title {
1414 border-bottom: 1px solid var(--border-color);
1417 #sidebar-toggle > button {
1429 /* work around button layout strangeness: https://stackoverflow.com/q/7271561 */
1431 /* iOS button gradient: https://stackoverflow.com/q/5438567 */
1432 -webkit-appearance: none;
1435 #settings-menu, #help-button {
1440 #settings-menu > a, #help-button > button, #copy-path {
1443 border: 1px solid var(--border-color);
1448 #settings-menu > a, #help-button > button {
1452 background-color: var(--button-background-color);
1456 color: var(--copy-path-button-color);
1459 filter: var(--copy-path-img-filter);
1461 #copy-path:hover > img {
1462 filter: var(--copy-path-img-hover-filter);
1465 @keyframes rotating {
1467 transform: rotate(0deg);
1470 transform: rotate(360deg);
1473 #settings-menu.rotate > a img {
1474 animation: rotating 2s linear infinite;
1477 .setting-line .radio-line input:checked {
1478 box-shadow: inset 0 0 0 3px var(--main-background-color);
1479 background-color: var(--settings-input-color);
1481 .setting-line .radio-line input:focus {
1482 box-shadow: 0 0 1px 1px var(--settings-input-color);
1484 /* In here we combine both `:focus` and `:checked` properties. */
1485 .setting-line .radio-line input:checked:focus {
1486 box-shadow: inset 0 0 0 3px var(--main-background-color),
1487 0 0 2px 2px var(--settings-input-color);
1489 .setting-line .radio-line input:hover {
1490 border-color: var(--settings-input-color) !important;
1492 input:checked + .slider {
1493 background-color: var(--settings-input-color);
1496 #help-button > button {
1498 /* Rare exception to specifying font sizes in rem. Since this is acting
1499 as an icon, it's okay to specify their sizes in pixels. */
1506 background-color: var(--main-background-color);
1514 display: inline-block;
1516 font: 15px monospace;
1518 vertical-align: middle;
1519 border: solid 1px var(--border-color);
1524 #main-content > ul {
1527 #main-content > ul > li {
1539 details.dir-entry > summary {
1541 list-style-position: outside;
1545 details.dir-entry div.folders, details.dir-entry div.files {
1549 details.dir-entry a {
1553 /* The hideme class is used on summary tags that contain a span with
1554 placeholder text shown only when the toggle is closed. For instance,
1555 "Expand description" or "Show methods". */
1556 details.rustdoc-toggle > summary.hideme {
1560 details.rustdoc-toggle > summary {
1563 details.rustdoc-toggle > summary::-webkit-details-marker,
1564 details.rustdoc-toggle > summary::marker {
1568 details.rustdoc-toggle > summary.hideme > span {
1572 details.rustdoc-toggle > summary::before {
1577 background-repeat: no-repeat;
1578 background-position: top left;
1579 display: inline-block;
1580 vertical-align: middle;
1584 details.rustdoc-toggle > summary.hideme > span,
1585 details.rustdoc-toggle > summary::before,
1586 .more-examples-toggle summary, .more-examples-toggle .hide-more {
1587 color: var(--toggles-color);
1590 /* Screen readers see the text version at the end the line.
1591 Visual readers see the icon at the start of the line, but small and transparent. */
1592 details.rustdoc-toggle > summary::after {
1600 details.rustdoc-toggle > summary.hideme::after {
1601 /* "hideme" toggles already have a description when they're contracted */
1605 details.rustdoc-toggle > summary:focus::before,
1606 details.rustdoc-toggle > summary:hover::before {
1610 details.rustdoc-toggle.top-doc > summary,
1611 details.rustdoc-toggle.top-doc > summary::before,
1612 details.rustdoc-toggle.non-exhaustive > summary,
1613 details.rustdoc-toggle.non-exhaustive > summary::before {
1617 details.non-exhaustive {
1621 details.rustdoc-toggle > summary.hideme::before {
1625 details.rustdoc-toggle > summary:not(.hideme)::before {
1631 .impl-items > details.rustdoc-toggle > summary:not(.hideme)::before {
1636 /* When a "hideme" summary is open and the "Expand description" or "Show
1637 methods" text is hidden, we want the [-] toggle that remains to not
1638 affect the layout of the items to its right. To do that, we use
1639 absolute positioning. Note that we also set position: relative
1640 on the parent <details> to make this work properly. */
1641 details.rustdoc-toggle[open] > summary.hideme {
1645 details.rustdoc-toggle {
1649 details.rustdoc-toggle[open] > summary.hideme > span {
1653 details.rustdoc-toggle[open] > summary::before,
1654 details.rustdoc-toggle[open] > summary.hideme::before {
1655 background-image: /* AUTOREPLACE: */url("toggle-minus.svg");
1658 details.rustdoc-toggle > summary::before {
1659 background-image: /* AUTOREPLACE: */url("toggle-plus.svg");
1662 details.rustdoc-toggle[open] > summary::before,
1663 details.rustdoc-toggle[open] > summary.hideme::before {
1666 background-repeat: no-repeat;
1667 background-position: top left;
1668 display: inline-block;
1672 details.rustdoc-toggle[open] > summary::after,
1673 details.rustdoc-toggle[open] > summary.hideme::after {
1674 content: "Collapse";
1677 /* This is needed in docblocks to have the "â–¶" element to be on the same line. */
1678 .docblock summary > * {
1679 display: inline-block;
1685 WARNING: RUSTDOC_MOBILE_BREAKPOINT MEDIA QUERY;
1686 If you update this line, then you also need to update the line with the same warning
1687 in storage.js plus the media query with (max-width: 700px)
1689 @media (min-width: 701px) {
1690 /* In case there is no documentation before a code block, we need to add some margin at the top
1691 to prevent an overlay between the "collapse toggle" and the information tooltip.
1692 However, it's not needed with smaller screen width because the doc/code block is always put
1693 "one line" below. */
1694 .docblock > .information:first-child > .tooltip {
1698 /* When we expand the sidebar on the source code page, we hide the logo on the left of the
1699 search bar to have more space. */
1700 .source-sidebar-expanded .source .sidebar + main .width-limiter .sub-logo-container.rust-logo {
1704 .source-sidebar-expanded .source .sidebar {
1710 WARNING: RUSTDOC_MOBILE_BREAKPOINT MEDIA QUERY
1711 If you update this line, then you also need to update the line with the same warning
1712 in storage.js plus the media query with (min-width: 701px)
1714 @media (max-width: 700px) {
1715 /* When linking to an item with an `id` (for instance, by clicking a link in the sidebar,
1716 or visiting a URL with a fragment like `#method.new`, we don't want the item to be obscured
1717 by the topbar. Anything with an `id` gets scroll-margin-top equal to .mobile-topbar's size.
1720 scroll-margin-top: 45px;
1725 /* Sidebar should overlay main content, rather than pushing main content to the right.
1726 Turn off `display: flex` on the body element. */
1736 flex-direction: column;
1739 .content .out-of-band {
1741 margin-left: initial;
1745 .content .out-of-band .since::before {
1753 /* Hide the logo and item name from the sidebar. Those are displayed
1754 in the mobile-topbar instead. */
1755 .sidebar .sidebar-logo,
1756 .sidebar .location {
1763 /* Hide the sidebar offscreen while not in use. Doing this instead of display: none means
1764 the sidebar stays visible for screen readers, which is useful for navigation. */
1770 /* Reduce height slightly to account for mobile topbar. */
1771 height: calc(100vh - 45px);
1774 /* The source view uses a different design for the sidebar toggle, and doesn't have a topbar,
1775 so don't bump down the main content or the sidebar. */
1777 .rustdoc.source .sidebar {
1785 .source-sidebar-expanded .source .sidebar,
1786 .sidebar:focus-within {
1790 .rustdoc.source > .sidebar {
1797 .mobile-topbar .location a {
1802 .mobile-topbar .location {
1805 margin: auto 0.5em auto auto;
1806 text-overflow: ellipsis;
1808 white-space: nowrap;
1809 /* Rare exception to specifying font sizes in rem. Since the topbar
1810 height is specified in pixels, this also has to be specified in
1811 pixels to avoid overflowing the topbar when the user sets a bigger
1816 .mobile-topbar .logo-container {
1820 .mobile-topbar .logo-container > img {
1830 flex-direction: row;
1840 .source .mobile-topbar {
1844 .sidebar-menu-toggle {
1846 /* Rare exception to specifying font sizes in rem. Since this is acting
1847 as an icon, it's okay to specify its sizes in pixels. */
1854 background-color: var(--sidebar-background-color);
1871 display: none !important;
1880 #titles > button > div.count {
1889 /* Because of ios, we need to actually have a full height sidebar title so the
1890 * actual sidebar can show up. But then we need to make it transparent so we don't
1891 * hide content. The filler just allows to create the background for the sidebar
1892 * title. But because of the absolute position, I had to lower the z-index.
1897 width: calc(100% - 45px);
1901 border-bottom: 1px solid;
1904 #main-content > details.rustdoc-toggle > summary::before,
1905 #main-content > div > details.rustdoc-toggle > summary::before {
1918 border-top-right-radius: 3px;
1919 border-bottom-right-radius: 3px;
1926 .source-sidebar-expanded #sidebar-toggle {
1930 border-top-right-radius: unset;
1931 border-bottom-right-radius: unset;
1934 border-bottom: 1px solid;
1941 #main-content > .line-numbers {
1945 .notable-traits .notable-traits-tooltiptext {
1950 /* We don't display the help button on mobile devices. */
1955 /* Display an alternating layout on tablets and phones */
1961 flex-flow: column wrap;
1963 .item-left, .item-right {
1967 /* Display an alternating layout on tablets and phones */
1968 .search-results > a {
1969 border-bottom: 1px solid #aaa9;
1972 .search-results .result-name, .search-results div.desc, .search-results .result-description {
1975 .search-results div.desc, .search-results .result-description, .item-right {
1979 .source-sidebar-expanded .source .sidebar {
1984 /* Position of the "[-]" element. */
1985 details.rustdoc-toggle:not(.top-doc) > summary {
1988 .impl-items > details.rustdoc-toggle > summary:not(.hideme)::before,
1989 #main-content > details.rustdoc-toggle:not(.top-doc) > summary::before,
1990 #main-content > div > details.rustdoc-toggle > summary::before {
1994 /* Align summary-nested and unnested item-info gizmos. */
1995 .content .impl-items > .item-info {
2001 nav.sidebar, nav.sub, .content .out-of-band, a.srclink, #copy-path,
2002 details.rustdoc-toggle[open] > summary::before, details.rustdoc-toggle > summary::before,
2003 details.rustdoc-toggle.top-doc > summary {
2016 @media (max-width: 464px) {
2017 #titles, #titles > button {
2030 overflow-wrap: break-word;
2031 overflow-wrap: anywhere;
2035 flex-direction: column;
2038 .sub-logo-container {
2042 .source .sub-logo-container > img {
2050 .source-sidebar-expanded #sidebar-toggle {
2055 .method-toggle summary,
2056 .implementors-toggle summary,
2058 margin-bottom: 0.75em;
2061 .method-toggle[open] {
2065 .implementors-toggle[open] {
2069 #trait-implementations-list .method-toggle,
2070 #synthetic-implementations-list .method-toggle,
2071 #blanket-implementations-list .method-toggle {
2075 /* Begin: styles for --scrape-examples feature */
2077 .scraped-example-list .scrape-help {
2080 font-weight: normal;
2084 background: transparent;
2086 border-style: solid;
2087 border-radius: 50px;
2090 .scraped-example .code-wrapper {
2093 flex-direction: row;
2098 .scraped-example:not(.expanded) .code-wrapper {
2102 .scraped-example:not(.expanded) .code-wrapper pre {
2108 .scraped-example:not(.expanded) .code-wrapper pre.line-numbers {
2112 .scraped-example .code-wrapper .prev {
2120 .scraped-example .code-wrapper .next {
2128 .scraped-example .code-wrapper .expand {
2136 .scraped-example:not(.expanded) .code-wrapper:before {
2145 .scraped-example:not(.expanded) .code-wrapper:after {
2154 .scraped-example .code-wrapper .line-numbers {
2159 .scraped-example .code-wrapper .line-numbers span {
2163 .scraped-example .code-wrapper .example-wrap {
2170 .scraped-example:not(.expanded) .code-wrapper .example-wrap {
2174 .scraped-example .code-wrapper .example-wrap pre.rust {
2175 overflow-x: inherit;
2181 .more-examples-toggle {
2182 max-width: calc(100% + 25px);
2187 .more-examples-toggle .hide-more {
2193 .more-scraped-examples {
2196 flex-direction: row;
2199 .more-scraped-examples-inner {
2200 /* 20px is width of toggle-line + toggle-line-inner */
2201 width: calc(100% - 20px);
2205 align-self: stretch;
2212 .toggle-line-inner {
2217 .more-scraped-examples .scraped-example {
2218 margin-bottom: 20px;
2221 .more-scraped-examples .scraped-example:last-child {
2233 /* End: styles for --scrape-examples feature */