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"),
8 url
("FiraSans-Regular.woff") format
('woff');
12 font-family: 'Fira Sans';
15 src: local
('Fira Sans Medium'),
16 url
("FiraSans-Medium.woff2") format
("woff2"),
17 url
("FiraSans-Medium.woff") format
('woff');
21 /* See SourceSerif4-LICENSE.md for the Source Serif 4 license. */
23 font-family: 'Source Serif 4';
26 src: local
('Source Serif 4'),
27 url
("SourceSerif4-Regular.ttf.woff2") format
("woff2"),
28 url
("SourceSerif4-Regular.ttf.woff") format
("woff");
32 font-family: 'Source Serif 4';
35 src: local
('Source Serif 4 Italic'),
36 url
("SourceSerif4-It.ttf.woff2") format
("woff2"),
37 url
("SourceSerif4-It.ttf.woff") format
("woff");
41 font-family: 'Source Serif 4';
44 src: local
('Source Serif 4 Bold'),
45 url
("SourceSerif4-Bold.ttf.woff2") format
("woff2"),
46 url
("SourceSerif4-Bold.ttf.woff") format
("woff");
50 /* See SourceCodePro-LICENSE.txt for the Source Code Pro license. */
52 font-family: 'Source Code Pro';
55 /* Avoid using locally installed font because bad versions are in circulation:
56 * see https://github.com/rust-lang/rust/issues/24355 */
57 src: url
("SourceCodePro-Regular.ttf.woff2") format
("woff2"),
58 url
("SourceCodePro-Regular.ttf.woff") format
("woff");
62 font-family: 'Source Code Pro';
65 src: url
("SourceCodePro-It.ttf.woff2") format
("woff2"),
66 url
("SourceCodePro-It.ttf.woff") format
("woff");
70 font-family: 'Source Code Pro';
73 src: url
("SourceCodePro-Semibold.ttf.woff2") format
("woff2"),
74 url
("SourceCodePro-Semibold.ttf.woff") format
("woff");
78 /* Avoid using legacy CJK serif fonts in Windows like Batang */
80 font-family: 'Noto Sans KR';
81 src: url
("noto-sans-kr-v13-korean-regular.woff") format
("woff");
83 unicode-range: U
+A960-A97F
, U
+AC00-D7AF
, U
+D7B0-D7FF
;
87 -webkit-box-sizing: border-box
;
88 -moz-box-sizing: border-box
;
89 box-sizing: border-box
;
92 /* This part handles the "default" theme being used depending on the system one. */
96 @media (prefers-color-scheme: light
) {
101 @media (prefers-color-scheme: dark
) {
107 /* General structure and fonts */
110 font: 16px/1.4 "Source Serif 4", "Noto Sans KR", serif
;
113 padding: 10px 15px 20px 15px;
115 -webkit-font-feature-settings: "kern", "liga";
116 -moz-font-feature-settings: "kern", "liga";
117 font-feature-settings: "kern", "liga";
131 margin: 20px 0 15px 0;
136 border-bottom: 1px dashed
;
139 /* workaround to keep flex from breaking below 700 px width due to the float: right on the nav
143 h1
.fqn
> .in-band
> a:hover
{
144 text-decoration: underline
;
147 border-bottom: 1px solid
;
149 h3
.code-header
, h4
.code-header
{
161 .impl-items
.associatedconstant
,
162 .methods
.associatedconstant
,
163 .impl-items
.associatedtype
,
164 .methods .associatedtype {
171 .impl
, .method
.trait-impl
,
173 .associatedconstant
.trait-impl
,
174 .associatedtype.trait-impl {
178 div
.impl-items
> div
{
183 .sidebar
, a
.source
, .search-input
, .search-results
.result-name
,
184 .content table
td:first-child
> a
,
186 div
.item-list
.out-of-band
, span
.since
,
187 #source-sidebar, #sidebar-toggle
,
188 details
.rustdoc-toggle
> summary::before
,
189 details
.undocumented
> summary::before
,
190 div
.impl-items
> div:not
(.docblock
):not
(.item-info
),
191 .content ul
.crate a
.crate
, a
.srclink
,
192 /* This selector is for the items listed in the "all items" page. */
193 #main > ul
.docblock
> li
> a
{
194 font-family: "Fira Sans", Arial
, sans-serif
;
197 .content ul.crate a.crate {
204 ul ul
, ol ul
, ul ol
, ol ol
{
216 /* Fix some style changes due to normalize.css 8 */
224 border-collapse: collapse
;
237 /* end tweaks for normalize.css 8 */
239 details:not
(.rustdoc-toggle
) summary
{
243 code
, pre
, a
.test-arrow
, .code-header
{
244 font-family: "Source Code Pro", monospace
;
246 .docblock code, .docblock-short code {
250 .docblock pre code, .docblock-short pre code {
261 .source .content pre {
282 text-transform: uppercase
;
294 /* Improve the scrollbar display on firefox */
296 scrollbar-width: initial
;
299 scrollbar-width: thin
;
302 /* Improve the scrollbar display on webkit-based browsers */
303 ::-webkit-scrollbar
{
306 .sidebar::-webkit-scrollbar {
309 ::-webkit-scrollbar-track
{
310 -webkit-box-shadow: inset
0;
313 .sidebar .block > ul > li {
321 /* Everything else */
324 display: none
!important
;
336 .logo-container > img {
343 transform: translate
(-50%, -50%);
350 margin: 30px 10px 20px 10px;
352 word-wrap: break-word
;
353 font-weight: inherit
;
360 border-bottom: 1px solid
;
361 overflow-wrap: break-word
;
362 word-wrap: break-word
; /* deprecated */
363 word-break: break-word
; /* Chrome, non-standard */
370 .location a:first-of-type {
374 text-decoration: underline
;
381 .block h2, .block h3 {
384 .block ul, .block li {
392 text-overflow: ellipsis
;
398 transition: border
500ms ease-out
;
402 border-top: 1px solid
;
403 border-bottom: 1px solid
;
407 font-weight: inherit
;
428 .source .content pre.rust {
434 .rustdoc .example-wrap {
435 display: inline-flex
;
444 .example-wrap > pre.line-number {
449 border-top-left-radius: 5px;
450 border-bottom-left-radius: 5px;
453 .rustdoc:not(.source) .example-wrap > pre:not(.line-number) {
458 .rustdoc .example-wrap > pre {
472 .content > .example-wrap pre.line-numbers {
474 -webkit-user-select: none
;
475 -moz-user-select: none
;
476 -ms-user-select: none
;
484 overflow-wrap: anywhere
;
492 text-overflow: ellipsis
;
495 /* Wrap non-pre code blocks (`text`) but not (```text```). */
496 .docblock
> :not
(pre
) > code
,
497 .docblock-short > :not(pre) > code {
498 white-space: pre-wrap
;
501 .docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5 {
502 border-bottom: 1px solid
;
505 .top-doc .docblock h1 { font-size: 1.3em; }
506 .top-doc .docblock h2 { font-size: 1.15em; }
507 .top-doc
.docblock h3
,
508 .top-doc
.docblock h4
,
509 .top-doc .docblock h5 {
513 .docblock h1 { font-size: 1em; }
514 .docblock h2 { font-size: 0.95em; }
515 .docblock h3, .docblock h4, .docblock h5 { font-size: 0.9em; }
522 .content .out-of-band {
531 .method > .code-header, .trait-impl > .code-header, .invisible > .code-header {
532 max-width: calc
(100% - 41px);
538 display: inline-block
;
547 .in-band > code, .in-band > .code-header {
548 display: inline-block
;
556 font-family: "Fira Sans", Arial
, sans-serif
;
559 .content table:not(.table-display) {
560 border-spacing: 0 5px;
562 .content td { vertical-align: top
; }
563 .content td:first-child { padding-right: 20px; }
564 .content td p:first-child { margin-top: 0; }
565 .content td h1, .content td h2 { margin-left: 0; font-size: 1.1em; }
566 .content tr:first-child td { border-top: 0; }
570 width: calc
(100% - 2px);
590 .content .item-list {
591 list-style-type: none
;
595 .content .multi-column {
596 -moz-column-count: 5;
597 -moz-column-gap: 2.5em;
598 -webkit-column-count: 5;
599 -webkit-column-gap: 2.5em;
603 .content .multi-column li { width: 100%; display: inline-block
; }
605 .content > .methods > .method {
609 /* Shift "where ..." part of method or fn definition down a line */
610 .content
.method
.where
,
612 .content .where.fmt-newline {
617 .content .methods > div:not(.notable-traits):not(.method) {
622 .content .docblock > .impl-items {
626 .content .docblock >.impl-items .table-display {
629 .content .docblock >.impl-items table td {
632 .content .docblock > .impl-items .table-display, .impl-items table td {
636 .content .item-info code {
640 .content .item-info {
645 .sub-variant > div > .item-info {
649 .content .item-info::before {
657 .content
.impl-items
.method
, .content
.impl-items
> .type
, .impl-items
> .associatedconstant
,
658 .impl-items
> .associatedtype
, .content
.impl-items details
> summary
> .type
,
659 .impl-items details
> summary
> .associatedconstant
,
660 .impl-items details > summary > .associatedtype {
664 .content .impl-items .docblock, .content .impl-items .item-info {
668 .content .impl-items > .item-info {
672 .methods > .item-info, .content .impl-items > .item-info {
685 border-bottom: 1px solid
;
686 padding-bottom: 10px;
694 border-top: 1px solid
;
695 border-bottom: 1px solid
;
697 nav
.main
.separator
{
699 display: inline-block
;
703 nav
.sum
{ text-align: right
; }
704 nav
.sub form
{ display: inline
; }
711 text-decoration: none
;
712 background: transparent
;
715 .small-section-header {
717 justify-content: space-between
;
721 .small-section-header:hover > .anchor {
725 .in-band:hover
> .anchor
, .impl:hover
> .anchor
, .method
.trait-impl:hover
> .anchor
,
726 .type
.trait-impl:hover
> .anchor
, .associatedconstant
.trait-impl:hover
> .anchor
,
727 .associatedtype.trait-impl:hover > .anchor {
728 display: inline-block
;
739 .small-section-header > .anchor {
741 padding-right: 10px; /* avoid gap that causes hover to disappear */
744 content: '\2002\00a7\2002';
747 .docblock
a:not
(.srclink
):not
(.test-arrow
):hover
,
748 .docblock-short a:not(.srclink):not(.test-arrow):hover, .item-info a {
749 text-decoration: underline
;
752 .invisible
> .srclink
,
753 .method > .code-header + .srclink {
761 .block a.current.crate { font-weight: 500; }
767 grid-template-columns: auto
1fr;
768 /* align content left */
769 justify-items: start
;
772 .item-left, .item-right {
785 .search-container > div {
786 display: inline-flex
;
787 width: calc
(100% - 63px);
797 border-radius: 4px 0 0 4px;
800 border-right: 1px solid
;
801 -moz-appearance: none
;
802 -webkit-appearance: none
;
803 /* Removes default arrow from firefox */
806 background-repeat: no-repeat
;
807 background-color: transparent
;
808 background-size: 20px;
809 background-position: calc
(100% - 1px) 56%;
811 .search-container > .top-button {
817 /* Override Normalize.css: we have margins and do
818 not want to overflow - the `moz` attribute is necessary
819 until Firefox 29, too early to drop at this point */
820 -moz-box-sizing: border-box
!important
;
821 box-sizing: border-box
!important
;
828 transition: border-color
300ms ease
;
829 transition: border-radius
300ms ease-in-out
;
830 transition: box-shadow
300ms ease-in-out
;
834 #crate-search + .search-input
{
835 border-radius: 0 1px 1px 0;
836 width: calc
(100% - 32px);
839 .search-input:focus {
850 .search-results.active {
852 /* prevent overhanging tabs from moving the first result */
856 .search-results .desc > span {
858 text-overflow: ellipsis
;
863 .search-results > a {
866 /* A little margin ensures the browser's outlining of focused links has room to display. */
869 border-bottom: 1px solid
#aaa3;
872 .search-results > a > div {
877 .search-results .result-name, .search-results div.desc, .search-results .result-description {
880 .search-results .result-name {
884 .search-results .result-name > span {
885 display: inline-block
;
890 body
.blur
> :not
(#help
) {
892 -webkit-filter: blur
(8px);
903 justify-content: center
;
908 box-shadow: 0 0 6px rgba
(0,0,0,.2);
917 margin-right: 0.5rem;
924 border-bottom: 1px solid
#ccc;
928 #help dd
{ margin: 5px 35px; }
929 #help .infos
{ padding-left: 0; }
930 #help h1
, #help h2
{ margin-top: 0; }
934 padding: 0 20px 20px 17px;;
956 /* Black one-pixel outline around emoji shapes */
968 display: inline-block
;
974 vertical-align: text-bottom
;
977 .module-item
.unstable
,
978 .import-item.unstable {
987 .impl-items .since, .impl .since, .methods .since {
993 .impl-items .srclink, .impl .srclink, .methods .srclink {
994 /* Override header settings otherwise it's too bold */
1005 margin-bottom: 12px;
1006 /* Push the src link out to the right edge consistently */
1007 justify-content: space-between
;
1014 .variants_table tbody tr td:first-child {
1015 width: 1%; /* make the variant name as small as possible */
1026 pre
.rust
.question-mark
{
1031 display: inline-block
;
1033 padding: 5px 10px 5px 10px;
1041 text-decoration: none
;
1044 .section-header:hover a:before {
1047 padding-right: 10px; /* avoid gap that causes hover to disappear */
1048 content: '\2002\00a7\2002';
1051 .section-header:hover a {
1052 text-decoration: none
;
1072 .out-of-band > span.since {
1078 .sub-variant, .sub-variant > h3 {
1079 margin-top: 0px !important
;
1083 #main .sub-variant
> h3
{
1089 .sub-variant > div {
1091 margin-bottom: 10px;
1094 .sub-variant > div > span {
1100 display: inline-block
;
1105 .docblock > .section-header:first-child {
1110 .docblock > .section-header:first-child:hover > a:before {
1114 :target
> code
, :target
> .code-header
{
1131 display: inline-block
;
1138 padding: 5px 3px 3px 3px;
1144 .tooltip.ignore::after {
1145 content: "This example is not tested";
1147 .tooltip.compile_fail::after {
1148 content: "This example deliberately fails to compile";
1150 .tooltip.should_panic::after {
1151 content: "This example panics";
1153 .tooltip.edition::after {
1154 content: "This code runs with edition " attr
(data-edition
);
1164 border-style: solid
;
1168 .tooltip:hover::before, .tooltip:hover::after {
1172 .tooltip.compile_fail, .tooltip.should_panic, .tooltip.ignore {
1177 .notable-traits-tooltip {
1178 display: inline-block
;
1182 .notable-traits:hover
.notable-traits-tooltiptext
,
1183 .notable-traits .notable-traits-tooltiptext.force-tooltip {
1184 display: inline-block
;
1187 .notable-traits .notable-traits-tooltiptext {
1189 padding: 5px 3px 3px 3px;
1199 .notable-traits-tooltip::after {
1200 /* The margin on the tooltip does not capture hover events,
1201 this extends the area of hover enough so that mouse hover is not
1202 lost when moving the mouse to the tooltip */
1203 content: "\00a0\00a0\00a0";
1206 .notable-traits .notable, .notable-traits .docblock {
1210 .notable-traits .notable {
1212 margin-bottom: 13px;
1217 .notable-traits .docblock code.content{
1223 /* Example code has the "Run" button that needs to be positioned relative to the pre */
1224 pre
.rust
.rust-example-rendered
{
1239 .search-failed.active {
1243 .search-failed > ul {
1261 border-top: 2px solid
;
1264 #titles > button:not
(:last-child
) {
1266 width: calc
(33.3% - 1px);
1269 #titles > button
> div
.count
{
1270 display: inline-block
;
1284 margin-bottom: 10px;
1298 border-top-right-radius: 3px;
1299 border-bottom-right-radius: 3px;
1302 transition: left
.5s;
1315 transition: left
.5s;
1316 border-right: 1px solid
;
1318 #source-sidebar > .title
{
1321 border-bottom: 1px solid
;
1331 .theme-picker button {
1335 #settings-menu, #help-button
{
1345 #theme-picker, #settings-menu
, #help-button
, #copy-path
{
1356 font-family: "Fira Sans", Arial
, sans-serif
;
1363 background: initial
;
1381 #theme-choices > button
{
1386 background: rgba
(0,0,0,0);
1389 #theme-choices > button:not
(:first-child
) {
1390 border-top: 1px solid
;
1394 display: inline-block
;
1396 font: 15px monospace
;
1398 vertical-align: middle
;
1401 box-shadow: inset
0 -1px 0;
1405 .hidden-by-impl-hider
,
1406 .hidden-by-usual-hider {
1407 /* important because of conflicting rule for small screens */
1408 display: none
!important
;
1411 #implementations-list > h3
> span
.in-band
{
1418 border-collapse: collapse
;
1423 .table-display tr td:first-child {
1427 .table-display tr td:last-child {
1430 .table-display .out-of-band {
1435 #implementors-list > .impl-items
.table-display
.out-of-band
{
1439 .table-display td:hover .anchor {
1469 div
.files
> a:hover
, div
.name:hover
{
1470 background-color: #a14b4b;
1472 div
.name
.expand
+ .children
{
1483 div
.name
.expand::before
{
1484 transform: rotate
(90deg);
1489 /* The hideme class is used on summary tags that contain a span with
1490 placeholder text shown only when the toggle is closed. For instance,
1491 "Expand description" or "Show methods". */
1492 details
.rustdoc-toggle
> summary
.hideme
{
1496 details
.rustdoc-toggle
> summary
, details
.undocumented
> summary
{
1499 details
.rustdoc-toggle
> summary::-webkit-details-marker
,
1500 details
.rustdoc-toggle
> summary::marker
,
1501 details
.undocumented
> summary::-webkit-details-marker
,
1502 details
.undocumented
> summary::marker
{
1506 details
.rustdoc-toggle
> summary
.hideme
> span
{
1510 details
.rustdoc-toggle
> summary::before
{
1514 letter-spacing: 1px;
1518 details
.rustdoc-toggle
.top-doc
> summary
,
1519 details
.rustdoc-toggle
.top-doc
> summary::before
,
1520 details
.rustdoc-toggle
.non-exhaustive
> summary
,
1521 details
.rustdoc-toggle
.non-exhaustive
> summary::before
{
1522 font-family: 'Fira Sans';
1526 details
.non-exhaustive
{
1530 details
.rustdoc-toggle
> summary
.hideme::before
{
1534 details
.rustdoc-toggle
> summary:not
(.hideme
)::before
{
1540 .impl-items
> details
.rustdoc-toggle
> summary:not
(.hideme
)::before
,
1541 .undocumented > details.rustdoc-toggle > summary:not(.hideme)::before {
1546 /* When a "hideme" summary is open and the "Expand description" or "Show
1547 methods" text is hidden, we want the [-] toggle that remains to not
1548 affect the layout of the items to its right. To do that, we use
1549 absolute positioning. Note that we also set position: relative
1550 on the parent <details> to make this work properly. */
1551 details
.rustdoc-toggle
[open
] > summary
.hideme
{
1555 details
.rustdoc-toggle
, details
.undocumented
{
1559 details
.rustdoc-toggle
[open
] > summary
.hideme
> span
{
1563 details
.rustdoc-toggle
[open
] > summary::before
{
1568 details
.undocumented
> summary::before
{
1569 content: "[+] Show hidden undocumented items";
1575 details
.undocumented
[open
] > summary::before
{
1576 content: "[−] Hide undocumented items";
1581 @media (min-width: 701px) {
1582 /* In case there is no documentation before a code block, we need to add some margin at the top
1583 to prevent an overlay between the "collapse toggle" and the information tooltip.
1584 However, it's not needed with smaller screen width because the doc/code block is always put
1585 "one line" below. */
1586 .docblock > .information:first-child > .tooltip {
1591 @media (max-width: 700px) {
1596 .rustdoc > .sidebar {
1606 .sidebar > .location {
1610 padding: 3px 10px 1px 10px;
1612 background: inherit
;
1617 .sidebar .location:empty {
1621 .sidebar .logo-container {
1630 .sidebar .logo-container > img {
1644 border-bottom: 1px solid
;
1645 border-right: 1px solid
;
1649 .rustdoc.source > .sidebar > .sidebar-menu {
1653 /* We do NOT hide this element so that alternative device readers still have this information
1661 /* We move the sidebar to the left by its own width so it doesn't appear. */
1664 border-right: 1px solid
;
1667 .sidebar > .block.version {
1669 border-bottom: none
;
1674 .sidebar > .block.version > div.narrow-helper {
1679 .sidebar > .block.version > p {
1680 /* hide Version text if too narrow */
1683 /* vertically center */
1685 align-items: center
;
1690 width: calc
(100% - 32px);
1708 display: none
!important
;
1723 #titles > button
> div
.count
{
1736 background-color: rgba
(0,0,0,0);
1740 This allows to prevent the version text to overflow the sidebar title on mobile mode when the
1741 sidebar is displayed (after clicking on the "hamburger" button).
1743 .sidebar.mobile > div.version {
1748 width: calc
(100% + 30px);
1751 .show-it, .sidebar-elems:focus-within {
1756 .show-it > .block.items {
1760 .show-it > .block.items > ul {
1764 .show-it > .block.items > ul > li {
1769 .show-it > .block.items > ul > li > a {
1773 /* Because of ios, we need to actually have a full height sidebar title so the
1774 * actual sidebar can show up. But then we need to make it transparent so we don't
1775 * hide content. The filler just allows to create the background for the sidebar
1776 * title. But because of the absolute position, I had to lower the z-index.
1781 width: calc
(100% - 45px);
1785 border-bottom: 1px solid
;
1788 #main > details
.rustdoc-toggle
> summary::before
,
1789 #main > div
> details
.rustdoc-toggle
> summary::before
{
1809 #main > .line-numbers
{
1813 .notable-traits .notable-traits-tooltiptext {
1818 /* We don't display the help button on mobile devices. */
1823 /* Display an alternating layout on tablets and phones */
1826 flex-flow: column wrap
;
1828 .item-left, .item-right {
1832 .search-container > div {
1833 width: calc
(100% - 32px);
1836 /* Display an alternating layout on tablets and phones */
1837 .search-results > a {
1838 border-bottom: 1px solid
#aaa9;
1841 .search-results .result-name, .search-results div.desc, .search-results .result-description {
1844 .search-results div.desc, .search-results .result-description, .item-right {
1850 nav
.sub
, .content
.out-of-band
{
1855 @media (max-width: 464px) {
1856 #titles, #titles
> button
{
1860 /* This is to prevent the search bar from being underneath the <section>
1861 * element following it.
1867 #main > table:not
(.table-display
) td
{
1868 word-break: break-word
;
1872 .search-container > div {
1874 width: calc
(100% - 37px);
1883 #crate-search + .search-input
{
1884 width: calc
(100% + 71px);
1888 #theme-picker, #settings-menu
{