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'), url("SourceSerif4-Regular.ttf.woff") format('woff');
30 font-family: 'Source Serif 4';
33 src: local('Source Serif 4 Italic'), url("SourceSerif4-It.ttf.woff") format('woff');
37 font-family: 'Source Serif 4';
40 src: local('Source Serif 4 Bold'), url("SourceSerif4-Bold.ttf.woff") format('woff');
44 /* See SourceCodePro-LICENSE.txt for the Source Code Pro license. */
46 font-family: 'Source Code Pro';
49 /* Avoid using locally installed font because bad versions are in circulation:
50 * see https://github.com/rust-lang/rust/issues/24355 */
51 src: url("SourceCodePro-Regular.ttf.woff") format('woff');
55 font-family: 'Source Code Pro';
58 src: url("SourceCodePro-It.ttf.woff") format('woff');
62 font-family: 'Source Code Pro';
65 src: url("SourceCodePro-Semibold.ttf.woff") format('woff');
70 -webkit-box-sizing: border-box;
71 -moz-box-sizing: border-box;
72 box-sizing: border-box;
75 /* This part handles the "default" theme being used depending on the system one. */
79 @media (prefers-color-scheme: light) {
84 @media (prefers-color-scheme: dark) {
90 /* General structure and fonts */
93 font: 16px/1.4 "Source Serif 4", serif;
96 padding: 10px 15px 20px 15px;
98 -webkit-font-feature-settings: "kern", "liga";
99 -moz-font-feature-settings: "kern", "liga";
100 font-feature-settings: "kern", "liga";
112 h1, h2, h3:not(.impl):not(.method):not(.type):not(.tymethod):not(.notable),
113 h4:not(.method):not(.type):not(.tymethod):not(.associatedconstant):not(.associatedtype) {
115 margin: 20px 0 15px 0;
120 border-bottom: 1px dashed;
123 /* workaround to keep flex from breaking below 700 px width due to the float: right on the nav
127 h1.fqn > .in-band > a:hover {
128 text-decoration: underline;
130 h2, h3:not(.impl):not(.method):not(.type):not(.tymethod),
131 h4:not(.method):not(.type):not(.tymethod):not(.associatedconstant):not(.associatedtype) {
132 border-bottom: 1px solid;
134 h3.impl, h3.method, h4.method, h3.type, h4.type, h4.associatedconstant, h4.associatedtype {
141 h3.impl, h3.method, h4.method.trait-impl, h3.type,
142 h4.type.trait-impl, h4.associatedconstant.trait-impl, h4.associatedtype.trait-impl {
147 .sidebar, a.source, .search-input, .content table td:first-child > a,
148 .collapse-toggle, div.item-list .out-of-band,
149 #source-sidebar, #sidebar-toggle,
150 details.rustdoc-toggle > summary::before,
151 details.undocumented > summary::before,
152 .content ul.crate a.crate,
153 /* This selector is for the items listed in the "all items" page. */
154 #main > ul.docblock > li > a {
155 font-family: "Fira Sans", Arial, sans-serif;
158 .content ul.crate a.crate {
165 ul ul, ol ul, ul ol, ol ol {
177 code, pre, a.test-arrow {
178 font-family: "Source Code Pro", monospace;
180 .docblock code, .docblock-short code {
184 .docblock pre code, .docblock-short pre code {
192 .source .content pre {
214 text-transform: uppercase;
226 /* Improve the scrollbar display on firefox */
228 scrollbar-width: initial;
231 scrollbar-width: thin;
234 /* Improve the scrollbar display on webkit-based browsers */
235 ::-webkit-scrollbar {
238 .sidebar::-webkit-scrollbar {
241 ::-webkit-scrollbar-track {
242 -webkit-box-shadow: inset 0;
245 .sidebar .block > ul > li {
253 /* Everything else */
256 display: none !important;
268 .logo-container > img {
274 transform: translate(-50%, -50%);
281 margin: 30px 10px 20px 10px;
283 word-wrap: break-word;
289 border-bottom: 1px solid;
290 overflow-wrap: break-word;
291 word-wrap: break-word; /* deprecated */
292 word-break: break-word; /* Chrome, non-standard */
299 .location a:first-child {
307 .block h2, .block h3 {
312 .block ul, .block li {
320 text-overflow: ellipsis;
326 transition: border 500ms ease-out;
330 border-top: 1px solid;
331 border-bottom: 1px solid;
354 .source .content pre.rust {
360 .rustdoc:not(.source) .example-wrap {
361 display: inline-flex;
370 .example-wrap > pre.line-number {
373 border-top-left-radius: 5px;
374 border-bottom-left-radius: 5px;
379 .rustdoc:not(.source) .example-wrap > pre.rust {
384 .rustdoc:not(.source) .example-wrap > pre {
398 .content pre.line-numbers {
403 -webkit-user-select: none;
404 -moz-user-select: none;
405 -ms-user-select: none;
413 overflow-wrap: anywhere;
421 text-overflow: ellipsis;
424 /* Wrap non-pre code blocks (`text`) but not (```text```). */
425 .docblock > :not(pre) > code,
426 .docblock-short > :not(pre) > code {
427 white-space: pre-wrap;
430 .docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5 {
431 border-bottom: 1px solid;
434 #main > .docblock h1 { font-size: 1.3em; }
435 #main > .docblock h2 { font-size: 1.15em; }
436 #main > .docblock h3, #main > .docblock h4, #main > .docblock h5 { font-size: 1em; }
438 #main > h2 + div, #main > h2 + h3, #main > h3 + div {
439 display: none; /* Changed to flex or block via js once the page is loaded */
443 .docblock h1 { font-size: 1em; }
444 .docblock h2 { font-size: 0.95em; }
445 .docblock h3, .docblock h4, .docblock h5 { font-size: 0.9em; }
452 .content .out-of-band {
461 h3.impl > .out-of-band {
465 h4.method > .out-of-band {
469 h4 > code, h3 > code, .invisible > code {
470 max-width: calc(100% - 41px);
476 display: inline-block;
486 display: inline-block;
494 font-family: "Fira Sans", Arial, sans-serif;
497 .content table:not(.table-display) {
498 border-spacing: 0 5px;
500 .content td { vertical-align: top; }
501 .content td:first-child { padding-right: 20px; }
502 .content td p:first-child { margin-top: 0; }
503 .content td h1, .content td h2 { margin-left: 0; font-size: 1.1em; }
504 .content tr:first-child td { border-top: 0; }
508 width: calc(100% - 2px);
527 .content .item-list {
528 list-style-type: none;
532 .content .multi-column {
533 -moz-column-count: 5;
534 -moz-column-gap: 2.5em;
535 -webkit-column-count: 5;
536 -webkit-column-gap: 2.5em;
540 .content .multi-column li { width: 100%; display: inline-block; }
546 /* Shift "where ..." part of method or fn definition down a line */
547 .content .method .where,
549 .content .where.fmt-newline {
554 .content .methods > div:not(.notable-traits) {
559 .content .docblock > .impl-items {
563 .content .docblock > .impl-items > h4 {
566 .content .docblock >.impl-items .table-display {
569 .content .docblock >.impl-items table td {
572 .toggle-wrapper.marg-left > .collapse-toggle {
575 .content .docblock > .impl-items .table-display, .impl-items table td {
579 .content .item-info code {
583 .content .item-info {
589 .sub-variant > div > .item-info {
593 .content .item-info::before {
601 .content .impl-items .method, .content .impl-items > .type, .impl-items > .associatedconstant,
602 .impl-items > .associatedtype, .content .impl-items details > summary > .type,
603 .impl-items details > summary > .associatedconstant,
604 .impl-items details > summary > .associatedtype {
608 .content .impl-items .docblock, .content .impl-items .item-info {
612 .content .impl-items > .item-info {
616 .methods > .item-info, .content .impl-items > .item-info {
629 border-bottom: 1px solid;
630 padding-bottom: 10px;
638 border-top: 1px solid;
639 border-bottom: 1px solid;
641 nav.main .separator {
643 display: inline-block;
647 nav.sum { text-align: right; }
648 nav.sub form { display: inline; }
655 text-decoration: none;
656 background: transparent;
659 .small-section-header:hover > .anchor {
663 .in-band:hover > .anchor, .impl:hover > .anchor, .method.trait-impl:hover > .anchor,
664 .type.trait-impl:hover > .anchor, .associatedconstant.trait-impl:hover > .anchor,
665 .associatedtype.trait-impl:hover > .anchor {
666 display: inline-block;
677 .small-section-header > .anchor {
679 padding-right: 10px; /* avoid gap that causes hover to disappear */
682 content: '\2002\00a7\2002';
685 .docblock a:not(.srclink):not(.test-arrow):hover,
686 .docblock-short a:not(.srclink):not(.test-arrow):hover, .item-info a {
687 text-decoration: underline;
690 .invisible > .srclink, h4 > code + .srclink, h3 > code + .srclink {
698 .block a.current.crate { font-weight: 500; }
703 .search-container > div {
704 display: inline-flex;
705 width: calc(100% - 63px);
715 border-radius: 4px 0 0 4px;
718 border-right: 1px solid;
719 -moz-appearance: none;
720 -webkit-appearance: none;
721 /* Removes default arrow from firefox */
724 background-repeat: no-repeat;
725 background-color: transparent;
726 background-size: 20px;
727 background-position: calc(100% - 1px) 56%;
729 .search-container > .top-button {
735 /* Override Normalize.css: we have margins and do
736 not want to overflow - the `moz` attribute is necessary
737 until Firefox 29, too early to drop at this point */
738 -moz-box-sizing: border-box !important;
739 box-sizing: border-box !important;
746 transition: border-color 300ms ease;
747 transition: border-radius 300ms ease-in-out;
748 transition: box-shadow 300ms ease-in-out;
752 #crate-search + .search-input {
753 border-radius: 0 1px 1px 0;
754 width: calc(100% - 32px);
757 .search-input:focus {
763 .search-results .desc {
765 text-overflow: ellipsis;
774 .content .search-results td:first-child {
778 .content .search-results td:first-child a {
781 .content .search-results td:first-child a:after {
786 .content .search-results td:first-child a span {
790 tr.result span.primitive::after {
791 content: ' (primitive type)';
795 tr.result span.keyword::after {
796 content: ' (keyword)';
800 body.blur > :not(#help) {
802 -webkit-filter: blur(8px);
813 justify-content: center;
818 box-shadow: 0 0 6px rgba(0,0,0,.2);
827 margin-right: 0.5rem;
834 border-bottom: 1px solid #ccc;
838 #help dd { margin: 5px 35px; }
839 #help .infos { padding-left: 0; }
840 #help h1, #help h2 { margin-top: 0; }
844 padding: 0 20px 20px 17px;;
867 /* Black one-pixel outline around emoji shapes */
879 display: inline-block;
885 vertical-align: text-bottom;
888 .module-item.unstable,
889 .import-item.unstable {
901 .impl-items .since, .impl .since, .methods .since {
908 .impl-items .srclink, .impl .srclink, .methods .srclink {
910 /* Override header settings otherwise it's too bold */
915 .impl-items code, .impl code, .methods code {
919 .impl-items h4, h4.impl, h3.impl, .methods h3 {
924 /* Push the src link out to the right edge consistently */
925 justify-content: space-between;
932 .variants_table tbody tr td:first-child {
933 width: 1%; /* make the variant name as small as possible */
944 pre.rust .question-mark {
949 display: inline-block;
951 padding: 5px 10px 5px 10px;
959 text-decoration: none;
962 .section-header:hover a:before {
965 padding-right: 10px; /* avoid gap that causes hover to disappear */
966 content: '\2002\00a7\2002';
969 .section-header:hover a {
970 text-decoration: none;
988 h3 > .collapse-toggle, h4 > .collapse-toggle {
993 .toggle-wrapper > .collapse-toggle {
1003 .toggle-wrapper.collapsed {
1005 transition: height .2s;
1006 margin-bottom: .6em;
1009 .collapse-toggle > .inner {
1010 display: inline-block;
1015 .collapse-toggle.hidden-default {
1021 display: table-cell;
1030 .out-of-band > span.since {
1036 .toggle-wrapper > .collapse-toggle {
1040 .variant + .toggle-wrapper + .docblock > p {
1044 .sub-variant, .sub-variant > h3 {
1045 margin-top: 0px !important;
1049 #main > details > .sub-variant > h3 {
1055 .sub-variant > div {
1057 margin-bottom: 10px;
1060 .sub-variant > div > span {
1066 display: inline-block;
1071 .docblock > .section-header:first-child {
1076 .docblock > .section-header:first-child:hover > a:before {
1080 #main > .variant, #main > .structfield {
1098 display: inline-block;
1105 padding: 5px 3px 3px 3px;
1111 .tooltip.ignore::after {
1112 content: "This example is not tested";
1114 .tooltip.compile_fail::after {
1115 content: "This example deliberately fails to compile";
1117 .tooltip.should_panic::after {
1118 content: "This example panics";
1120 .tooltip.edition::after {
1121 content: "This code runs with edition " attr(data-edition);
1131 border-style: solid;
1135 .tooltip:hover::before, .tooltip:hover::after {
1139 .tooltip.compile_fail, .tooltip.should_panic, .tooltip.ignore {
1144 .notable-traits-tooltip {
1145 display: inline-block;
1149 .notable-traits:hover .notable-traits-tooltiptext,
1150 .notable-traits .notable-traits-tooltiptext.force-tooltip {
1151 display: inline-block;
1154 .notable-traits .notable-traits-tooltiptext {
1156 padding: 5px 3px 3px 3px;
1166 .notable-traits-tooltip::after {
1167 /* The margin on the tooltip does not capture hover events,
1168 this extends the area of hover enough so that mouse hover is not
1169 lost when moving the mouse to the tooltip */
1170 content: "\00a0\00a0\00a0";
1173 .notable-traits .notable, .notable-traits .docblock {
1177 .notable-traits .docblock code.content{
1183 /* Example code has the "Run" button that needs to be positioned relative to the pre */
1184 pre.rust.rust-example-rendered {
1198 .search-failed > ul {
1216 border-top: 2px solid;
1219 #titles > button:not(:last-child) {
1221 width: calc(33.3% - 1px);
1224 #titles > button > div.count {
1225 display: inline-block;
1235 h4 > .notable-traits {
1245 margin-bottom: 10px;
1259 border-top-right-radius: 3px;
1260 border-bottom-right-radius: 3px;
1263 transition: left .5s;
1276 transition: left .5s;
1277 border-right: 1px solid;
1279 #source-sidebar > .title {
1282 border-bottom: 1px solid;
1292 .theme-picker button {
1296 #settings-menu, .help-button {
1306 #theme-picker, #settings-menu, .help-button, #copy-path {
1317 font-family: "Fira Sans", Arial, sans-serif;
1342 #theme-choices > button {
1347 background: rgba(0,0,0,0);
1350 #theme-choices > button:not(:first-child) {
1351 border-top: 1px solid;
1356 @media (min-width: 701px) {
1357 /* In case there is no documentation before a code block, we need to add some margin at the top
1358 to prevent an overlay between the "collapse toggle" and the information tooltip.
1359 However, it's not needed with smaller screen width because the doc/code block is always put
1360 "one line" below. */
1361 .docblock > .information:first-child > .tooltip {
1366 @media (max-width: 700px) {
1371 .rustdoc > .sidebar {
1381 .sidebar > .location {
1385 padding: 3px 10px 1px 10px;
1387 background: inherit;
1392 .sidebar .location:empty {
1396 .sidebar .logo-container {
1405 .sidebar .logo-container > img {
1419 border-bottom: 1px solid;
1420 border-right: 1px solid;
1424 .rustdoc.source > .sidebar > .sidebar-menu {
1435 border-right: 1px solid;
1439 .sidebar > .block.version {
1440 border-bottom: none;
1446 width: calc(100% - 32px);
1459 .content h4 > .out-of-band {
1463 .toggle-wrapper > .collapse-toggle {
1475 .content .impl-items .method, .content .impl-items > .type, .impl-items > .associatedconstant,
1476 .impl-items > .associatedtype {
1481 display: none !important;
1490 h4 > .notable-traits {
1496 #titles > button > div.count {
1509 background-color: rgba(0,0,0,0);
1513 This allows to prevent the version text to overflow the sidebar title on mobile mode when the
1514 sidebar is displayed (after clicking on the "hamburger" button).
1516 .sidebar.mobile > div.version {
1521 width: calc(100% + 30px);
1529 .show-it > .block.items {
1533 .show-it > .block.items > ul {
1537 .show-it > .block.items > ul > li {
1542 .show-it > .block.items > ul > li > a {
1546 /* Because of ios, we need to actually have a full height sidebar title so the
1547 * actual sidebar can show up. But then we need to make it transparent so we don't
1548 * hide content. The filler just allows to create the background for the sidebar
1549 * title. But because of the absolute position, I had to lower the z-index.
1554 width: calc(100% - 45px);
1558 border-bottom: 1px solid;
1565 .impl > .collapse-toggle {
1569 .item-list > details.rustdoc-toggle > summary:not(.hideme)::before {
1589 #main > .line-numbers {
1593 .notable-traits .notable-traits-tooltiptext {
1598 /* We don't display the help button on mobile devices. */
1602 .search-container > div {
1603 width: calc(100% - 32px);
1608 nav.sub, .content .out-of-band, .collapse-toggle {
1613 @media (max-width: 464px) {
1614 #titles, #titles > button {
1618 /* This is to prevent the search bar from being underneath the <section>
1619 * element following it.
1625 #main > table:not(.table-display) td {
1626 word-break: break-word;
1630 .search-container > div {
1632 width: calc(100% - 37px);
1641 #crate-search + .search-input {
1642 width: calc(100% + 71px);
1646 #theme-picker, #settings-menu {
1667 margin-bottom: 13px;
1672 display: inline-block;
1674 font: 15px monospace;
1676 vertical-align: middle;
1679 box-shadow: inset 0 -1px 0;
1683 .hidden-by-impl-hider,
1684 .hidden-by-usual-hider {
1685 /* important because of conflicting rule for small screens */
1686 display: none !important;
1689 #implementations-list > h3 > span.in-band {
1696 border-collapse: collapse;
1701 .table-display tr td:first-child {
1705 .table-display tr td:last-child {
1708 .table-display .out-of-band {
1713 #implementors-list > .impl-items .table-display .out-of-band {
1717 .table-display td:hover .anchor {
1747 div.files > a:hover, div.name:hover {
1748 background-color: #a14b4b;
1750 div.name.expand + .children {
1761 div.name.expand::before {
1762 transform: rotate(90deg);
1767 /* The hideme class is used on summary tags that contain a span with
1768 placeholder text shown only when the toggle is closed. For instance,
1769 "Expand description" or "Show methods". */
1770 details.rustdoc-toggle > summary.hideme {
1774 details.rustdoc-toggle > summary::-webkit-details-marker,
1775 details.rustdoc-toggle > summary::marker,
1776 details.undocumented > summary::-webkit-details-marker,
1777 details.undocumented > summary::marker {
1781 details.rustdoc-toggle > summary.hideme > span {
1785 details.rustdoc-toggle > summary::before {
1789 letter-spacing: 1px;
1793 details.rustdoc-toggle > summary.hideme::before {
1797 details.rustdoc-toggle > summary:not(.hideme)::before {
1803 .impl-items > details.rustdoc-toggle > summary:not(.hideme)::before,
1804 .undocumented > details.rustdoc-toggle > summary:not(.hideme)::before {
1810 /* When a "hideme" summary is open and the "Expand description" or "Show
1811 methods" text is hidden, we want the [-] toggle that remains to not
1812 affect the layout of the items to its right. To do that, we use
1813 absolute positioning. Note that we also set position: relative
1814 on the parent <details> to make this work properly. */
1815 details.rustdoc-toggle[open] > summary.hideme {
1819 details.rustdoc-toggle, details.undocumented {
1823 details.rustdoc-toggle[open] > summary.hideme > span {
1827 details.rustdoc-toggle[open] > summary::before {
1832 details.undocumented > summary::before {
1833 content: "[+] Show hidden undocumented items";
1839 details.undocumented[open] > summary::before {
1840 content: "[-] Hide undocumented items";