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 SourceSerifPro-LICENSE.txt for the Source Serif Pro license. */
23 font-family: 'Source Serif Pro';
26 src: local('Source Serif Pro'), url("SourceSerifPro-Regular.ttf.woff") format('woff');
30 font-family: 'Source Serif Pro';
33 src: local('Source Serif Pro Italic'), url("SourceSerifPro-It.ttf.woff") format('woff');
37 font-family: 'Source Serif Pro';
40 src: local('Source Serif Pro Bold'), url("SourceSerifPro-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 Pro", 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) {
115 margin: 20px 0 15px 0;
119 border-bottom: 1px dashed;
122 h1.fqn > .in-band > a:hover {
123 text-decoration: underline;
125 h2, h3:not(.impl):not(.method):not(.type):not(.tymethod),
126 h4:not(.method):not(.type):not(.tymethod):not(.associatedconstant) {
127 border-bottom: 1px solid;
129 h3.impl, h3.method, h4.method, h3.type, h4.type, h4.associatedconstant {
136 h3.impl, h3.method, h3.type {
141 .sidebar, a.source, .search-input, .content table td:first-child > a,
142 .collapse-toggle, div.item-list .out-of-band,
143 #source-sidebar, #sidebar-toggle,
144 /* This selector is for the items listed in the "all items" page. */
145 #main > ul.docblock > li > a {
146 font-family: "Fira Sans", Arial, sans-serif;
149 .content ul.crate a.crate {
151 font-family: "Fira Sans", Arial, sans-serif;
157 ul ul, ol ul, ul ol, ol ol {
169 code, pre, a.test-arrow {
170 font-family: "Source Code Pro", monospace;
172 .docblock code, .docblock-short code {
176 .docblock pre code, .docblock-short pre code, .docblock code.spotlight {
180 .docblock code.spotlight :last-child {
181 padding-bottom: 0.6em;
187 .source .content pre {
209 text-transform: uppercase;
221 /* Improve the scrollbar display on firefox */
223 scrollbar-width: initial;
226 scrollbar-width: thin;
229 /* Improve the scrollbar display on webkit-based browsers */
230 ::-webkit-scrollbar {
233 .sidebar::-webkit-scrollbar {
236 ::-webkit-scrollbar-track {
237 -webkit-box-shadow: inset 0;
240 .sidebar .block > ul > li {
248 /* Everything else */
251 display: none !important;
263 .logo-container > img {
269 transform: translate(-50%, -50%);
276 margin: 30px 10px 20px 10px;
278 word-wrap: break-word;
284 border-bottom: 1px solid;
285 overflow-wrap: break-word;
286 word-wrap: break-word; /* deprecated */
287 word-break: break-word; /* Chrome, non-standard */
294 .location a:first-child {
302 .block h2, .block h3 {
307 .block ul, .block li {
315 text-overflow: ellipsis;
321 transition: border 500ms ease-out;
325 border-top: 1px solid;
326 border-bottom: 1px solid;
349 .source .content pre.rust {
355 .rustdoc:not(.source) .example-wrap {
356 display: inline-flex;
365 .example-wrap > pre.line-number {
368 border-top-left-radius: 5px;
369 border-bottom-left-radius: 5px;
374 .rustdoc:not(.source) .example-wrap > pre.rust {
379 .rustdoc:not(.source) .example-wrap > pre {
401 .content pre.line-numbers {
406 -webkit-user-select: none;
407 -moz-user-select: none;
408 -ms-user-select: none;
416 overflow-wrap: anywhere;
424 text-overflow: ellipsis;
427 /* Wrap non-pre code blocks (`text`) but not (```text```). */
428 .docblock > :not(pre) > code,
429 .docblock-short > :not(pre) > code {
430 white-space: pre-wrap;
433 .docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5 {
434 border-bottom: 1px solid;
437 #main > .docblock h1 { font-size: 1.3em; }
438 #main > .docblock h2 { font-size: 1.15em; }
439 #main > .docblock h3, #main > .docblock h4, #main > .docblock h5 { font-size: 1em; }
441 #main > h2 + div, #main > h2 + h3, #main > h3 + div {
442 display: none; /* Changed to flex or block via js once the page is loaded */
446 .docblock h1 { font-size: 1em; }
447 .docblock h2 { font-size: 0.95em; }
448 .docblock h3, .docblock h4, .docblock h5 { font-size: 0.9em; }
455 .content .out-of-band {
463 h3.impl > .out-of-band {
467 h4.method > .out-of-band {
471 h4 > code, h3 > code, .invisible > code {
472 max-width: calc(100% - 41px);
478 display: inline-block;
487 display: inline-block;
495 font-family: "Fira Sans", Arial, sans-serif;
498 .content table:not(.table-display) {
499 border-spacing: 0 5px;
501 .content td { vertical-align: top; }
502 .content td:first-child { padding-right: 20px; }
503 .content td p:first-child { margin-top: 0; }
504 .content td h1, .content td h2 { margin-left: 0; font-size: 1.1em; }
505 .content tr:first-child td { border-top: 0; }
509 width: calc(100% - 2px);
528 .content .item-list {
529 list-style-type: none;
533 .content .multi-column {
534 -moz-column-count: 5;
535 -moz-column-gap: 2.5em;
536 -webkit-column-count: 5;
537 -webkit-column-gap: 2.5em;
541 .content .multi-column li { width: 100%; display: inline-block; }
547 /* Shift "where ..." part of method or fn definition down a line */
548 .content .method .where,
550 .content .where.fmt-newline {
555 .content .methods > div:not(.notable-traits) {
560 .content .docblock > .impl-items {
564 .content .docblock > .impl-items > h4 {
567 .content .docblock >.impl-items .table-display {
570 .content .docblock >.impl-items table td {
573 .toggle-wrapper.marg-left > .collapse-toggle {
576 .content .docblock > .impl-items .table-display, .impl-items table td {
580 .content .item-info code {
584 .content .item-info {
590 .sub-variant > div > .item-info {
594 .content .item-info::before {
602 .content .impl-items .method, .content .impl-items > .type, .impl-items > .associatedconstant {
606 .content .impl-items .docblock, .content .impl-items .item-info {
610 .content .impl-items > .item-info {
614 .methods > .item-info, .content .impl-items > .item-info {
627 border-bottom: 1px solid;
628 padding-bottom: 10px;
636 border-top: 1px solid;
637 border-bottom: 1px solid;
639 nav.main .separator {
641 display: inline-block;
645 nav.sum { text-align: right; }
646 nav.sub form { display: inline; }
653 text-decoration: none;
654 background: transparent;
657 .small-section-header:hover > .anchor {
661 .in-band:hover > .anchor, .impl:hover > .anchor {
662 display: inline-block;
673 .small-section-header > .anchor {
675 padding-right: 10px; /* avoid gap that causes hover to disappear */
678 content: '\2002\00a7\2002';
681 .docblock a:not(.srclink):not(.test-arrow):hover,
682 .docblock-short a:not(.srclink):not(.test-arrow):hover, .item-info a {
683 text-decoration: underline;
686 .invisible > .srclink, h4 > code + .srclink, h3 > code + .srclink {
694 .block a.current.crate { font-weight: 500; }
699 .search-container > div {
700 display: inline-flex;
701 width: calc(100% - 63px);
711 border-radius: 4px 0 0 4px;
714 border-right: 1px solid;
715 -moz-appearance: none;
716 -webkit-appearance: none;
717 /* Removes default arrow from firefox */
720 background-repeat: no-repeat;
721 background-color: transparent;
722 background-size: 20px;
723 background-position: calc(100% - 1px) 56%;
725 .search-container > .top-button {
731 /* Override Normalize.css: we have margins and do
732 not want to overflow - the `moz` attribute is necessary
733 until Firefox 29, too early to drop at this point */
734 -moz-box-sizing: border-box !important;
735 box-sizing: border-box !important;
742 transition: border-color 300ms ease;
743 transition: border-radius 300ms ease-in-out;
744 transition: box-shadow 300ms ease-in-out;
748 #crate-search + .search-input {
749 border-radius: 0 1px 1px 0;
750 width: calc(100% - 32px);
753 .search-input:focus {
759 .search-results .desc {
761 text-overflow: ellipsis;
770 .content .search-results td:first-child {
774 .content .search-results td:first-child a {
777 .content .search-results td:first-child a:after {
782 .content .search-results td:first-child a span {
786 tr.result span.primitive::after {
787 content: ' (primitive type)';
791 tr.result span.keyword::after {
792 content: ' (keyword)';
796 body.blur > :not(#help) {
798 -webkit-filter: blur(8px);
809 justify-content: center;
814 box-shadow: 0 0 6px rgba(0,0,0,.2);
823 margin-right: 0.5rem;
830 border-bottom: 1px solid #ccc;
834 #help dd { margin: 5px 35px; }
835 #help .infos { padding-left: 0; }
836 #help h1, #help h2 { margin-top: 0; }
840 padding: 0 20px 20px 17px;;
863 /* Black one-pixel outline around emoji shapes */
874 display: inline-block;
880 vertical-align: text-bottom;
883 .module-item.unstable {
895 .impl-items .since, .impl .since, .methods .since {
902 .impl-items .srclink, .impl .srclink, .methods .srclink {
904 /* Override header settings otherwise it's too bold */
909 .impl-items code, .impl code, .methods code {
913 .impl-items h4, h4.impl, h3.impl, .methods h3 {
918 /* Push the src link out to the right edge consistently */
919 justify-content: space-between;
926 .variants_table tbody tr td:first-child {
927 width: 1%; /* make the variant name as small as possible */
938 pre.rust .question-mark {
943 display: inline-block;
945 padding: 5px 10px 5px 10px;
953 text-decoration: none;
956 .section-header:hover a:before {
959 padding-right: 10px; /* avoid gap that causes hover to disappear */
960 content: '\2002\00a7\2002';
963 .section-header:hover a {
964 text-decoration: none;
978 h3 > .collapse-toggle, h4 > .collapse-toggle {
983 .toggle-wrapper > .collapse-toggle {
993 .toggle-wrapper.collapsed {
995 transition: height .2s;
999 .collapse-toggle > .inner {
1000 display: inline-block;
1005 .collapse-toggle.hidden-default {
1011 display: table-cell;
1020 .out-of-band > span.since {
1026 .toggle-wrapper > .collapse-toggle {
1030 .variant + .toggle-wrapper + .docblock > p {
1034 .sub-variant, .sub-variant > h3 {
1035 margin-top: 1px !important;
1038 #main > .sub-variant > h3 {
1044 .sub-variant > div {
1046 margin-bottom: 10px;
1049 .sub-variant > div > span {
1055 display: inline-block;
1060 .enum > .toggle-wrapper + .docblock, .struct > .toggle-wrapper + .docblock {
1062 margin-bottom: 20px;
1066 .docblock > .section-header:first-child {
1071 .docblock > .section-header:first-child:hover > a:before {
1075 .enum > .collapsed, .struct > .collapsed {
1076 margin-bottom: 25px;
1079 #main > .variant, #main > .structfield {
1085 margin-top: 0px !important;
1087 margin-bottom: 0px !important;
1090 .toggle-attributes.collapsed {
1093 .impl-items > .toggle-attributes {
1096 .impl-items .attributes {
1113 display: inline-block;
1120 padding: 5px 3px 3px 3px;
1126 .tooltip.ignore::after {
1127 content: "This example is not tested";
1129 .tooltip.compile_fail::after {
1130 content: "This example deliberately fails to compile";
1132 .tooltip.should_panic::after {
1133 content: "This example panics";
1135 .tooltip.edition::after {
1136 content: "This code runs with edition " attr(data-edition);
1146 border-style: solid;
1150 .tooltip:hover::before, .tooltip:hover::after {
1154 .tooltip.compile_fail, .tooltip.should_panic, .tooltip.ignore {
1159 .notable-traits-tooltip {
1160 display: inline-block;
1164 .notable-traits:hover .notable-traits-tooltiptext,
1165 .notable-traits .notable-traits-tooltiptext.force-tooltip {
1166 display: inline-block;
1169 .notable-traits .notable-traits-tooltiptext {
1171 padding: 5px 3px 3px 3px;
1181 .notable-traits-tooltip::after {
1182 /* The margin on the tooltip does not capture hover events,
1183 this extends the area of hover enough so that mouse hover is not
1184 lost when moving the mouse to the tooltip */
1185 content: "\00a0\00a0\00a0";
1188 .notable-traits .notable, .notable-traits .docblock {
1192 .notable-traits .docblock code.content{
1198 /* Example code has the "Run" button that needs to be positioned relative to the pre */
1199 pre.rust.rust-example-rendered {
1213 .search-failed > ul {
1231 border-top: 2px solid;
1234 #titles > button:not(:last-child) {
1236 width: calc(33.3% - 1px);
1239 #titles > button > div.count {
1240 display: inline-block;
1250 h4 > .notable-traits {
1260 margin-bottom: 10px;
1274 border-top-right-radius: 3px;
1275 border-bottom-right-radius: 3px;
1278 transition: left .5s;
1291 transition: left .5s;
1292 border-right: 1px solid;
1294 #source-sidebar > .title {
1297 border-bottom: 1px solid;
1307 .theme-picker button {
1311 #settings-menu, .help-button {
1323 font-family: "Fira Sans", Arial, sans-serif;
1328 #theme-picker, #settings-menu, .help-button {
1348 #theme-choices > button {
1353 background: rgba(0,0,0,0);
1356 #theme-choices > button:not(:first-child) {
1357 border-top: 1px solid;
1362 @media (min-width: 701px) {
1363 /* In case there is no documentation before a code block, we need to add some margin at the top
1364 to prevent an overlay between the "collapse toggle" and the information tooltip.
1365 However, it's not needed with smaller screen width because the doc/code block is always put
1366 "one line" below. */
1367 .docblock > .information:first-child > .tooltip {
1372 @media (max-width: 700px) {
1377 .rustdoc > .sidebar {
1387 .sidebar > .location {
1391 padding: 3px 10px 1px 10px;
1393 background: inherit;
1398 .sidebar .location:empty {
1402 .sidebar .logo-container {
1411 .sidebar .logo-container > img {
1425 border-bottom: 1px solid;
1426 border-right: 1px solid;
1430 .rustdoc.source > .sidebar > .sidebar-menu {
1441 border-right: 1px solid;
1445 .sidebar > .block.version {
1446 border-bottom: none;
1452 width: calc(100% - 32px);
1469 .content h4 > .out-of-band {
1473 .toggle-wrapper > .collapse-toggle {
1485 .content .impl-items .method, .content .impl-items > .type, .impl-items > .associatedconstant {
1490 display: none !important;
1503 h4 > .notable-traits {
1509 #titles > button > div.count {
1522 background-color: rgba(0,0,0,0);
1526 This allows to prevent the version text to overflow the sidebar title on mobile mode when the
1527 sidebar is displayed (after clicking on the "hamburger" button).
1529 .sidebar.mobile > div.version {
1534 width: calc(100% + 30px);
1542 .show-it > .block.items {
1546 .show-it > .block.items > ul {
1550 .show-it > .block.items > ul > li {
1555 .show-it > .block.items > ul > li > a {
1559 /* Because of ios, we need to actually have a full height sidebar title so the
1560 * actual sidebar can show up. But then we need to make it transparent so we don't
1561 * hide content. The filler just allows to create the background for the sidebar
1562 * title. But because of the absolute position, I had to lower the z-index.
1567 width: calc(100% - 45px);
1571 border-bottom: 1px solid;
1578 .impl > .collapse-toggle {
1598 #main > .line-numbers {
1602 .notable-traits .notable-traits-tooltiptext {
1607 /* We don't display the help button on mobile devices. */
1611 .search-container > div {
1612 width: calc(100% - 32px);
1617 nav.sub, .content .out-of-band, .collapse-toggle {
1622 @media (max-width: 464px) {
1623 #titles, #titles > button {
1627 /* This is to prevent the search bar from being underneath the <section>
1628 * element following it.
1634 #main > table:not(.table-display) td {
1635 word-break: break-word;
1639 .search-container > div {
1641 width: calc(100% - 37px);
1650 #crate-search + .search-input {
1651 width: calc(100% + 71px);
1655 #theme-picker, #settings-menu {
1676 margin-bottom: 13px;
1681 display: inline-block;
1683 font: 15px monospace;
1685 vertical-align: middle;
1688 box-shadow: inset 0 -1px 0;
1692 .hidden-by-impl-hider,
1693 .hidden-by-usual-hider {
1694 /* important because of conflicting rule for small screens */
1695 display: none !important;
1698 #implementations-list > h3 > span.in-band {
1705 border-collapse: collapse;
1710 .table-display tr td:first-child {
1714 .table-display tr td:last-child {
1717 .table-display .out-of-band {
1722 #implementors-list > .impl-items .table-display .out-of-band {
1726 .table-display td:hover .anchor {
1756 div.files > a:hover, div.name:hover {
1757 background-color: #a14b4b;
1759 div.name.expand + .children {
1770 div.name.expand::before {
1771 transform: rotate(90deg);
1776 /* This part is to fix the "Expand attributes" part in the type declaration. */
1777 .type-decl > pre > .toggle-wrapper.toggle-attributes.top-attr {
1778 margin-left: 0 !important;
1780 .type-decl > pre > .docblock.attributes.top-attr {
1781 margin-left: 1.8em !important;
1783 .type-decl > pre > .toggle-attributes {
1786 .type-decl > pre > .docblock.attributes {