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;
1115 /* This min-height is needed to unify the height of the stab elements because some of them
1120 align-items: center
;
1121 white-space: pre-wrap
;
1126 font-size: 0.875rem;
1127 font-weight: normal
;
1138 /* Black one-pixel outline around emoji shapes */
1148 .import-item .stab {
1150 display: inline-block
;
1151 font-size: 0.875rem;
1154 margin-left: 0.3125em;
1156 vertical-align: text-bottom
;
1159 .module-item
.unstable
,
1160 .import-item.unstable {
1165 font-weight: normal
;
1175 .impl-items .srclink, .impl .srclink, .methods .srclink {
1176 /* Override header settings otherwise it's too bold */
1177 font-weight: normal
;
1189 .variants_table tbody tr td:first-child {
1190 width: 1%; /* make the variant name as small as possible */
1201 pre
.rust
.question-mark
{
1206 display: inline-block
;
1209 padding: 5px 10px 5px 10px;
1211 font-size: 1.375rem;
1216 .example-wrap:hover .test-arrow {
1217 visibility: visible
;
1220 text-decoration: none
;
1232 .out-of-band > span.since {
1239 font-size: 1.125rem;
1240 margin-bottom: 10px;
1241 border-bottom: none
;
1247 border-bottom: none
;
1254 margin-bottom: 40px;
1257 .sub-variant > .sub-variant-field {
1262 display: inline-block
;
1267 :target
> code
, :target
> .code-header
{
1284 display: inline-block
;
1291 padding: 5px 3px 3px 3px;
1297 .tooltip.ignore::after {
1298 content: "This example is not tested";
1300 .tooltip.compile_fail::after {
1301 content: "This example deliberately fails to compile";
1303 .tooltip.should_panic::after {
1304 content: "This example panics";
1306 .tooltip.edition::after {
1307 content: "This code runs with edition " attr
(data-edition
);
1317 border-style: solid
;
1321 .tooltip:hover::before, .tooltip:hover::after {
1325 .tooltip.compile_fail, .tooltip.should_panic, .tooltip.ignore {
1330 .notable-traits-tooltip {
1331 display: inline-block
;
1335 .notable-traits:hover
.notable-traits-tooltiptext
,
1336 .notable-traits .notable-traits-tooltiptext.force-tooltip {
1337 display: inline-block
;
1340 .notable-traits .notable-traits-tooltiptext {
1342 padding: 5px 3px 3px 3px;
1352 .notable-traits-tooltip::after {
1353 /* The margin on the tooltip does not capture hover events,
1354 this extends the area of hover enough so that mouse hover is not
1355 lost when moving the mouse to the tooltip */
1356 content: "\00a0\00a0\00a0";
1359 .notable-traits .notable, .notable-traits .docblock {
1363 .notable-traits .notable {
1365 margin-bottom: 13px;
1366 font-size: 1.1875rem;
1371 .notable-traits .docblock code.content{
1377 /* Example code has the "Run" button that needs to be positioned relative to the pre */
1378 pre
.rust
.rust-example-rendered
{
1393 .search-failed.active {
1397 .search-failed > ul {
1412 font-size: 1.125rem;
1415 border-top: 2px solid
;
1418 #titles > button:first-child:last-child
{
1420 width: calc
(100% - 1px);
1423 #titles > button:not
(:last-child
) {
1425 width: calc
(33.3% - 1px);
1428 #titles > button
> div
.count
{
1429 display: inline-block
;
1445 border-bottom: 1px solid
;
1448 justify-content: center
;
1449 align-items: center
;
1457 #source-sidebar > .title
{
1460 border-bottom: 1px solid
;
1463 #sidebar-toggle > button
{
1475 /* work around button layout strangeness: https://stackoverflow.com/q/7271561 */
1477 /* iOS button gradient: https://stackoverflow.com/q/5438567 */
1478 -webkit-appearance: none
;
1481 #settings-menu, #help-button
{
1489 #settings-menu > a
, #help-button
> button
, #copy-path
{
1499 #settings-menu > a
, #help-button
> button
{
1505 @keyframes rotating
{
1507 transform: rotate
(0deg);
1510 transform: rotate
(360deg);
1513 #settings-menu.rotate
> a img
{
1514 animation: rotating
2s linear infinite
;
1517 .setting-line .radio-line input:checked {
1518 box-shadow: inset
0 0 0 3px var
(--main-background-color
);
1519 background-color: var
(--settings-input-color
);
1521 .setting-line .radio-line input:focus {
1522 box-shadow: 0 0 1px 1px var
(--settings-input-color
);
1524 /* In here we combine both `:focus` and `:checked` properties. */
1525 .setting-line .radio-line input:checked:focus {
1526 box-shadow: inset
0 0 0 3px var
(--main-background-color
),
1527 0 0 2px 2px var
(--settings-input-color
);
1529 .setting-line .radio-line input:hover {
1530 border-color: var
(--settings-input-color
) !important
;
1532 input:checked
+ .slider
{
1533 background-color: var
(--settings-input-color
);
1536 #help-button > button
{
1538 /* Rare exception to specifying font sizes in rem. Since this is acting
1539 as an icon, it's okay to specify their sizes in pixels. */
1545 background: initial
;
1563 #theme-choices > button
{
1568 background: rgba
(0,0,0,0);
1569 overflow-wrap: normal
;
1572 #theme-choices > button:not
(:first-child
) {
1573 border-top: 1px solid
;
1577 display: inline-block
;
1579 font: 15px monospace
;
1581 vertical-align: middle
;
1587 .hidden-by-impl-hider
,
1588 .hidden-by-usual-hider {
1589 /* important because of conflicting rule for small screens */
1590 display: none
!important
;
1593 #implementations-list > h3
> span
.in-band
{
1600 border-collapse: collapse
;
1605 .table-display tr td:first-child {
1609 .table-display tr td:last-child {
1612 .table-display .out-of-band {
1614 font-size: 1.125rem;
1618 .table-display td:hover .anchor {
1624 #main-content > ul
{
1627 #main-content > ul
> li
{
1639 details
.dir-entry
> summary
{
1641 list-style-position: outside
;
1645 details
.dir-entry div
.folders
, details
.dir-entry div
.files
{
1649 details
.dir-entry a
{
1653 /* The hideme class is used on summary tags that contain a span with
1654 placeholder text shown only when the toggle is closed. For instance,
1655 "Expand description" or "Show methods". */
1656 details
.rustdoc-toggle
> summary
.hideme
{
1660 details
.rustdoc-toggle
> summary
{
1663 details
.rustdoc-toggle
> summary::-webkit-details-marker
,
1664 details
.rustdoc-toggle
> summary::marker
{
1668 details
.rustdoc-toggle
> summary
.hideme
> span
{
1672 details
.rustdoc-toggle
> summary::before
{
1677 background-repeat: no-repeat
;
1678 background-position: top left
;
1679 display: inline-block
;
1680 vertical-align: middle
;
1684 /* Screen readers see the text version at the end the line.
1685 Visual readers see the icon at the start of the line, but small and transparent. */
1686 details
.rustdoc-toggle
> summary::after
{
1694 details
.rustdoc-toggle
> summary
.hideme::after
{
1695 /* "hideme" toggles already have a description when they're contracted */
1699 details
.rustdoc-toggle
> summary:focus::before
,
1700 details
.rustdoc-toggle
> summary:hover::before
{
1704 details
.rustdoc-toggle
.top-doc
> summary
,
1705 details
.rustdoc-toggle
.top-doc
> summary::before
,
1706 details
.rustdoc-toggle
.non-exhaustive
> summary
,
1707 details
.rustdoc-toggle
.non-exhaustive
> summary::before
{
1711 details
.non-exhaustive
{
1715 details
.rustdoc-toggle
> summary
.hideme::before
{
1719 details
.rustdoc-toggle
> summary:not
(.hideme
)::before
{
1725 .impl-items > details.rustdoc-toggle > summary:not(.hideme)::before {
1730 /* When a "hideme" summary is open and the "Expand description" or "Show
1731 methods" text is hidden, we want the [-] toggle that remains to not
1732 affect the layout of the items to its right. To do that, we use
1733 absolute positioning. Note that we also set position: relative
1734 on the parent <details> to make this work properly. */
1735 details
.rustdoc-toggle
[open
] > summary
.hideme
{
1739 details
.rustdoc-toggle
{
1743 details
.rustdoc-toggle
[open
] > summary
.hideme
> span
{
1747 details
.rustdoc-toggle
[open
] > summary::before
,
1748 details
.rustdoc-toggle
[open
] > summary
.hideme::before
{
1749 background-image: /* AUTOREPLACE: */url
("toggle-minus.svg");
1752 details
.rustdoc-toggle
> summary::before
{
1753 background-image: /* AUTOREPLACE: */url
("toggle-plus.svg");
1756 details
.rustdoc-toggle
[open
] > summary::before
,
1757 details
.rustdoc-toggle
[open
] > summary
.hideme::before
{
1760 background-repeat: no-repeat
;
1761 background-position: top left
;
1762 display: inline-block
;
1766 details
.rustdoc-toggle
[open
] > summary::after
,
1767 details
.rustdoc-toggle
[open
] > summary
.hideme::after
{
1768 content: "Collapse";
1771 /* This is needed in docblocks to have the "â–¶" element to be on the same line. */
1772 .docblock summary > * {
1773 display: inline-block
;
1779 WARNING: RUSTDOC_MOBILE_BREAKPOINT MEDIA QUERY;
1780 If you update this line, then you also need to update the line with the same warning
1781 in storage.js plus the media query with (max-width: 700px)
1783 @media (min-width: 701px) {
1784 /* In case there is no documentation before a code block, we need to add some margin at the top
1785 to prevent an overlay between the "collapse toggle" and the information tooltip.
1786 However, it's not needed with smaller screen width because the doc/code block is always put
1787 "one line" below. */
1788 .docblock > .information:first-child > .tooltip {
1792 /* When we expand the sidebar on the source code page, we hide the logo on the left of the
1793 search bar to have more space. */
1794 .source-sidebar-expanded .source .sidebar + main .width-limiter .sub-logo-container.rust-logo {
1798 .source-sidebar-expanded .source .sidebar {
1804 WARNING: RUSTDOC_MOBILE_BREAKPOINT MEDIA QUERY
1805 If you update this line, then you also need to update the line with the same warning
1806 in storage.js plus the media query with (min-width: 701px)
1808 @media (max-width: 700px) {
1809 /* When linking to an item with an `id` (for instance, by clicking a link in the sidebar,
1810 or visiting a URL with a fragment like `#method.new`, we don't want the item to be obscured
1811 by the topbar. Anything with an `id` gets scroll-margin-top equal to .mobile-topbar's size.
1814 scroll-margin-top: 45px;
1819 /* Sidebar should overlay main content, rather than pushing main content to the right.
1820 Turn off `display: flex` on the body element. */
1831 flex-direction: column
;
1834 .content .out-of-band {
1836 margin-left: initial
;
1840 .content .out-of-band .since::before {
1848 /* Hide the logo and item name from the sidebar. Those are displayed
1849 in the mobile-topbar instead. */
1850 .sidebar
.sidebar-logo
,
1851 .sidebar .location {
1862 /* Hide the sidebar offscreen while not in use. Doing this instead of display: none means
1863 the sidebar stays visible for screen readers, which is useful for navigation. */
1869 /* Reduce height slightly to account for mobile topbar. */
1870 height: calc
(100vh - 45px);
1873 /* The source view uses a different design for the sidebar toggle, and doesn't have a topbar,
1874 so don't bump down the main content or the sidebar. */
1876 .rustdoc.source .sidebar {
1884 .source-sidebar-expanded
.source
.sidebar
,
1885 .sidebar:focus-within {
1889 .rustdoc.source > .sidebar {
1896 .mobile-topbar .location a {
1901 .mobile-topbar .location {
1904 margin: auto
0.5em auto auto
;
1905 text-overflow: ellipsis
;
1907 white-space: nowrap
;
1908 /* Rare exception to specifying font sizes in rem. Since the topbar
1909 height is specified in pixels, this also has to be specified in
1910 pixels to avoid overflowing the topbar when the user sets a bigger
1915 .mobile-topbar .logo-container {
1919 .mobile-topbar .logo-container > img {
1929 flex-direction: row
;
1939 .source .mobile-topbar {
1943 .sidebar-menu-toggle {
1945 /* Rare exception to specifying font sizes in rem. Since this is acting
1946 as an icon, it's okay to specify its sizes in pixels. */
1952 background-color: var
(--sidebar-background-color
);
1955 .source nav:not(.sidebar).sub {
1973 display: none
!important
;
1982 #titles > button
> div
.count
{
1991 /* Because of ios, we need to actually have a full height sidebar title so the
1992 * actual sidebar can show up. But then we need to make it transparent so we don't
1993 * hide content. The filler just allows to create the background for the sidebar
1994 * title. But because of the absolute position, I had to lower the z-index.
1999 width: calc
(100% - 45px);
2003 border-bottom: 1px solid
;
2006 #main-content > details
.rustdoc-toggle
> summary::before
,
2007 #main-content > div
> details
.rustdoc-toggle
> summary::before
{
2020 border-top-right-radius: 3px;
2021 border-bottom-right-radius: 3px;
2028 .source-sidebar-expanded #sidebar-toggle {
2032 border-top-right-radius: unset
;
2033 border-bottom-right-radius: unset
;
2036 border-bottom: 1px solid
;
2043 #main-content > .line-numbers
{
2047 .notable-traits .notable-traits-tooltiptext {
2052 /* We don't display the help button on mobile devices. */
2057 /* Display an alternating layout on tablets and phones */
2063 flex-flow: column wrap
;
2065 .item-left, .item-right {
2069 /* Display an alternating layout on tablets and phones */
2070 .search-results > a {
2071 border-bottom: 1px solid
#aaa9;
2074 .search-results .result-name, .search-results div.desc, .search-results .result-description {
2077 .search-results div.desc, .search-results .result-description, .item-right {
2081 .source-sidebar-expanded .source .sidebar {
2086 /* Position of the "[-]" element. */
2087 details
.rustdoc-toggle:not
(.top-doc
) > summary
{
2090 .impl-items
> details
.rustdoc-toggle
> summary:not
(.hideme
)::before
,
2091 #main-content > details
.rustdoc-toggle:not
(.top-doc
) > summary::before
,
2092 #main-content > div
> details
.rustdoc-toggle
> summary::before
{
2098 nav
.sidebar
, nav
.sub
, .content
.out-of-band
, a
.srclink
, #copy-path
,
2099 details
.rustdoc-toggle
[open
] > summary::before
, details
.rustdoc-toggle
> summary::before
,
2100 details
.rustdoc-toggle
.top-doc
> summary
{
2113 @media (max-width: 464px) {
2114 #titles, #titles
> button
{
2118 #main-content > table:not
(.table-display
) td
{
2119 word-break: break-word
;
2132 overflow-wrap: break-word
;
2133 overflow-wrap: anywhere
;
2137 flex-direction: column
;
2140 .sub-logo-container {
2144 .source .sub-logo-container > img {
2152 .source-sidebar-expanded #sidebar-toggle {
2157 .method-toggle summary
,
2158 .implementors-toggle summary
,
2160 margin-bottom: 0.75em;
2163 .method-toggle[open] {
2167 .implementors-toggle[open] {
2171 #trait-implementations-list .method-toggle
,
2172 #synthetic-implementations-list .method-toggle
,
2173 #blanket-implementations-list .method-toggle
{
2177 /* Begin: styles for --scrape-examples feature */
2179 .scraped-example-list .scrape-help {
2182 font-weight: normal
;
2186 background: transparent
;
2188 border-style: solid
;
2189 border-radius: 50px;
2192 .scraped-example .code-wrapper {
2195 flex-direction: row
;
2200 .scraped-example:not(.expanded) .code-wrapper {
2204 .scraped-example:not(.expanded) .code-wrapper pre {
2210 .scraped-example:not(.expanded) .code-wrapper pre.line-numbers {
2214 .scraped-example .code-wrapper .prev {
2222 .scraped-example .code-wrapper .next {
2230 .scraped-example .code-wrapper .expand {
2238 .scraped-example:not(.expanded) .code-wrapper:before {
2247 .scraped-example:not(.expanded) .code-wrapper:after {
2256 .scraped-example .code-wrapper .line-numbers {
2261 .scraped-example .code-wrapper .line-numbers span {
2265 .scraped-example .code-wrapper .example-wrap {
2272 .scraped-example:not(.expanded) .code-wrapper .example-wrap {
2276 .scraped-example .code-wrapper .example-wrap pre.rust {
2277 overflow-x: inherit
;
2283 .more-examples-toggle {
2284 max-width: calc
(100% + 25px);
2289 .more-examples-toggle .hide-more {
2295 .more-scraped-examples {
2298 flex-direction: row
;
2301 .more-scraped-examples-inner {
2302 /* 20px is width of toggle-line + toggle-line-inner */
2303 width: calc
(100% - 20px);
2307 align-self: stretch
;
2314 .toggle-line-inner {
2319 .more-scraped-examples .scraped-example {
2320 margin-bottom: 20px;
2323 .more-scraped-examples .scraped-example:last-child {
2335 /* End: styles for --scrape-examples feature */