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 {
260 .source .content pre {
281 text-transform: uppercase
;
293 /* Improve the scrollbar display on firefox */
295 scrollbar-width: initial
;
298 scrollbar-width: thin
;
301 /* Improve the scrollbar display on webkit-based browsers */
302 ::-webkit-scrollbar
{
305 .sidebar::-webkit-scrollbar {
308 ::-webkit-scrollbar-track
{
309 -webkit-box-shadow: inset
0;
312 .sidebar .block > ul > li {
320 /* Everything else */
323 display: none
!important
;
335 .logo-container > img {
342 transform: translate
(-50%, -50%);
349 margin: 30px 10px 20px 10px;
351 word-wrap: break-word
;
352 font-weight: inherit
;
359 border-bottom: 1px solid
;
360 overflow-wrap: break-word
;
361 word-wrap: break-word
; /* deprecated */
362 word-break: break-word
; /* Chrome, non-standard */
369 .location a:first-of-type {
373 text-decoration: underline
;
380 .block h2, .block h3 {
383 .block ul, .block li {
391 text-overflow: ellipsis
;
397 transition: border
500ms ease-out
;
401 border-top: 1px solid
;
402 border-bottom: 1px solid
;
406 font-weight: inherit
;
427 .source .content pre.rust {
433 .rustdoc .example-wrap {
434 display: inline-flex
;
443 .example-wrap > pre.line-number {
448 border-top-left-radius: 5px;
449 border-bottom-left-radius: 5px;
452 .example-wrap > pre.rust a:hover {
453 text-decoration: underline
;
456 .rustdoc:not(.source) .example-wrap > pre:not(.line-number) {
461 .rustdoc .example-wrap > pre {
475 .content > .example-wrap pre.line-numbers {
477 -webkit-user-select: none
;
478 -moz-user-select: none
;
479 -ms-user-select: none
;
487 overflow-wrap: anywhere
;
495 text-overflow: ellipsis
;
498 /* Wrap non-pre code blocks (`text`) but not (```text```). */
499 .docblock
> :not
(pre
) > code
,
500 .docblock-short > :not(pre) > code {
501 white-space: pre-wrap
;
504 .docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5 {
505 border-bottom: 1px solid
;
508 .top-doc .docblock h1 { font-size: 1.3em; }
509 .top-doc .docblock h2 { font-size: 1.15em; }
510 .top-doc
.docblock h3
,
511 .top-doc
.docblock h4
,
512 .top-doc .docblock h5 {
516 .docblock h1 { font-size: 1em; }
517 .docblock h2 { font-size: 0.95em; }
518 .docblock h3, .docblock h4, .docblock h5 { font-size: 0.9em; }
525 .content .out-of-band {
534 .method > .code-header, .trait-impl > .code-header, .invisible > .code-header {
535 max-width: calc
(100% - 41px);
541 display: inline-block
;
550 .in-band > code, .in-band > .code-header {
551 display: inline-block
;
559 font-family: "Fira Sans", Arial
, sans-serif
;
562 .content table:not(.table-display) {
563 border-spacing: 0 5px;
565 .content td { vertical-align: top
; }
566 .content td:first-child { padding-right: 20px; }
567 .content td p:first-child { margin-top: 0; }
568 .content td h1, .content td h2 { margin-left: 0; font-size: 1.1em; }
569 .content tr:first-child td { border-top: 0; }
573 width: calc
(100% - 2px);
593 .content .item-list {
594 list-style-type: none
;
598 .content .multi-column {
599 -moz-column-count: 5;
600 -moz-column-gap: 2.5em;
601 -webkit-column-count: 5;
602 -webkit-column-gap: 2.5em;
606 .content .multi-column li { width: 100%; display: inline-block
; }
608 .content > .methods > .method {
612 /* Shift "where ..." part of method or fn definition down a line */
613 .content
.method
.where
,
615 .content .where.fmt-newline {
620 .content .methods > div:not(.notable-traits):not(.method) {
625 .content .docblock > .impl-items {
629 .content .docblock >.impl-items .table-display {
632 .content .docblock >.impl-items table td {
635 .content .docblock > .impl-items .table-display, .impl-items table td {
639 .content .item-info code {
643 .content .item-info {
648 .sub-variant > div > .item-info {
652 .content .item-info::before {
660 .content
.impl-items
.method
, .content
.impl-items
> .type
, .impl-items
> .associatedconstant
,
661 .impl-items
> .associatedtype
, .content
.impl-items details
> summary
> .type
,
662 .impl-items details
> summary
> .associatedconstant
,
663 .impl-items details > summary > .associatedtype {
667 .content .impl-items .docblock, .content .impl-items .item-info {
671 .content .impl-items > .item-info {
675 .methods > .item-info, .content .impl-items > .item-info {
688 border-bottom: 1px solid
;
689 padding-bottom: 10px;
697 border-top: 1px solid
;
698 border-bottom: 1px solid
;
700 nav
.main
.separator
{
702 display: inline-block
;
706 nav
.sum
{ text-align: right
; }
707 nav
.sub form
{ display: inline
; }
714 text-decoration: none
;
715 background: transparent
;
718 .small-section-header {
720 justify-content: space-between
;
724 .small-section-header:hover > .anchor {
728 .in-band:hover
> .anchor
, .impl:hover
> .anchor
, .method
.trait-impl:hover
> .anchor
,
729 .type
.trait-impl:hover
> .anchor
, .associatedconstant
.trait-impl:hover
> .anchor
,
730 .associatedtype.trait-impl:hover > .anchor {
731 display: inline-block
;
738 background: none
!important
;
743 .small-section-header > .anchor {
747 h2
.small-section-header
> .anchor
{
754 .docblock
a:not
(.srclink
):not
(.test-arrow
):hover
,
755 .docblock-short a:not(.srclink):not(.test-arrow):hover, .item-info a {
756 text-decoration: underline
;
759 .invisible
> .srclink
,
760 .method > .code-header + .srclink {
768 .block a.current.crate { font-weight: 500; }
774 grid-template-columns: auto
1fr;
775 /* align content left */
776 justify-items: start
;
779 .item-left, .item-right {
792 .search-container > div {
793 display: inline-flex
;
794 width: calc
(100% - 63px);
804 border-radius: 4px 0 0 4px;
807 border-right: 1px solid
;
808 -moz-appearance: none
;
809 -webkit-appearance: none
;
810 /* Removes default arrow from firefox */
813 background-repeat: no-repeat
;
814 background-color: transparent
;
815 background-size: 20px;
816 background-position: calc
(100% - 1px) 56%;
818 .search-container > .top-button {
824 /* Override Normalize.css: we have margins and do
825 not want to overflow - the `moz` attribute is necessary
826 until Firefox 29, too early to drop at this point */
827 -moz-box-sizing: border-box
!important
;
828 box-sizing: border-box
!important
;
835 transition: border-color
300ms ease
;
836 transition: border-radius
300ms ease-in-out
;
837 transition: box-shadow
300ms ease-in-out
;
841 #crate-search + .search-input
{
842 border-radius: 0 1px 1px 0;
843 width: calc
(100% - 32px);
846 .search-input:focus {
857 .search-results.active {
859 /* prevent overhanging tabs from moving the first result */
863 .search-results .desc > span {
865 text-overflow: ellipsis
;
870 .search-results > a {
873 /* A little margin ensures the browser's outlining of focused links has room to display. */
876 border-bottom: 1px solid
#aaa3;
879 .search-results > a > div {
884 .search-results .result-name, .search-results div.desc, .search-results .result-description {
887 .search-results .result-name {
891 .search-results .result-name > span {
892 display: inline-block
;
897 body
.blur
> :not
(#help
) {
899 -webkit-filter: blur
(8px);
910 justify-content: center
;
915 box-shadow: 0 0 6px rgba
(0,0,0,.2);
924 margin-right: 0.5rem;
931 border-bottom: 1px solid
#ccc;
935 #help dd
{ margin: 5px 35px; }
936 #help .infos
{ padding-left: 0; }
937 #help h1
, #help h2
{ margin-top: 0; }
941 padding: 0 20px 20px 17px;;
963 /* Black one-pixel outline around emoji shapes */
975 display: inline-block
;
981 vertical-align: text-bottom
;
984 .module-item
.unstable
,
985 .import-item.unstable {
994 .impl-items .since, .impl .since, .methods .since {
1000 .impl-items .srclink, .impl .srclink, .methods .srclink {
1001 /* Override header settings otherwise it's too bold */
1003 font-weight: normal
;
1012 margin-bottom: 12px;
1013 /* Push the src link out to the right edge consistently */
1014 justify-content: space-between
;
1021 .variants_table tbody tr td:first-child {
1022 width: 1%; /* make the variant name as small as possible */
1033 pre
.rust
.question-mark
{
1038 display: inline-block
;
1040 padding: 5px 10px 5px 10px;
1048 text-decoration: none
;
1051 .section-header:hover a:before {
1054 padding-right: 10px; /* avoid gap that causes hover to disappear */
1055 content: '\2002\00a7\2002';
1058 .section-header:hover a {
1059 text-decoration: none
;
1079 .out-of-band > span.since {
1085 .sub-variant, .sub-variant > h3 {
1086 margin-top: 0px !important
;
1090 #main .sub-variant
> h3
{
1096 .sub-variant > div {
1098 margin-bottom: 10px;
1101 .sub-variant > div > span {
1107 display: inline-block
;
1112 .docblock > .section-header:first-child {
1117 .docblock > .section-header:first-child:hover > a:before {
1121 :target
> code
, :target
> .code-header
{
1138 display: inline-block
;
1145 padding: 5px 3px 3px 3px;
1151 .tooltip.ignore::after {
1152 content: "This example is not tested";
1154 .tooltip.compile_fail::after {
1155 content: "This example deliberately fails to compile";
1157 .tooltip.should_panic::after {
1158 content: "This example panics";
1160 .tooltip.edition::after {
1161 content: "This code runs with edition " attr
(data-edition
);
1171 border-style: solid
;
1175 .tooltip:hover::before, .tooltip:hover::after {
1179 .tooltip.compile_fail, .tooltip.should_panic, .tooltip.ignore {
1184 .notable-traits-tooltip {
1185 display: inline-block
;
1189 .notable-traits:hover
.notable-traits-tooltiptext
,
1190 .notable-traits .notable-traits-tooltiptext.force-tooltip {
1191 display: inline-block
;
1194 .notable-traits .notable-traits-tooltiptext {
1196 padding: 5px 3px 3px 3px;
1206 .notable-traits-tooltip::after {
1207 /* The margin on the tooltip does not capture hover events,
1208 this extends the area of hover enough so that mouse hover is not
1209 lost when moving the mouse to the tooltip */
1210 content: "\00a0\00a0\00a0";
1213 .notable-traits .notable, .notable-traits .docblock {
1217 .notable-traits .notable {
1219 margin-bottom: 13px;
1224 .notable-traits .docblock code.content{
1230 /* Example code has the "Run" button that needs to be positioned relative to the pre */
1231 pre
.rust
.rust-example-rendered
{
1246 .search-failed.active {
1250 .search-failed > ul {
1268 border-top: 2px solid
;
1271 #titles > button:not
(:last-child
) {
1273 width: calc
(33.3% - 1px);
1276 #titles > button
> div
.count
{
1277 display: inline-block
;
1291 margin-bottom: 10px;
1305 border-top-right-radius: 3px;
1306 border-bottom-right-radius: 3px;
1309 transition: left
.5s;
1322 transition: left
.5s;
1323 border-right: 1px solid
;
1325 #source-sidebar > .title
{
1328 border-bottom: 1px solid
;
1338 .theme-picker button {
1342 #settings-menu, #help-button
{
1352 #theme-picker, #settings-menu
, #help-button
, #copy-path
{
1363 font-family: "Fira Sans", Arial
, sans-serif
;
1370 background: initial
;
1388 #theme-choices > button
{
1393 background: rgba
(0,0,0,0);
1396 #theme-choices > button:not
(:first-child
) {
1397 border-top: 1px solid
;
1401 display: inline-block
;
1403 font: 15px monospace
;
1405 vertical-align: middle
;
1408 box-shadow: inset
0 -1px 0;
1412 .hidden-by-impl-hider
,
1413 .hidden-by-usual-hider {
1414 /* important because of conflicting rule for small screens */
1415 display: none
!important
;
1418 #implementations-list > h3
> span
.in-band
{
1425 border-collapse: collapse
;
1430 .table-display tr td:first-child {
1434 .table-display tr td:last-child {
1437 .table-display .out-of-band {
1442 #implementors-list > .impl-items
.table-display
.out-of-band
{
1446 .table-display td:hover .anchor {
1476 div
.files
> a:hover
, div
.name:hover
{
1477 background-color: #a14b4b;
1479 div
.name
.expand
+ .children
{
1490 div
.name
.expand::before
{
1491 transform: rotate
(90deg);
1496 /* The hideme class is used on summary tags that contain a span with
1497 placeholder text shown only when the toggle is closed. For instance,
1498 "Expand description" or "Show methods". */
1499 details
.rustdoc-toggle
> summary
.hideme
{
1503 details
.rustdoc-toggle
> summary
, details
.undocumented
> summary
{
1506 details
.rustdoc-toggle
> summary::-webkit-details-marker
,
1507 details
.rustdoc-toggle
> summary::marker
,
1508 details
.undocumented
> summary::-webkit-details-marker
,
1509 details
.undocumented
> summary::marker
{
1513 details
.rustdoc-toggle
> summary
.hideme
> span
{
1517 details
.rustdoc-toggle
> summary::before
{
1521 height: max
(17px, 1.1em);
1522 background-repeat: no-repeat
;
1523 background-position: top left
;
1524 display: inline-block
;
1525 vertical-align: middle
;
1529 /* Screen readers see the text version at the end the line.
1530 Visual readers see the icon at the start of the line, but small and transparent. */
1531 details
.rustdoc-toggle
> summary::after
{
1539 details
.rustdoc-toggle
> summary
.hideme::after
{
1540 /* "hideme" toggles already have a description when they're contracted */
1544 details
.rustdoc-toggle
> summary:focus::before
,
1545 details
.rustdoc-toggle
> summary:hover::before
{
1549 details
.rustdoc-toggle
.top-doc
> summary
,
1550 details
.rustdoc-toggle
.top-doc
> summary::before
,
1551 details
.rustdoc-toggle
.non-exhaustive
> summary
,
1552 details
.rustdoc-toggle
.non-exhaustive
> summary::before
{
1553 font-family: 'Fira Sans';
1557 details
.non-exhaustive
{
1561 details
.rustdoc-toggle
> summary
.hideme::before
{
1565 details
.rustdoc-toggle
> summary:not
(.hideme
)::before
{
1571 .impl-items
> details
.rustdoc-toggle
> summary:not
(.hideme
)::before
,
1572 .undocumented > details.rustdoc-toggle > summary:not(.hideme)::before {
1577 /* When a "hideme" summary is open and the "Expand description" or "Show
1578 methods" text is hidden, we want the [-] toggle that remains to not
1579 affect the layout of the items to its right. To do that, we use
1580 absolute positioning. Note that we also set position: relative
1581 on the parent <details> to make this work properly. */
1582 details
.rustdoc-toggle
[open
] > summary
.hideme
{
1586 details
.rustdoc-toggle
, details
.undocumented
{
1590 details
.rustdoc-toggle
[open
] > summary
.hideme
> span
{
1594 details
.rustdoc-toggle
[open
] > summary::before
,
1595 details
.rustdoc-toggle
[open
] > summary
.hideme::before
{
1597 height: max
(17px, 1.1em);
1598 background-repeat: no-repeat
;
1599 background-position: top left
;
1600 display: inline-block
;
1604 details
.rustdoc-toggle
[open
] > summary::after
,
1605 details
.rustdoc-toggle
[open
] > summary
.hideme::after
{
1606 content: "Collapse";
1609 details
.undocumented
> summary::before
{
1611 height: max
(17px, 1.1em);
1612 background-repeat: no-repeat
;
1613 background-position: top left
;
1614 content: "Show hidden undocumented items";
1621 details
.undocumented
> summary:focus::before
,
1622 details
.undocumented
> summary:hover::before
{
1626 details
.undocumented
[open
] > summary::before
{
1628 height: max
(17px, 1.1em);
1629 background-repeat: no-repeat
1630 background-position: top left
;
1631 content: "Hide undocumented items";
1636 @media (min-width: 701px) {
1637 /* In case there is no documentation before a code block, we need to add some margin at the top
1638 to prevent an overlay between the "collapse toggle" and the information tooltip.
1639 However, it's not needed with smaller screen width because the doc/code block is always put
1640 "one line" below. */
1641 .docblock > .information:first-child > .tooltip {
1646 @media (max-width: 700px) {
1651 .rustdoc > .sidebar {
1661 .sidebar > .location {
1665 padding: 3px 10px 1px 10px;
1667 background: inherit
;
1672 .sidebar .location:empty {
1676 .sidebar .logo-container {
1685 .sidebar .logo-container > img {
1699 border-bottom: 1px solid
;
1700 border-right: 1px solid
;
1704 .rustdoc.source > .sidebar > .sidebar-menu {
1708 /* We do NOT hide this element so that alternative device readers still have this information
1716 /* We move the sidebar to the left by its own width so it doesn't appear. */
1719 border-right: 1px solid
;
1722 .sidebar > .block.version {
1724 border-bottom: none
;
1729 .sidebar > .block.version > div.narrow-helper {
1734 .sidebar > .block.version > p {
1735 /* hide Version text if too narrow */
1738 /* vertically center */
1740 align-items: center
;
1745 width: calc
(100% - 32px);
1763 display: none
!important
;
1778 #titles > button
> div
.count
{
1791 background-color: rgba
(0,0,0,0);
1795 This allows to prevent the version text to overflow the sidebar title on mobile mode when the
1796 sidebar is displayed (after clicking on the "hamburger" button).
1798 .sidebar.mobile > div.version {
1803 width: calc
(100% + 30px);
1806 .show-it, .sidebar-elems:focus-within {
1811 .show-it > .block.items {
1815 .show-it > .block.items > ul {
1819 .show-it > .block.items > ul > li {
1824 .show-it > .block.items > ul > li > a {
1828 /* Because of ios, we need to actually have a full height sidebar title so the
1829 * actual sidebar can show up. But then we need to make it transparent so we don't
1830 * hide content. The filler just allows to create the background for the sidebar
1831 * title. But because of the absolute position, I had to lower the z-index.
1836 width: calc
(100% - 45px);
1840 border-bottom: 1px solid
;
1843 #main > details
.rustdoc-toggle
> summary::before
,
1844 #main > div
> details
.rustdoc-toggle
> summary::before
{
1864 #main > .line-numbers
{
1868 .notable-traits .notable-traits-tooltiptext {
1873 /* We don't display the help button on mobile devices. */
1878 /* Display an alternating layout on tablets and phones */
1881 flex-flow: column wrap
;
1883 .item-left, .item-right {
1887 .search-container > div {
1888 width: calc
(100% - 32px);
1891 /* Display an alternating layout on tablets and phones */
1892 .search-results > a {
1893 border-bottom: 1px solid
#aaa9;
1896 .search-results .result-name, .search-results div.desc, .search-results .result-description {
1899 .search-results div.desc, .search-results .result-description, .item-right {
1905 nav
.sub
, .content
.out-of-band
{
1910 @media (max-width: 464px) {
1911 #titles, #titles
> button
{
1915 /* This is to prevent the search bar from being underneath the <section>
1916 * element following it.
1922 #main > table:not
(.table-display
) td
{
1923 word-break: break-word
;
1927 .search-container > div {
1929 width: calc
(100% - 37px);
1938 #crate-search + .search-input
{
1939 width: calc
(100% + 71px);
1943 #theme-picker, #settings-menu
{