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 div.impl-items > div {
204 h1, h2, h3, h4, h5, h6,
209 .search-results .result-name,
210 .content table td:first-child > a,
214 #source-sidebar, #sidebar-toggle,
215 details.rustdoc-toggle > summary::before,
216 div.impl-items > div:not(.docblock):not(.item-info),
217 .content ul.crate a.crate,
219 #main-content > .since,
220 #help-button > button,
221 details.rustdoc-toggle.top-doc > summary,
222 details.rustdoc-toggle.top-doc > summary::before,
223 details.rustdoc-toggle.non-exhaustive > summary,
224 details.rustdoc-toggle.non-exhaustive > summary::before,
225 .scraped-example-title,
226 .more-examples-toggle summary, .more-examples-toggle .hide-more,
228 /* This selector is for the items listed in the "all items" page. */
229 #main-content > ul.docblock > li > a {
230 font-family: "Fira Sans", Arial, NanumBarunGothic, sans-serif;
236 .small-section-header a,
246 .result-name .primitive > i, .result-name .keyword > i,
247 .content .method .where,
249 .content .where.fmt-newline {
250 color: var(--main-color);
256 ul ul, ol ul, ul ol, ol ol {
257 margin-bottom: .625em;
261 /* Paragraph spacing at least 1.5 times line spacing per Web Content Accessibility Guidelines.
262 Line-height is 1.5rem, so line spacing is .5rem; .75em is 1.5 times that.
263 https://www.w3.org/WAI/WCAG21/Understanding/visual-presentation.html */
271 /* Fix some style changes due to normalize.css 8 */
279 border-collapse: collapse;
293 /* Buttons on Safari have different default padding than other platforms. Make them the same. */
297 /* end tweaks for normalize.css 8 */
308 padding: 10px 15px 40px 45px;
321 .source .width-limiter {
325 details:not(.rustdoc-toggle) summary {
329 code, pre, a.test-arrow, .code-header {
330 font-family: "Source Code Pro", monospace;
332 .docblock code, .docblock-short code {
336 .docblock pre code, .docblock-short pre code {
342 .docblock.item-decl {
349 .source .content pre {
378 .sub-logo-container {
383 .source .sub-logo-container {
387 .source .sub-logo-container > img {
393 .sidebar, .mobile-topbar, .sidebar-menu-toggle {
394 background-color: var(--sidebar-background-color);
409 .sidebar > .location {
414 overflow-wrap: anywhere;
417 .rustdoc.source .sidebar {
424 border-right: 1px solid;
426 /* The sidebar is by default hidden */
430 .rustdoc.source .sidebar .sidebar-logo {
434 .source .sidebar, #sidebar-toggle, #source-sidebar {
435 background-color: var(--sidebar-background-color);
438 #sidebar-toggle > button:hover, #sidebar-toggle > button:focus {
439 background-color: var(--sidebar-background-color-hover);
442 .source .sidebar > *:not(#sidebar-toggle) {
447 .source-sidebar-expanded .source .sidebar {
451 .source-sidebar-expanded .source .sidebar > *:not(#sidebar-toggle) {
460 /* Improve the scrollbar display on firefox */
462 scrollbar-width: initial;
463 scrollbar-color: var(--scrollbar-color);
466 scrollbar-width: thin;
467 scrollbar-color: var(--scrollbar-color);
470 /* Improve the scrollbar display on webkit-based browsers */
471 ::-webkit-scrollbar {
474 .sidebar::-webkit-scrollbar {
477 ::-webkit-scrollbar-track {
478 -webkit-box-shadow: inset 0;
479 background-color: var(--scrollbar-track-background-color);
481 .sidebar::-webkit-scrollbar-track {
482 background-color: var(--scrollbar-track-background-color);
484 ::-webkit-scrollbar-thumb, .sidebar::-webkit-scrollbar-thumb {
485 background-color: var(--scrollbar-thumb-background-color);
488 /* Everything else */
491 display: none !important;
494 .sidebar .logo-container {
498 justify-content: center;
502 overflow-wrap: break-word;
505 .logo-container > img {
514 .location a:first-of-type {
521 .block ul, .block li {
531 margin-left: -0.25rem;
533 text-overflow: ellipsis;
543 margin-bottom: 0.7rem;
547 font-size: 1.125rem; /* 18px */
553 .sidebar-elems .block {
557 .sidebar-elems .block li a {
565 .source .content pre.rust {
571 .rustdoc .example-wrap {
572 display: inline-flex;
581 .example-wrap > pre.line-number {
586 border-top-left-radius: 5px;
587 border-bottom-left-radius: 5px;
590 .example-wrap > pre.rust a:hover {
591 text-decoration: underline;
597 .rustdoc:not(.source) .example-wrap > pre:not(.line-number) {
602 .rustdoc:not(.source) .example-wrap > pre.line-numbers {
607 .rustdoc .example-wrap > pre {
624 .content > .example-wrap pre.line-numbers {
626 -webkit-user-select: none;
627 -moz-user-select: none;
628 -ms-user-select: none;
636 overflow-wrap: break-word;
637 overflow-wrap: anywhere;
645 text-overflow: ellipsis;
648 /* Wrap non-pre code blocks (`text`) but not (```text```). */
649 .docblock > :not(pre) > code,
650 .docblock-short > :not(pre) > code {
651 white-space: pre-wrap;
654 .top-doc .docblock h2 { font-size: 1.375rem; }
655 .top-doc .docblock h3 { font-size: 1.25rem; }
656 .top-doc .docblock h4,
657 .top-doc .docblock h5 {
660 .top-doc .docblock h6 {
664 .docblock h5 { font-size: 1rem; }
665 .docblock h6 { font-size: 0.875rem; }
666 .docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5, .docblock h6 {
667 border-bottom-color: var(--headings-border-bottom-color);
675 .docblock > :not(.information):not(.more-examples-toggle) {
680 .content .out-of-band {
687 .method > .code-header, .trait-impl > .code-header {
688 max-width: calc(100% - 41px);
696 overflow-wrap: break-word;
697 overflow-wrap: anywhere;
700 .in-band > code, .in-band > .code-header {
701 display: inline-block;
704 .docblock code, .docblock-short code,
705 pre, .rustdoc.source .example-wrap {
706 background-color: var(--code-block-background-color);
712 #main-content > .since {
716 .content table:not(.table-display) {
717 border-spacing: 0 5px;
719 .content td { vertical-align: top; }
720 .content td:first-child { padding-right: 20px; }
721 .content td p:first-child { margin-top: 0; }
722 .content td h1, .content td h2 { margin-left: 0; font-size: 1.125rem; }
723 .content tr:first-child td { border-top: 0; }
727 width: calc(100% - 2px);
747 .content .item-list {
748 list-style-type: none;
752 .content .multi-column {
753 -moz-column-count: 5;
754 -moz-column-gap: 2.5em;
755 -webkit-column-count: 5;
756 -webkit-column-gap: 2.5em;
760 .content .multi-column li { width: 100%; display: inline-block; }
762 .content > .methods > .method {
766 /* Shift "where ..." part of method or fn definition down a line */
767 .content .method .where,
769 .content .where.fmt-newline {
774 .content .methods > div:not(.notable-traits):not(.method) {
779 .content .docblock > .impl-items {
783 .content .docblock >.impl-items .table-display {
786 .content .docblock >.impl-items table td {
789 .content .docblock > .impl-items .table-display, .impl-items table td {
797 .content .item-info code {
801 .content .item-info {
806 .sub-variant > div > .item-info {
810 .content .impl-items .docblock, .content .impl-items .item-info {
814 .content .impl-items > .item-info {
818 .methods > .item-info, .content .impl-items > .item-info {
826 #main-content > .item-info {
843 border-top: 1px solid;
844 border-bottom: 1px solid;
846 nav.main .separator {
848 display: inline-block;
852 nav.sum { text-align: right; }
853 nav.sub form { display: inline; }
856 text-decoration: none;
857 background: transparent;
860 .small-section-header {
862 justify-content: space-between;
866 .small-section-header:hover > .anchor {
870 .in-band:hover > .anchor, .impl:hover > .anchor, .method.trait-impl:hover > .anchor,
871 .type.trait-impl:hover > .anchor, .associatedconstant.trait-impl:hover > .anchor,
872 .associatedtype.trait-impl:hover > .anchor {
873 display: inline-block;
880 background: none !important;
885 .small-section-header > .anchor {
889 h2.small-section-header > .anchor {
896 .docblock a:not(.srclink):not(.test-arrow):not(.scrape-help):hover,
897 .docblock-short a:not(.srclink):not(.test-arrow):not(.scrape-help):hover, .item-info a {
898 text-decoration: underline;
901 .block a.current.crate { font-weight: 500; }
903 /* In most contexts we use `overflow-wrap: anywhere` to ensure that we can wrap
904 as much as needed on mobile (see
905 src/test/rustdoc-gui/type-declaration-overflow.goml for an example of why
906 this matters). The `anywhere` value means:
908 "Soft wrap opportunities introduced by the word break are considered when
909 calculating min-content intrinsic sizes."
911 https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-wrap#values
913 For table layouts, that becomes a problem: the browser tries to make each
914 column as narrow as possible, and `overflow-wrap: anywhere` means it can do
915 so by breaking words - even if some other column could be shrunk without
916 breaking words! This shows up, for instance, in the `Structs` / `Modules` /
917 `Functions` (etcetera) sections of a module page, and when a docblock
920 So, for table layouts, override the default with break-word, which does
921 _not_ affect min-content intrinsic sizes.
925 overflow-wrap: break-word;
934 .item-left, .item-right {
938 padding-right: 1.25rem;
946 .search-container > * {
949 .search-results-title {
960 padding-left: 0.15em;
966 -moz-appearance: none;
967 -webkit-appearance: none;
968 /* Removes default arrow from firefox */
969 background-repeat: no-repeat;
970 background-color: transparent;
971 background-size: 20px;
972 background-position: calc(100% - 1px) 56%;
973 background-image: /* AUTOREPLACE: */url("down-arrow.svg");
975 text-overflow: ellipsis;
981 /* Override Normalize.css: it has a rule that sets
982 -webkit-appearance: textfield for search inputs. That
983 causes rounded corners and no border on iOS Safari. */
984 -webkit-appearance: none;
985 /* Override Normalize.css: we have margins and do
986 not want to overflow - the `moz` attribute is necessary
987 until Firefox 29, too early to drop at this point */
988 -moz-box-sizing: border-box !important;
989 box-sizing: border-box !important;
1000 padding-bottom: 2em;
1003 .search-results.active {
1005 /* prevent overhanging tabs from moving the first result */
1009 .search-results .desc > span {
1010 white-space: nowrap;
1011 text-overflow: ellipsis;
1016 .search-results > a {
1019 /* A little margin ensures the browser's outlining of focused links has room to display. */
1022 border-bottom: 1px solid #aaa3;
1025 .search-results > a > div {
1027 flex-flow: row wrap;
1030 .search-results .result-name, .search-results div.desc, .search-results .result-description {
1033 .search-results .result-name {
1037 .search-results .result-name > span {
1038 display: inline-block;
1040 font-weight: normal;
1055 /* This rule is to draw the little arrow connecting the settings menu to the gear icon. */
1061 border-width: 1px 1px 0 0;
1062 display: inline-block;
1064 transform: rotate(-45deg);
1068 .popover, .popover::before {
1069 background-color: var(--main-background-color);
1070 color: var(--main-color);
1073 #help-button .popover {
1077 #help-button .popover::before {
1085 margin-right: 0.5rem;
1087 #help-button span.top, #help-button span.bottom {
1090 font-size: 1.125rem;
1092 #help-button span.top {
1096 border-bottom: 1px solid;
1097 padding-bottom: 4px;
1100 #help-button span.bottom {
1102 border-top: 1px solid;
1105 text-align: initial;
1107 .side-by-side > div {
1110 padding: 0 20px 20px 17px;
1114 display: inline-block;
1119 font-size: 0.875rem;
1120 font-weight: normal;
1130 /* Black one-pixel outline around emoji shapes */
1140 .import-item .stab {
1142 display: inline-block;
1143 font-size: 0.875rem;
1146 margin-left: 0.3125em;
1148 vertical-align: text-bottom;
1151 .module-item.unstable,
1152 .import-item.unstable {
1157 font-weight: normal;
1167 .impl-items .srclink, .impl .srclink, .methods .srclink {
1168 /* Override header settings otherwise it's too bold */
1169 font-weight: normal;
1181 .variants_table tbody tr td:first-child {
1182 width: 1%; /* make the variant name as small as possible */
1193 pre.rust .question-mark {
1198 display: inline-block;
1201 padding: 5px 10px 5px 10px;
1203 font-size: 1.375rem;
1208 .example-wrap:hover .test-arrow {
1209 visibility: visible;
1212 text-decoration: none;
1224 .out-of-band > span.since {
1231 font-size: 1.125rem;
1232 margin-bottom: 10px;
1233 border-bottom: none;
1239 border-bottom: none;
1246 margin-bottom: 40px;
1249 .sub-variant > .sub-variant-field {
1254 display: inline-block;
1259 :target > code, :target > .code-header {
1276 display: inline-block;
1283 padding: 5px 3px 3px 3px;
1289 .tooltip.ignore::after {
1290 content: "This example is not tested";
1292 .tooltip.compile_fail::after {
1293 content: "This example deliberately fails to compile";
1295 .tooltip.should_panic::after {
1296 content: "This example panics";
1298 .tooltip.edition::after {
1299 content: "This code runs with edition " attr(data-edition);
1309 border-style: solid;
1313 .tooltip:hover::before, .tooltip:hover::after {
1317 .tooltip.compile_fail, .tooltip.should_panic, .tooltip.ignore {
1322 .notable-traits-tooltip {
1323 display: inline-block;
1327 .notable-traits:hover .notable-traits-tooltiptext,
1328 .notable-traits .notable-traits-tooltiptext.force-tooltip {
1329 display: inline-block;
1332 .notable-traits .notable-traits-tooltiptext {
1334 padding: 5px 3px 3px 3px;
1344 .notable-traits-tooltip::after {
1345 /* The margin on the tooltip does not capture hover events,
1346 this extends the area of hover enough so that mouse hover is not
1347 lost when moving the mouse to the tooltip */
1348 content: "\00a0\00a0\00a0";
1351 .notable-traits .notable, .notable-traits .docblock {
1355 .notable-traits .notable {
1357 margin-bottom: 13px;
1358 font-size: 1.1875rem;
1363 .notable-traits .docblock code.content{
1369 /* Example code has the "Run" button that needs to be positioned relative to the pre */
1370 pre.rust.rust-example-rendered {
1385 .search-failed.active {
1389 .search-failed > ul {
1404 font-size: 1.125rem;
1407 border-top: 2px solid;
1410 #titles > button:first-child:last-child {
1412 width: calc(100% - 1px);
1415 #titles > button:not(:last-child) {
1417 width: calc(33.3% - 1px);
1420 #titles > button > div.count {
1421 display: inline-block;
1437 border-bottom: 1px solid;
1440 justify-content: center;
1441 align-items: center;
1449 #source-sidebar > .title {
1452 border-bottom: 1px solid;
1455 #sidebar-toggle > button {
1467 /* work around button layout strangeness: https://stackoverflow.com/q/7271561 */
1469 /* iOS button gradient: https://stackoverflow.com/q/5438567 */
1470 -webkit-appearance: none;
1473 #settings-menu, #help-button {
1481 #settings-menu > a, #help-button > button, #copy-path {
1491 #settings-menu > a, #help-button > button {
1497 @keyframes rotating {
1499 transform: rotate(0deg);
1502 transform: rotate(360deg);
1505 #settings-menu.rotate > a img {
1506 animation: rotating 2s linear infinite;
1509 .setting-line .radio-line input:checked {
1510 box-shadow: inset 0 0 0 3px var(--main-background-color);
1511 background-color: var(--settings-input-color);
1513 .setting-line .radio-line input:focus {
1514 box-shadow: 0 0 1px 1px var(--settings-input-color);
1516 /* In here we combine both `:focus` and `:checked` properties. */
1517 .setting-line .radio-line input:checked:focus {
1518 box-shadow: inset 0 0 0 3px var(--main-background-color),
1519 0 0 2px 2px var(--settings-input-color);
1521 .setting-line .radio-line input:hover {
1522 border-color: var(--settings-input-color) !important;
1524 input:checked + .slider {
1525 background-color: var(--settings-input-color);
1528 #help-button > button {
1530 /* Rare exception to specifying font sizes in rem. Since this is acting
1531 as an icon, it's okay to specify their sizes in pixels. */
1537 background: initial;
1555 #theme-choices > button {
1560 background: rgba(0,0,0,0);
1561 overflow-wrap: normal;
1564 #theme-choices > button:not(:first-child) {
1565 border-top: 1px solid;
1569 display: inline-block;
1571 font: 15px monospace;
1573 vertical-align: middle;
1579 .hidden-by-impl-hider,
1580 .hidden-by-usual-hider {
1581 /* important because of conflicting rule for small screens */
1582 display: none !important;
1585 #implementations-list > h3 > span.in-band {
1592 border-collapse: collapse;
1597 .table-display tr td:first-child {
1601 .table-display tr td:last-child {
1604 .table-display .out-of-band {
1606 font-size: 1.125rem;
1610 .table-display td:hover .anchor {
1616 #main-content > ul {
1619 #main-content > ul > li {
1631 details.dir-entry > summary {
1633 list-style-position: outside;
1637 details.dir-entry div.folders, details.dir-entry div.files {
1641 details.dir-entry a {
1645 /* The hideme class is used on summary tags that contain a span with
1646 placeholder text shown only when the toggle is closed. For instance,
1647 "Expand description" or "Show methods". */
1648 details.rustdoc-toggle > summary.hideme {
1652 details.rustdoc-toggle > summary {
1655 details.rustdoc-toggle > summary::-webkit-details-marker,
1656 details.rustdoc-toggle > summary::marker {
1660 details.rustdoc-toggle > summary.hideme > span {
1664 details.rustdoc-toggle > summary::before {
1669 background-repeat: no-repeat;
1670 background-position: top left;
1671 display: inline-block;
1672 vertical-align: middle;
1676 /* Screen readers see the text version at the end the line.
1677 Visual readers see the icon at the start of the line, but small and transparent. */
1678 details.rustdoc-toggle > summary::after {
1686 details.rustdoc-toggle > summary.hideme::after {
1687 /* "hideme" toggles already have a description when they're contracted */
1691 details.rustdoc-toggle > summary:focus::before,
1692 details.rustdoc-toggle > summary:hover::before {
1696 details.rustdoc-toggle.top-doc > summary,
1697 details.rustdoc-toggle.top-doc > summary::before,
1698 details.rustdoc-toggle.non-exhaustive > summary,
1699 details.rustdoc-toggle.non-exhaustive > summary::before {
1703 details.non-exhaustive {
1707 details.rustdoc-toggle > summary.hideme::before {
1711 details.rustdoc-toggle > summary:not(.hideme)::before {
1717 .impl-items > details.rustdoc-toggle > summary:not(.hideme)::before {
1722 /* When a "hideme" summary is open and the "Expand description" or "Show
1723 methods" text is hidden, we want the [-] toggle that remains to not
1724 affect the layout of the items to its right. To do that, we use
1725 absolute positioning. Note that we also set position: relative
1726 on the parent <details> to make this work properly. */
1727 details.rustdoc-toggle[open] > summary.hideme {
1731 details.rustdoc-toggle {
1735 details.rustdoc-toggle[open] > summary.hideme > span {
1739 details.rustdoc-toggle[open] > summary::before,
1740 details.rustdoc-toggle[open] > summary.hideme::before {
1741 background-image: /* AUTOREPLACE: */url("toggle-minus.svg");
1744 details.rustdoc-toggle > summary::before {
1745 background-image: /* AUTOREPLACE: */url("toggle-plus.svg");
1748 details.rustdoc-toggle[open] > summary::before,
1749 details.rustdoc-toggle[open] > summary.hideme::before {
1752 background-repeat: no-repeat;
1753 background-position: top left;
1754 display: inline-block;
1758 details.rustdoc-toggle[open] > summary::after,
1759 details.rustdoc-toggle[open] > summary.hideme::after {
1760 content: "Collapse";
1763 /* This is needed in docblocks to have the "â–¶" element to be on the same line. */
1764 .docblock summary > * {
1765 display: inline-block;
1771 WARNING: RUSTDOC_MOBILE_BREAKPOINT MEDIA QUERY;
1772 If you update this line, then you also need to update the line with the same warning
1773 in storage.js plus the media query with (max-width: 700px)
1775 @media (min-width: 701px) {
1776 /* In case there is no documentation before a code block, we need to add some margin at the top
1777 to prevent an overlay between the "collapse toggle" and the information tooltip.
1778 However, it's not needed with smaller screen width because the doc/code block is always put
1779 "one line" below. */
1780 .docblock > .information:first-child > .tooltip {
1784 /* When we expand the sidebar on the source code page, we hide the logo on the left of the
1785 search bar to have more space. */
1786 .source-sidebar-expanded .source .sidebar + main .width-limiter .sub-logo-container.rust-logo {
1790 .source-sidebar-expanded .source .sidebar {
1796 WARNING: RUSTDOC_MOBILE_BREAKPOINT MEDIA QUERY
1797 If you update this line, then you also need to update the line with the same warning
1798 in storage.js plus the media query with (min-width: 701px)
1800 @media (max-width: 700px) {
1801 /* When linking to an item with an `id` (for instance, by clicking a link in the sidebar,
1802 or visiting a URL with a fragment like `#method.new`, we don't want the item to be obscured
1803 by the topbar. Anything with an `id` gets scroll-margin-top equal to .mobile-topbar's size.
1806 scroll-margin-top: 45px;
1811 /* Sidebar should overlay main content, rather than pushing main content to the right.
1812 Turn off `display: flex` on the body element. */
1823 flex-direction: column;
1826 .content .out-of-band {
1828 margin-left: initial;
1832 .content .out-of-band .since::before {
1840 /* Hide the logo and item name from the sidebar. Those are displayed
1841 in the mobile-topbar instead. */
1842 .sidebar .sidebar-logo,
1843 .sidebar .location {
1854 /* Hide the sidebar offscreen while not in use. Doing this instead of display: none means
1855 the sidebar stays visible for screen readers, which is useful for navigation. */
1861 /* Reduce height slightly to account for mobile topbar. */
1862 height: calc(100vh - 45px);
1865 /* The source view uses a different design for the sidebar toggle, and doesn't have a topbar,
1866 so don't bump down the main content or the sidebar. */
1868 .rustdoc.source .sidebar {
1876 .source-sidebar-expanded .source .sidebar,
1877 .sidebar:focus-within {
1881 .rustdoc.source > .sidebar {
1888 .mobile-topbar .location a {
1893 .mobile-topbar .location {
1896 margin: auto 0.5em auto auto;
1897 text-overflow: ellipsis;
1899 white-space: nowrap;
1900 /* Rare exception to specifying font sizes in rem. Since the topbar
1901 height is specified in pixels, this also has to be specified in
1902 pixels to avoid overflowing the topbar when the user sets a bigger
1907 .mobile-topbar .logo-container {
1911 .mobile-topbar .logo-container > img {
1921 flex-direction: row;
1931 .source .mobile-topbar {
1935 .sidebar-menu-toggle {
1937 /* Rare exception to specifying font sizes in rem. Since this is acting
1938 as an icon, it's okay to specify its sizes in pixels. */
1944 background-color: var(--sidebar-background-color);
1947 .source nav:not(.sidebar).sub {
1965 display: none !important;
1974 #titles > button > div.count {
1983 /* Because of ios, we need to actually have a full height sidebar title so the
1984 * actual sidebar can show up. But then we need to make it transparent so we don't
1985 * hide content. The filler just allows to create the background for the sidebar
1986 * title. But because of the absolute position, I had to lower the z-index.
1991 width: calc(100% - 45px);
1995 border-bottom: 1px solid;
1998 #main-content > details.rustdoc-toggle > summary::before,
1999 #main-content > div > details.rustdoc-toggle > summary::before {
2012 border-top-right-radius: 3px;
2013 border-bottom-right-radius: 3px;
2020 .source-sidebar-expanded #sidebar-toggle {
2024 border-top-right-radius: unset;
2025 border-bottom-right-radius: unset;
2028 border-bottom: 1px solid;
2035 #main-content > .line-numbers {
2039 .notable-traits .notable-traits-tooltiptext {
2044 /* We don't display the help button on mobile devices. */
2049 /* Display an alternating layout on tablets and phones */
2055 flex-flow: column wrap;
2057 .item-left, .item-right {
2061 /* Display an alternating layout on tablets and phones */
2062 .search-results > a {
2063 border-bottom: 1px solid #aaa9;
2066 .search-results .result-name, .search-results div.desc, .search-results .result-description {
2069 .search-results div.desc, .search-results .result-description, .item-right {
2073 .source-sidebar-expanded .source .sidebar {
2078 /* Position of the "[-]" element. */
2079 details.rustdoc-toggle:not(.top-doc) > summary {
2082 .impl-items > details.rustdoc-toggle > summary:not(.hideme)::before,
2083 #main-content > details.rustdoc-toggle:not(.top-doc) > summary::before,
2084 #main-content > div > details.rustdoc-toggle > summary::before {
2090 nav.sidebar, nav.sub, .content .out-of-band, a.srclink, #copy-path,
2091 details.rustdoc-toggle[open] > summary::before, details.rustdoc-toggle > summary::before,
2092 details.rustdoc-toggle.top-doc > summary {
2105 @media (max-width: 464px) {
2106 #titles, #titles > button {
2110 #main-content > table:not(.table-display) td {
2111 word-break: break-word;
2124 overflow-wrap: break-word;
2125 overflow-wrap: anywhere;
2129 flex-direction: column;
2132 .sub-logo-container {
2136 .source .sub-logo-container > img {
2144 .source-sidebar-expanded #sidebar-toggle {
2149 .method-toggle summary,
2150 .implementors-toggle summary,
2152 margin-bottom: 0.75em;
2155 .method-toggle[open] {
2159 .implementors-toggle[open] {
2163 #trait-implementations-list .method-toggle,
2164 #synthetic-implementations-list .method-toggle,
2165 #blanket-implementations-list .method-toggle {
2169 /* Begin: styles for --scrape-examples feature */
2171 .scraped-example-list .scrape-help {
2174 font-weight: normal;
2178 background: transparent;
2180 border-style: solid;
2181 border-radius: 50px;
2184 .scraped-example .code-wrapper {
2187 flex-direction: row;
2192 .scraped-example:not(.expanded) .code-wrapper {
2196 .scraped-example:not(.expanded) .code-wrapper pre {
2202 .scraped-example:not(.expanded) .code-wrapper pre.line-numbers {
2206 .scraped-example .code-wrapper .prev {
2214 .scraped-example .code-wrapper .next {
2222 .scraped-example .code-wrapper .expand {
2230 .scraped-example:not(.expanded) .code-wrapper:before {
2239 .scraped-example:not(.expanded) .code-wrapper:after {
2248 .scraped-example .code-wrapper .line-numbers {
2253 .scraped-example .code-wrapper .line-numbers span {
2257 .scraped-example .code-wrapper .example-wrap {
2264 .scraped-example:not(.expanded) .code-wrapper .example-wrap {
2268 .scraped-example .code-wrapper .example-wrap pre.rust {
2269 overflow-x: inherit;
2275 .more-examples-toggle {
2276 max-width: calc(100% + 25px);
2281 .more-examples-toggle .hide-more {
2287 .more-scraped-examples {
2290 flex-direction: row;
2293 .more-scraped-examples-inner {
2294 /* 20px is width of toggle-line + toggle-line-inner */
2295 width: calc(100% - 20px);
2299 align-self: stretch;
2306 .toggle-line-inner {
2311 .more-scraped-examples .scraped-example {
2312 margin-bottom: 20px;
2315 .more-scraped-examples .scraped-example:last-child {
2327 /* End: styles for --scrape-examples feature */