1 /* See FiraSans-LICENSE.txt for the Fira Sans license. */
3 font-family: 'Fira Sans';
6 src: local('Fira Sans'),
7 url("FiraSans-Regular-018c141bf0843ffd.woff2") format("woff2");
11 font-family: 'Fira Sans';
14 src: local('Fira Sans Medium'),
15 url("FiraSans-Medium-8f9a781e4970d388.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-1f7d512b176f0f72.ttf.woff2") format("woff2");
29 font-family: 'Source Serif 4';
32 src: local('Source Serif 4 Italic'),
33 url("SourceSerif4-It-d034fe4ef9d0fa00.ttf.woff2") format("woff2");
37 font-family: 'Source Serif 4';
40 src: local('Source Serif 4 Bold'),
41 url("SourceSerif4-Bold-124a1ca42af929b6.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-562dcc5011b6de7d.ttf.woff2") format("woff2");
56 font-family: 'Source Code Pro';
59 src: url("SourceCodePro-It-1cc31594bf4f1f79.ttf.woff2") format("woff2");
63 font-family: 'Source Code Pro';
66 src: url("SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2") format("woff2");
70 /* Avoid using legacy CJK serif fonts in Windows like Batang. */
72 font-family: 'NanumBarunGothic';
73 src: url("NanumBarunGothic-0f09457c7a19b7c6.ttf.woff2") format("woff2");
75 unicode-range: U+AC00-D7AF, U+1100-11FF, U+3130-318F, U+A960-A97F, U+D7B0-D7FF;
79 box-sizing: border-box;
82 /* This part handles the "default" theme being used depending on the system one. */
86 @media (prefers-color-scheme: light) {
91 @media (prefers-color-scheme: dark) {
97 /* General structure and fonts */
100 /* Line spacing at least 1.5 per Web Content Accessibility Guidelines
101 https://www.w3.org/WAI/WCAG21/Understanding/visual-presentation.html */
102 font: 1rem/1.5 "Source Serif 4", NanumBarunGothic, serif;
105 /* We use overflow-wrap: break-word for Safari, which doesn't recognize
106 `anywhere`: https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-wrap */
107 overflow-wrap: break-word;
108 /* Then override it with `anywhere`, which is required to make non-Safari browsers break
109 more aggressively when we want them to. */
110 overflow-wrap: anywhere;
111 font-feature-settings: "kern", "liga";
112 background-color: var(--main-background-color);
113 color: var(--main-color);
117 font-size: 1.5rem; /* 24px */
120 font-size: 1.375rem; /* 22px */
123 font-size: 1.25rem; /* 20px */
125 h1, h2, h3, h4, h5, h6 {
129 margin: 25px 0 15px 0;
132 .docblock h3, .docblock h4, h5, h6 {
133 margin: 15px 0 5px 0;
135 .docblock > h2:first-child,
136 .docblock > h3:first-child,
137 .docblock > h4:first-child,
138 .docblock > h5:first-child,
139 .docblock > h6:first-child {
146 /* We use overflow-wrap: break-word for Safari, which doesn't recognize
147 `anywhere`: https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-wrap */
148 overflow-wrap: break-word;
149 /* Then override it with `anywhere`, which is required to make non-Safari browsers break
150 more aggressively when we want them to. */
151 overflow-wrap: anywhere;
159 /* The only headings that get underlines are:
160 Markdown-generated headings within the top-doc
161 Rustdoc-generated h2 section headings (e.g. "Implementations", "Required Methods", etc)
162 Underlines elsewhere in the documentation break up visual flow and tend to invert
163 section hierarchies. */
165 .top-doc .docblock > h3,
166 .top-doc .docblock > h4 {
167 border-bottom: 1px solid var(--headings-border-bottom-color);
170 font-size: 1.125rem; /* 18px */
182 h1, h2, h3, h4, h5, h6,
186 .search-results .result-name,
193 .scraped-example-list,
194 /* This selector is for the items listed in the "all items" page. */
196 font-family: "Fira Sans", Arial, NanumBarunGothic, sans-serif;
201 .small-section-header a,
210 .result-name .primitive > i, .result-name .keyword > i {
211 color: var(--main-color);
214 .content span.enum, .content a.enum,
215 .content span.struct, .content a.struct,
216 .content span.union, .content a.union,
217 .content span.primitive, .content a.primitive,
218 .content span.type, .content a.type,
219 .content span.foreigntype, .content a.foreigntype {
220 color: var(--type-link-color);
223 .content span.trait, .content a.trait,
224 .content span.traitalias, .content a.traitalias {
225 color: var(--trait-link-color);
228 .content span.associatedtype, .content a.associatedtype,
229 .content span.constant, .content a.constant,
230 .content span.static, .content a.static {
231 color: var(--assoc-item-link-color);
234 .content span.fn, .content a.fn,
235 .content span.method, .content a.method,
236 .content span.tymethod, .content a.tymethod {
237 color: var(--function-link-color);
240 .content span.attr, .content a.attr,
241 .content span.derive, .content a.derive,
242 .content span.macro, .content a.macro {
243 color: var(--macro-link-color);
246 .content span.mod, .content a.mod {
247 color: var(--mod-link-color);
250 .content span.keyword, .content a.keyword {
251 color: var(--keyword-link-color);
255 color: var(--link-color);
261 ul ul, ol ul, ul ol, ol ol {
262 margin-bottom: .625em;
266 /* Paragraph spacing at least 1.5 times line spacing per Web Content Accessibility Guidelines.
267 Line-height is 1.5rem, so line spacing is .5rem; .75em is 1.5 times that.
268 https://www.w3.org/WAI/WCAG21/Understanding/visual-presentation.html */
271 /* For the last child of a div, the margin will be taken care of
272 by the margin-top of the next item. */
277 /* Fix some style changes due to normalize.css 8 */
280 /* Buttons on Safari have different default padding than other platforms. Make them the same. */
282 /* Opinionated tweak: use pointer cursor as clickability signifier. */
286 /* end tweaks for normalize.css 8 */
288 button#toggle-all-docs {
292 /* iOS button gradient: https://stackoverflow.com/q/5438567 */
293 -webkit-appearance: none;
306 padding: 10px 15px 40px 45px;
307 min-width: 0; /* avoid growing beyond the size limit */
319 details:not(.rustdoc-toggle) summary {
323 code, pre, a.test-arrow, .code-header {
324 font-family: "Source Code Pro", monospace;
326 .docblock code, .docblock-short code {
330 .docblock pre code, .docblock-short pre code {
335 line-height: 1.5; /* https://github.com/rust-lang/rust/issues/105906 */
340 /* This rule allows to have scrolling on the X axis. */
341 .item-decl .type-contents-toggle {
345 .source .content pre {
348 .rustdoc.source .example-wrap > pre.src-line-numbers {
349 padding: 20px 0 20px 4px;
356 .sub-logo-container, .logo-container {
357 /* zero text boxes so that computed line height = image height exactly */
362 .sub-logo-container {
366 .sub-logo-container > img {
373 filter: var(--rust-logo-filter);
386 .rustdoc.source .sidebar {
388 border-right: 1px solid;
390 /* The sidebar is by default hidden */
394 .sidebar, .mobile-topbar, .sidebar-menu-toggle,
395 #src-sidebar-toggle, #source-sidebar {
396 background-color: var(--sidebar-background-color);
399 #src-sidebar-toggle > button:hover, #src-sidebar-toggle > button:focus {
400 background-color: var(--sidebar-background-color-hover);
403 .source .sidebar > *:not(#src-sidebar-toggle) {
407 .source-sidebar-expanded .source .sidebar {
412 .source-sidebar-expanded .source .sidebar > *:not(#src-sidebar-toggle) {
420 /* Improve the scrollbar display on firefox */
422 scrollbar-width: initial;
423 scrollbar-color: var(--scrollbar-color);
426 scrollbar-width: thin;
427 scrollbar-color: var(--scrollbar-color);
430 /* Improve the scrollbar display on webkit-based browsers */
431 ::-webkit-scrollbar {
434 .sidebar::-webkit-scrollbar {
437 ::-webkit-scrollbar-track {
438 -webkit-box-shadow: inset 0;
439 background-color: var(--scrollbar-track-background-color);
441 .sidebar::-webkit-scrollbar-track {
442 background-color: var(--scrollbar-track-background-color);
444 ::-webkit-scrollbar-thumb, .sidebar::-webkit-scrollbar-thumb {
445 background-color: var(--scrollbar-thumb-background-color);
448 /* Everything else */
451 display: none !important;
454 .sidebar .logo-container {
461 overflow-wrap: break-word;
464 .logo-container > img {
469 ul.block, .block li {
478 padding: 0.25rem; /* 4px */
479 margin-left: -0.25rem;
483 overflow-wrap: anywhere;
489 font-size: 1.125rem; /* 18px */
499 .sidebar a, .sidebar .current {
500 color: var(--sidebar-link-color);
503 .sidebar a:hover:not(.logo-container) {
504 background-color: var(--sidebar-current-link-background-color);
507 .sidebar-elems .block {
511 .sidebar-elems .block li a {
513 text-overflow: ellipsis;
521 .rustdoc .example-wrap {
526 /* For the last child of a div, the margin will be taken care of
527 by the margin-top of the next item. */
528 .rustdoc .example-wrap:last-child {
532 .rustdoc .example-wrap > pre {
538 .rustdoc .example-wrap > pre.example-line-numbers,
539 .rustdoc .example-wrap > pre.src-line-numbers {
541 min-width: fit-content; /* prevent collapsing into nothing in truncated scraped examples */
544 -webkit-user-select: none;
547 color: var(--src-line-numbers-span-color);
550 .rustdoc .example-wrap > pre.src-line-numbers {
553 .src-line-numbers a, .src-line-numbers span {
554 color: var(--src-line-numbers-span-color);
557 .src-line-numbers :target {
558 background-color: transparent;
562 .src-line-numbers .line-highlighted {
563 background-color: var(--src-line-number-highlighted-background-color);
571 overflow-wrap: break-word;
572 overflow-wrap: anywhere;
574 /* Wrap non-pre code blocks (`text`) but not (```text```). */
575 .docblock :not(pre) > code,
576 .docblock-short code {
577 white-space: pre-wrap;
580 .top-doc .docblock h2 { font-size: 1.375rem; }
581 .top-doc .docblock h3 { font-size: 1.25rem; }
582 .top-doc .docblock h4,
583 .top-doc .docblock h5 {
586 .top-doc .docblock h6 {
590 .docblock h5 { font-size: 1rem; }
591 .docblock h6 { font-size: 0.875rem; }
598 .docblock > :not(.more-examples-toggle):not(.example-wrap) {
608 .docblock code, .docblock-short code,
609 pre, .rustdoc.source .example-wrap {
610 background-color: var(--code-block-background-color);
619 border-collapse: collapse;
622 .docblock table td, .docblock table th {
624 border: 1px solid var(--border-color);
627 .docblock table tbody tr:nth-child(2n) {
628 background: var(--table-alt-row-background-color);
631 /* Shift "where ..." part of method or fn definition down a line */
648 #main-content > .item-info {
654 flex-flow: row nowrap;
655 margin: 4px 0 25px 0;
670 text-decoration: none;
673 .small-section-header {
674 /* fields use <span> tags, but should get their own lines */
679 .small-section-header:hover > .anchor, .impl:hover > .anchor,
680 .trait-impl:hover > .anchor, .variant:hover > .anchor {
687 background: none !important;
692 .small-section-header > .anchor {
696 h2.small-section-header > .anchor {
700 .main-heading a:hover,
701 .example-wrap > pre.rust a:hover,
703 .docblock a:not(.test-arrow):not(.scrape-help):hover,
704 .docblock-short a:not(.test-arrow):not(.scrape-help):hover,
706 text-decoration: underline;
709 .crate.block a.current { font-weight: 500; }
711 /* In most contexts we use `overflow-wrap: anywhere` to ensure that we can wrap
712 as much as needed on mobile (see
713 src/test/rustdoc-gui/type-declaration-overflow.goml for an example of why
714 this matters). The `anywhere` value means:
716 "Soft wrap opportunities introduced by the word break are considered when
717 calculating min-content intrinsic sizes."
719 https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-wrap#values
721 For table layouts, that becomes a problem: the browser tries to make each
722 column as narrow as possible, and `overflow-wrap: anywhere` means it can do
723 so by breaking words - even if some other column could be shrunk without
724 breaking words! This shows up, for instance, in the `Structs` / `Modules` /
725 `Functions` (etcetera) sections of a module page, and when a docblock
728 So, for table layouts, override the default with break-word, which does
729 _not_ affect min-content intrinsic sizes.
733 overflow-wrap: break-word;
742 .item-left, .item-right {
746 padding-right: 1.25rem;
749 .search-results-title {
752 /* flex layout allows shrinking the <select> appropriately if it becomes too large */
754 /* make things look like in a line, despite the fact that we're using a layout
755 with boxes (i.e. from the flex layout) */
756 align-items: baseline;
759 /* ensures that 100% in properties of #crate-search-div:after
760 are relative to the size of this div */
762 /* allows this div (and with it the <select>-element "#crate-search") to be shrunk */
767 /* keep these two in sync with "@-moz-document url-prefix()" below */
768 padding: 0 23px 0 4px;
769 /* prevents the <select> from overflowing the containing div in case it's shrunk */
771 /* contents can overflow because of max-width limit, then show ellipsis */
772 text-overflow: ellipsis;
773 border: 1px solid var(--border-color);
777 -moz-appearance: none;
778 -webkit-appearance: none;
779 /* Removes default arrow from firefox */
781 background-color: var(--main-background-color);
786 #crate-search:hover, #crate-search:focus {
787 border-color: var(--crate-search-hover-border);
789 /* cancel stylistic differences in padding in firefox
790 for "appearance: none"-style (or equivalent) <select>s */
791 @-moz-document url-prefix() {
793 padding-left: 0px; /* == 4px - 4px */
794 padding-right: 19px; /* == 23px - 4px */
797 /* pseudo-element for holding the dropdown-arrow image; needs to be a separate thing
798 so that we can apply CSS-filters to change the arrow color in themes */
799 #crate-search-div::after {
800 /* lets clicks through! */
801 pointer-events: none;
802 /* completely covers the underlying div */
809 background-repeat: no-repeat;
810 background-size: 20px;
811 background-position: calc(100% - 2px) 56%;
812 /* image is black color */
813 background-image: url("down-arrow-927217e04c7463ac.svg");
814 /* changes the arrow image color */
815 filter: var(--crate-search-div-filter);
817 #crate-search-div:hover::after, #crate-search-div:focus-within::after {
818 filter: var(--crate-search-div-hover-filter);
820 #crate-search > option {
824 /* Override Normalize.css: it has a rule that sets
825 -webkit-appearance: textfield for search inputs. That
826 causes rounded corners and no border on iOS Safari. */
827 -webkit-appearance: none;
829 border: 1px solid var(--border-color);
834 background-color: var(--button-background-color);
835 color: var(--search-color);
837 .search-input:focus {
838 border-color: var(--search-input-focused-border-color);
845 .search-results.active {
849 .search-results > a {
851 /* A little margin ensures the browser's outlining of focused links has room to display. */
854 border-bottom: 1px solid var(--search-result-border-color);
858 .search-results > a > div {
862 .search-results > a > div.desc {
864 text-overflow: ellipsis;
868 .search-results a:hover,
869 .search-results a:focus {
870 background-color: var(--search-result-link-focus-background-color);
873 .search-results .result-name span.alias {
874 color: var(--search-results-alias-color);
876 .search-results .result-name span.grey {
877 color: var(--search-results-grey-color);
887 border: 1px solid var(--border-color);
888 background-color: var(--main-background-color);
889 color: var(--main-color);
890 --popover-arrow-offset: 11px;
893 /* This rule is to draw the little arrow connecting the settings menu to the gear icon. */
897 right: var(--popover-arrow-offset);
898 border: solid var(--border-color);
899 border-width: 1px 1px 0 0;
900 background-color: var(--main-background-color);
902 transform: rotate(-45deg);
906 /* use larger max-width for help popover, but not for help.html */
909 --popover-arrow-offset: 48px;
915 margin-right: 0.5rem;
917 #help span.top, #help span.bottom {
924 border-bottom: 1px solid var(--border-color);
930 border-top: 1px solid var(--border-color);
932 .side-by-side > div {
935 padding: 0 20px 20px 17px;
939 /* This min-height is needed to unify the height of the stab elements because some of them
948 margin-left: 0.3125em;
954 color: var(--main-color);
955 background-color: var(--stab-background-color);
958 white-space: pre-wrap;
960 display: inline-flex;
961 vertical-align: text-bottom;
964 .stab.portability > code {
966 color: var(--stab-code-color);
971 margin-right: 0.3rem;
974 /* Black one-pixel outline around emoji shapes */
983 .module-item.unstable,
984 .import-item.unstable {
1000 color: var(--right-side-color);
1008 /* Code highlighting */
1010 color: var(--code-highlight-kw-color);
1013 color: var(--code-highlight-kw-2-color);
1015 pre.rust .lifetime {
1016 color: var(--code-highlight-lifetime-color);
1018 pre.rust .prelude-ty {
1019 color: var(--code-highlight-prelude-color);
1021 pre.rust .prelude-val {
1022 color: var(--code-highlight-prelude-val-color);
1025 color: var(--code-highlight-string-color);
1028 color: var(--code-highlight-number-color);
1030 pre.rust .bool-val {
1031 color: var(--code-highlight-literal-color);
1034 color: var(--code-highlight-self-color);
1037 color: var(--code-highlight-attribute-color);
1040 pre.rust .macro-nonterminal {
1041 color: var(--code-highlight-macro-color);
1043 pre.rust .question-mark {
1045 color: var(--code-highlight-question-mark-color);
1048 color: var(--code-highlight-comment-color);
1050 pre.rust .doccomment {
1051 color: var(--code-highlight-doc-comment-color);
1054 .rustdoc.source .example-wrap pre.rust a {
1055 background: var(--codeblock-link-background);
1058 .example-wrap.compile_fail,
1059 .example-wrap.should_panic {
1060 border-left: 2px solid var(--codeblock-error-color);
1063 .ignore.example-wrap {
1064 border-left: 2px solid var(--codeblock-ignore-color);
1067 .example-wrap.compile_fail:hover,
1068 .example-wrap.should_panic:hover {
1069 border-left: 2px solid var(--codeblock-error-hover-color);
1072 .example-wrap.ignore:hover {
1073 border-left: 2px solid var(--codeblock-ignore-hover-color);
1076 .example-wrap.compile_fail .tooltip,
1077 .example-wrap.should_panic .tooltip {
1078 color: var(--codeblock-error-color);
1081 .example-wrap.ignore .tooltip {
1082 color: var(--codeblock-ignore-color);
1085 .example-wrap.compile_fail:hover .tooltip,
1086 .example-wrap.should_panic:hover .tooltip {
1087 color: var(--codeblock-error-hover-color);
1090 .example-wrap.ignore:hover .tooltip {
1091 color: var(--codeblock-ignore-hover-color);
1094 .example-wrap .tooltip {
1101 .example-wrap .tooltip:hover::after {
1102 padding: 5px 3px 3px 3px;
1106 border: 1px solid var(--border-color);
1111 background-color: var(--tooltip-background-color);
1112 color: var(--tooltip-color);
1115 .example-wrap .tooltip:hover::before {
1122 border: 5px solid transparent;
1123 border-right-color: var(--tooltip-background-color);
1126 .example-wrap.ignore .tooltip:hover::after {
1127 content: "This example is not tested";
1129 .example-wrap.compile_fail .tooltip:hover::after {
1130 content: "This example deliberately fails to compile";
1132 .example-wrap.should_panic .tooltip:hover::after {
1133 content: "This example panics";
1135 .example-wrap.edition .tooltip:hover::after {
1136 content: "This code runs with edition " attr(data-edition);
1139 .example-wrap.compile_fail .tooltip,
1140 .example-wrap.should_panic .tooltip,
1141 .example-wrap.ignore .tooltip {
1149 padding: 5px 10px 5px 10px;
1151 font-size: 1.375rem;
1155 color: var(--test-arrow-color);
1156 background-color: var(--test-arrow-background-color);
1158 a.test-arrow:hover {
1159 color: var(--test-arrow-hover-color);
1160 background-color: var(--test-arrow-hover-background-color);
1162 .example-wrap:hover .test-arrow {
1163 visibility: visible;
1168 color: var(--code-attribute-color);
1176 .out-of-band > span.since {
1189 margin-bottom: 40px;
1192 .sub-variant > .sub-variant-field {
1198 background-color: var(--target-background-color);
1199 border-right: 3px solid var(--target-border-color);
1208 /* placeholder thunk so that the mouse can easily travel from "(i)" to popover
1209 the resulting "hover tunnel" is a stepped triangle, approximating
1210 https://bjk5.com/post/44698559168/breaking-down-amazons-mega-dropdown */
1211 .notable-traits:hover::after {
1213 top: calc(100% - 10px);
1220 .notable .docblock {
1221 margin: 0.25em 0.5em;
1224 .notable .docblock pre, .notable .docblock code {
1225 background: transparent;
1229 white-space: pre-wrap;
1238 .search-failed.active {
1242 .search-failed > ul {
1251 flex-direction: row;
1256 #search-tabs button {
1258 font-size: 1.125rem;
1260 border-top: 2px solid;
1266 #search-tabs .count {
1268 color: var(--search-tab-title-count-color);
1271 #src-sidebar-toggle {
1276 border-bottom: 1px solid;
1279 justify-content: stretch;
1280 align-items: stretch;
1287 #source-sidebar > .title {
1290 border-bottom: 1px solid var(--border-color);
1293 #source-sidebar div.files > a:hover, details.dir-entry summary:hover,
1294 #source-sidebar div.files > a:focus, details.dir-entry summary:focus {
1295 background-color: var(--source-sidebar-background-hover);
1297 #source-sidebar div.files > a.selected {
1298 background-color: var(--source-sidebar-background-selected);
1300 #src-sidebar-toggle > button {
1309 /* iOS button gradient: https://stackoverflow.com/q/5438567 */
1310 -webkit-appearance: none;
1314 #settings-menu, #help-button {
1318 #settings-menu > a, #help-button > a {
1320 align-items: center;
1321 justify-content: center;
1322 background-color: var(--button-background-color);
1323 border: 1px solid var(--border-color);
1325 color: var(--settings-button-color);
1326 /* Rare exception to specifying font sizes in rem. Since this is acting
1327 as an icon, it's okay to specify their sizes in pixels. */
1332 #settings-menu > a:hover, #settings-menu > a:focus,
1333 #help-button > a:hover, #help-button > a:focus {
1334 border-color: var(--settings-button-border-focus);
1338 color: var(--copy-path-button-color);
1339 background: var(--main-background-color);
1348 filter: var(--copy-path-img-filter);
1350 #copy-path:hover > img {
1351 filter: var(--copy-path-img-hover-filter);
1354 @keyframes rotating {
1356 transform: rotate(0deg);
1359 transform: rotate(360deg);
1362 #settings-menu.rotate > a img {
1363 animation: rotating 2s linear infinite;
1367 display: inline-block;
1369 font: 15px monospace;
1371 vertical-align: middle;
1372 border: solid 1px var(--border-color);
1374 color: var(--kbd-color);
1375 background-color: var(--kbd-background);
1376 box-shadow: inset 0 -1px 0 var(--kbd-box-shadow-color);
1387 details.dir-entry > summary {
1393 details.dir-entry div.folders, details.dir-entry div.files {
1397 details.dir-entry a {
1401 /* We use CSS containment on the details elements because most sizeable elements
1402 of the page are contained in one of these. This also makes re-rendering
1403 faster on document changes (like closing and opening toggles).
1404 Unfortunately we can't yet specify contain: content or contain: strict
1405 because the [-]/[+] toggles extend past the boundaries of the <details>
1406 https://developer.mozilla.org/en-US/docs/Web/CSS/contain */
1407 details.rustdoc-toggle {
1412 /* The hideme class is used on summary tags that contain a span with
1413 placeholder text shown only when the toggle is closed. For instance,
1414 "Expand description" or "Show methods". */
1415 details.rustdoc-toggle > summary.hideme {
1420 details.rustdoc-toggle > summary {
1422 /* focus outline is shown on `::before` instead of this */
1425 details.rustdoc-toggle > summary::-webkit-details-marker,
1426 details.rustdoc-toggle > summary::marker {
1430 details.rustdoc-toggle > summary.hideme > span {
1434 details.rustdoc-toggle > summary::before {
1435 background: url("toggle-plus-1092eb4930d581b0.svg") no-repeat top left;
1440 display: inline-block;
1441 vertical-align: middle;
1443 filter: var(--toggle-filter);
1446 details.rustdoc-toggle > summary.hideme > span,
1447 .more-examples-toggle summary, .more-examples-toggle .hide-more {
1448 color: var(--toggles-color);
1451 /* Screen readers see the text version at the end the line.
1452 Visual readers see the icon at the start of the line, but small and transparent. */
1453 details.rustdoc-toggle > summary::after {
1461 details.rustdoc-toggle > summary.hideme::after {
1462 /* "hideme" toggles already have a description when they're contracted */
1466 details.rustdoc-toggle > summary:focus::before,
1467 details.rustdoc-toggle > summary:hover::before {
1471 details.rustdoc-toggle > summary:focus-visible::before {
1472 /* The SVG is black, and gets turned white using a filter in the dark themes.
1473 Do the same with the outline.
1474 The dotted 1px style is copied from Firefox's focus ring style.
1476 outline: 1px dotted #000;
1477 outline-offset: 1px;
1480 details.non-exhaustive {
1484 details.rustdoc-toggle > summary.hideme::before {
1488 details.rustdoc-toggle > summary:not(.hideme)::before {
1494 .impl-items > details.rustdoc-toggle > summary:not(.hideme)::before {
1499 /* When a "hideme" summary is open and the "Expand description" or "Show
1500 methods" text is hidden, we want the [-] toggle that remains to not
1501 affect the layout of the items to its right. To do that, we use
1502 absolute positioning. Note that we also set position: relative
1503 on the parent <details> to make this work properly. */
1504 details.rustdoc-toggle[open] > summary.hideme {
1508 details.rustdoc-toggle[open] > summary.hideme > span {
1512 details.rustdoc-toggle[open] > summary::before {
1513 background: url("toggle-minus-31bbd6e4c77f5c96.svg") no-repeat top left;
1516 details.rustdoc-toggle[open] > summary::after {
1517 content: "Collapse";
1520 /* This is needed in docblocks to have the "â–¶" element to be on the same line. */
1521 .docblock summary > * {
1522 display: inline-block;
1525 /* In case there is no documentation before a code block, we need to add some margin at the top
1526 to prevent an overlay between the "collapse toggle" and the information tooltip.
1527 However, it's not needed with smaller screen width because the doc/code block is always put
1528 "one line" below. */
1529 .docblock > .example-wrap:first-child .tooltip {
1536 WARNING: RUSTDOC_MOBILE_BREAKPOINT MEDIA QUERY
1537 If you update this line, then you also need to update the line with the same warning
1540 @media (max-width: 700px) {
1541 /* When linking to an item with an `id` (for instance, by clicking a link in the sidebar,
1542 or visiting a URL with a fragment like `#method.new`, we don't want the item to be obscured
1543 by the topbar. Anything with an `id` gets scroll-margin-top equal to .mobile-topbar's size.
1546 scroll-margin-top: 45px;
1550 /* Sidebar should overlay main content, rather than pushing main content to the right.
1551 Turn off `display: flex` on the body element. */
1561 flex-direction: column;
1566 margin-left: initial;
1570 .out-of-band .since::before {
1574 /* Hide the logo and item name from the sidebar. Those are displayed
1575 in the mobile-topbar instead. */
1576 .sidebar .logo-container,
1577 .sidebar .location {
1584 /* Hide the sidebar offscreen while not in use. Doing this instead of display: none means
1585 the sidebar stays visible for screen readers, which is useful for navigation. */
1588 /* Reduce height slightly to account for mobile topbar. */
1589 height: calc(100vh - 45px);
1593 /* The source view uses a different design for the sidebar toggle, and doesn't have a topbar,
1594 so don't bump down the main content or the sidebar. */
1596 .rustdoc.source .sidebar {
1604 .source-sidebar-expanded .source .sidebar,
1605 .rustdoc:not(.source) .sidebar:focus-within {
1611 margin: auto 0.5em auto auto;
1613 /* Rare exception to specifying font sizes in rem. Since the topbar
1614 height is specified in pixels, this also has to be specified in
1615 pixels to avoid overflowing the topbar when the user sets a bigger
1620 .mobile-topbar h2 a {
1622 text-overflow: ellipsis;
1624 white-space: nowrap;
1627 .mobile-topbar .logo-container > img {
1630 margin: 5px 0 5px 20px;
1635 flex-direction: row;
1645 .sidebar-menu-toggle {
1647 /* Rare exception to specifying font sizes in rem. Since this is acting
1648 as an icon, it's okay to specify its sizes in pixels. */
1651 color: var(--main-color);
1659 display: none !important;
1662 #search-tabs .count {
1666 #main-content > details.rustdoc-toggle > summary::before,
1667 #main-content > div > details.rustdoc-toggle > summary::before {
1671 #src-sidebar-toggle {
1679 border-top-right-radius: 3px;
1680 border-bottom-right-radius: 3px;
1685 .source-sidebar-expanded #src-sidebar-toggle {
1689 border-top-right-radius: unset;
1690 border-bottom-right-radius: unset;
1693 border-bottom: 1px solid;
1696 /* We don't display these buttons on mobile devices. */
1697 #copy-path, #help-button {
1701 /* Display an alternating layout on tablets and phones */
1702 .item-table, .item-row, .item-left, .item-right,
1703 .search-results > a, .search-results > a > div {
1707 /* Display an alternating layout on tablets and phones */
1708 .search-results > a {
1711 .search-results > a > div.desc, .item-right {
1715 .source-sidebar-expanded .source .sidebar {
1720 /* Position of the "[-]" element. */
1721 details.rustdoc-toggle:not(.top-doc) > summary {
1724 .impl-items > details.rustdoc-toggle > summary:not(.hideme)::before,
1725 #main-content > details.rustdoc-toggle:not(.top-doc) > summary::before,
1726 #main-content > div > details.rustdoc-toggle > summary::before {
1730 /* Align summary-nested and unnested item-info gizmos. */
1731 .impl-items > .item-info {
1741 /* Should have min-width: (N + 1)px where N is the mobile breakpoint above. */
1742 @media (min-width: 701px) {
1743 /* Places file-link for a scraped example on top of the example to save space.
1744 We only do this on large screens so the file-link doesn't overlap too much
1745 with the example's content. */
1746 .scraped-example-title {
1749 background: var(--main-background-color);
1753 box-shadow: 0 0 4px var(--main-background-color);
1758 nav.sidebar, nav.sub, .out-of-band, a.srclink, #copy-path,
1759 details.rustdoc-toggle[open] > summary::before, details.rustdoc-toggle > summary::before,
1760 details.rustdoc-toggle.top-doc > summary {
1773 @media (max-width: 464px) {
1779 overflow-wrap: break-word;
1780 overflow-wrap: anywhere;
1784 flex-direction: column;
1788 align-self: stretch;
1791 .sub-logo-container > img {
1798 .implementors-toggle > summary,
1800 #implementors-list > .docblock,
1801 .impl-items > section,
1802 .impl-items > .rustdoc-toggle > summary,
1804 .methods > .rustdoc-toggle > summary
1806 margin-bottom: 0.75em;
1809 .variants > .docblock,
1810 .implementors-toggle > .docblock,
1811 .impl-items > .rustdoc-toggle[open]:not(:last-child),
1812 .methods > .rustdoc-toggle[open]:not(:last-child),
1813 .implementors-toggle[open]:not(:last-child) {
1817 #trait-implementations-list .impl-items > .rustdoc-toggle:not(:last-child),
1818 #synthetic-implementations-list .impl-items > .rustdoc-toggle:not(:last-child),
1819 #blanket-implementations-list .impl-items > .rustdoc-toggle:not(:last-child) {
1823 /* Begin: styles for --scrape-examples feature */
1825 .scraped-example-list .scrape-help {
1828 font-weight: normal;
1832 border: 1px solid var(--scrape-example-help-border-color);
1833 border-radius: 50px;
1834 color: var(--scrape-example-help-color);
1836 .scraped-example-list .scrape-help:hover {
1837 border-color: var(--scrape-example-help-hover-border-color);
1838 color: var(--scrape-example-help-hover-color);
1842 /* So .scraped-example-title can be positioned absolutely */
1846 .scraped-example .code-wrapper {
1849 flex-direction: row;
1854 .scraped-example:not(.expanded) .code-wrapper {
1855 /* scrape-examples.js has a constant DEFAULT_MAX_LINES (call it N) for the number
1856 * of lines shown in the un-expanded example code viewer. This pre needs to have
1857 * a max-height equal to line-height * N. The line-height is currently 1.5em,
1858 * and we include additional 10px for padding. */
1859 max-height: calc(1.5em * 5 + 10px);
1862 .scraped-example:not(.expanded) .code-wrapper pre {
1865 /* See above comment, should be the same max-height. */
1866 max-height: calc(1.5em * 5 + 10px);
1869 .more-scraped-examples .scraped-example:not(.expanded) .code-wrapper,
1870 .more-scraped-examples .scraped-example:not(.expanded) .code-wrapper pre {
1871 /* See above comment, except this height is based on HIDDEN_MAX_LINES. */
1872 max-height: calc(1.5em * 10 + 10px);
1875 .scraped-example .code-wrapper .next,
1876 .scraped-example .code-wrapper .prev,
1877 .scraped-example .code-wrapper .expand {
1878 color: var(--main-color);
1885 /* iOS button gradient: https://stackoverflow.com/q/5438567 */
1886 -webkit-appearance: none;
1889 .scraped-example .code-wrapper .prev {
1892 .scraped-example .code-wrapper .next {
1895 .scraped-example .code-wrapper .expand {
1899 .scraped-example:not(.expanded) .code-wrapper:before,
1900 .scraped-example:not(.expanded) .code-wrapper:after {
1907 .scraped-example:not(.expanded) .code-wrapper:before {
1910 .scraped-example:not(.expanded) .code-wrapper:after {
1914 .scraped-example .code-wrapper .example-wrap {
1920 .scraped-example:not(.expanded) .code-wrapper .example-wrap {
1924 .scraped-example .example-wrap .rust span.highlight {
1925 background: var(--scrape-example-code-line-highlight);
1927 .scraped-example .example-wrap .rust span.highlight.focus {
1928 background: var(--scrape-example-code-line-highlight-focus);
1931 .more-examples-toggle {
1932 max-width: calc(100% + 25px);
1937 .more-examples-toggle .hide-more {
1942 .more-scraped-examples {
1951 right: calc(100% + 10px);
1956 .toggle-line-inner {
1959 background: var(--scrape-example-toggle-line-background);
1962 .toggle-line:hover .toggle-line-inner {
1963 background: var(--scrape-example-toggle-line-hover-background);
1966 .more-scraped-examples .scraped-example, .example-links {
1970 .more-scraped-examples .scraped-example:first-child {
1978 /* End: styles for --scrape-examples feature */