1 /* See FiraSans-LICENSE.txt for the Fira Sans license. */
3 font-family: 'Fira Sans';
6 src: local('Fira Sans'), url("FiraSans-Regular.woff") format('woff');
9 font-family: 'Fira Sans';
12 src: local('Fira Sans Medium'), url("FiraSans-Medium.woff") format('woff');
15 /* See SourceSerifPro-LICENSE.txt for the Source Serif Pro license. */
17 font-family: 'Source Serif Pro';
20 src: local('Source Serif Pro'), url("SourceSerifPro-Regular.ttf.woff") format('woff');
23 font-family: 'Source Serif Pro';
26 src: local('Source Serif Pro Italic'), url("SourceSerifPro-It.ttf.woff") format('woff');
29 font-family: 'Source Serif Pro';
32 src: local('Source Serif Pro Bold'), url("SourceSerifPro-Bold.ttf.woff") format('woff');
35 /* See SourceCodePro-LICENSE.txt for the Source Code Pro license. */
37 font-family: 'Source Code Pro';
40 /* Avoid using locally installed font because bad versions are in circulation:
41 * see https://github.com/rust-lang/rust/issues/24355 */
42 src: url("SourceCodePro-Regular.woff") format('woff');
45 font-family: 'Source Code Pro';
48 src: url("SourceCodePro-Semibold.woff") format('woff');
52 -webkit-box-sizing: border-box;
53 -moz-box-sizing: border-box;
54 box-sizing: border-box;
57 /* This part handles the "default" theme being used depending on the system one. */
61 @media (prefers-color-scheme: light) {
66 @media (prefers-color-scheme: dark) {
72 /* General structure and fonts */
75 font: 16px/1.4 "Source Serif Pro", serif;
78 padding: 10px 15px 20px 15px;
80 -webkit-font-feature-settings: "kern", "liga";
81 -moz-font-feature-settings: "kern", "liga";
82 font-feature-settings: "kern", "liga";
94 h1, h2, h3:not(.impl):not(.method):not(.type):not(.tymethod):not(.notable),
95 h4:not(.method):not(.type):not(.tymethod):not(.associatedconstant) {
97 margin: 20px 0 15px 0;
101 border-bottom: 1px dashed;
104 h1.fqn > .in-band > a:hover {
105 text-decoration: underline;
107 h2, h3:not(.impl):not(.method):not(.type):not(.tymethod),
108 h4:not(.method):not(.type):not(.tymethod):not(.associatedconstant) {
109 border-bottom: 1px solid;
111 h3.impl, h3.method, h4.method, h3.type, h4.type, h4.associatedconstant {
118 h3.impl, h3.method, h3.type {
123 .sidebar, a.source, .search-input, .content table td:first-child > a,
124 .collapse-toggle, div.item-list .out-of-band,
125 #source-sidebar, #sidebar-toggle {
126 font-family: "Fira Sans", sans-serif;
129 .content ul.crate a.crate {
130 font: 16px/1.6 "Fira Sans";
136 ul ul, ol ul, ul ol, ol ol {
148 code, pre, a.test-arrow {
149 font-family: "Source Code Pro", monospace;
151 .docblock code, .docblock-short code {
155 .docblock pre code, .docblock-short pre code, .docblock code.spotlight {
158 .docblock code.spotlight :last-child {
159 padding-bottom: 0.6em;
165 .source .content pre {
187 text-transform: uppercase;
199 /* Improve the scrollbar display on firefox */
201 scrollbar-width: initial;
204 scrollbar-width: thin;
207 /* Improve the scrollbar display on webkit-based browsers */
208 ::-webkit-scrollbar {
211 .sidebar::-webkit-scrollbar {
214 ::-webkit-scrollbar-track {
215 -webkit-box-shadow: inset 0;
218 .sidebar .block > ul > li {
226 /* Everything else */
229 display: none !important;
241 .logo-container > img {
247 transform: translate(-50%, -50%);
254 margin: 30px 10px 20px 10px;
256 word-wrap: break-word;
262 border-bottom: 1px solid;
263 overflow-wrap: break-word;
264 word-wrap: break-word; /* deprecated */
265 word-break: break-word; /* Chrome, non-standard */
272 .location a:first-child {
280 .block h2, .block h3 {
285 .block ul, .block li {
293 text-overflow: ellipsis;
299 transition: border 500ms ease-out;
303 border-top: 1px solid;
304 border-bottom: 1px solid;
327 .source .content pre.rust {
333 .rustdoc:not(.source) .example-wrap {
334 display: inline-flex;
343 .example-wrap > pre.line-number {
346 border-top-left-radius: 5px;
347 border-bottom-left-radius: 5px;
352 .rustdoc:not(.source) .example-wrap > pre.rust {
357 .rustdoc:not(.source) .example-wrap > pre {
379 .content pre.line-numbers {
384 -webkit-user-select: none;
385 -moz-user-select: none;
386 -ms-user-select: none;
394 overflow-wrap: anywhere;
402 text-overflow: ellipsis;
405 .docblock code, .docblock-short code {
406 white-space: pre-wrap;
409 .docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5 {
410 border-bottom: 1px solid;
413 #main > .docblock h1 { font-size: 1.3em; }
414 #main > .docblock h2 { font-size: 1.15em; }
415 #main > .docblock h3, #main > .docblock h4, #main > .docblock h5 { font-size: 1em; }
417 #main > h2 + div, #main > h2 + h3, #main > h3 + div {
418 display: none; /* Changed to flex or block via js once the page is loaded */
422 .docblock h1 { font-size: 1em; }
423 .docblock h2 { font-size: 0.95em; }
424 .docblock h3, .docblock h4, .docblock h5 { font-size: 0.9em; }
431 .content .out-of-band {
439 h3.impl > .out-of-band {
443 h4.method > .out-of-band {
447 h4 > code, h3 > code, .invisible > code {
448 max-width: calc(100% - 41px);
454 display: inline-block;
463 display: inline-block;
471 font-family: "Fira Sans", sans-serif;
474 .content table:not(.table-display) {
475 border-spacing: 0 5px;
477 .content td { vertical-align: top; }
478 .content td:first-child { padding-right: 20px; }
479 .content td p:first-child { margin-top: 0; }
480 .content td h1, .content td h2 { margin-left: 0; font-size: 1.1em; }
481 .content tr:first-child td { border-top: 0; }
485 width: calc(100% - 2px);
504 .content .item-list {
505 list-style-type: none;
509 .content .multi-column {
510 -moz-column-count: 5;
511 -moz-column-gap: 2.5em;
512 -webkit-column-count: 5;
513 -webkit-column-gap: 2.5em;
517 .content .multi-column li { width: 100%; display: inline-block; }
523 /* Shift "where ..." part of method or fn definition down a line */
524 .content .method .where,
526 .content .where.fmt-newline {
531 .content .methods > div:not(.notable-traits) {
536 .content .docblock > .impl-items {
540 .content .docblock > .impl-items > h4 {
543 .content .docblock >.impl-items .table-display {
546 .content .docblock >.impl-items table td {
549 .toggle-wrapper.marg-left > .collapse-toggle {
552 .content .docblock > .impl-items .table-display, .impl-items table td {
556 .content .item-info code {
560 .content .item-info {
566 .sub-variant > div > .item-info {
570 .content .item-info::before {
578 .content .impl-items .method, .content .impl-items > .type, .impl-items > .associatedconstant {
582 .content .impl-items .docblock, .content .impl-items .item-info {
586 .content .impl-items > .item-info {
590 .methods > .item-info, .content .impl-items > .item-info {
603 border-bottom: 1px solid;
604 padding-bottom: 10px;
612 border-top: 1px solid;
613 border-bottom: 1px solid;
615 nav.main .separator {
617 display: inline-block;
621 nav.sum { text-align: right; }
622 nav.sub form { display: inline; }
629 text-decoration: none;
630 background: transparent;
633 .small-section-header:hover > .anchor {
637 .in-band:hover > .anchor, .impl:hover > .anchor {
638 display: inline-block;
649 .small-section-header > .anchor {
651 padding-right: 10px; /* avoid gap that causes hover to disappear */
654 content: '\2002\00a7\2002';
657 .docblock a:not(.srclink):not(.test-arrow):hover,
658 .docblock-short a:not(.srclink):not(.test-arrow):hover, .item-info a {
659 text-decoration: underline;
662 .invisible > .srclink, h4 > code + .srclink, h3 > code + .srclink {
670 .block a.current.crate { font-weight: 500; }
675 .search-container > div {
676 display: inline-flex;
677 width: calc(100% - 63px);
686 border-radius: 4px 0 0 4px;
689 border-right: 1px solid;
690 -moz-appearance: none;
691 -webkit-appearance: none;
692 /* Removes default arrow from firefox */
695 background-repeat: no-repeat;
696 background-color: transparent;
697 background-size: 20px;
698 background-position: calc(100% - 1px) 56%;
700 .search-container > .top-button {
706 /* Override Normalize.css: we have margins and do
707 not want to overflow - the `moz` attribute is necessary
708 until Firefox 29, too early to drop at this point */
709 -moz-box-sizing: border-box !important;
710 box-sizing: border-box !important;
717 transition: border-color 300ms ease;
718 transition: border-radius 300ms ease-in-out;
719 transition: box-shadow 300ms ease-in-out;
723 #crate-search + .search-input {
724 border-radius: 0 1px 1px 0;
725 width: calc(100% - 32px);
728 .search-input:focus {
734 .search-results .desc {
736 text-overflow: ellipsis;
745 .content .search-results td:first-child {
749 .content .search-results td:first-child a {
752 .content .search-results td:first-child a:after {
757 .content .search-results td:first-child a span {
761 tr.result span.primitive::after {
762 content: ' (primitive type)';
766 tr.result span.keyword::after {
767 content: ' (keyword)';
771 body.blur > :not(#help) {
773 -webkit-filter: blur(8px);
784 justify-content: center;
789 box-shadow: 0 0 6px rgba(0,0,0,.2);
804 border-bottom: 1px solid #ccc;
808 #help dd { margin: 5px 35px; }
809 #help .infos { padding-left: 0; }
810 #help h1, #help h2 { margin-top: 0; }
814 padding: 0 20px 20px 17px;;
839 display: inline-block;
845 vertical-align: text-bottom;
848 .module-item.unstable {
860 .impl-items .since, .impl .since, .methods .since {
867 .impl-items .srclink, .impl .srclink, .methods .srclink {
869 /* Override header settings otherwise it's too bold */
874 .impl-items code, .impl code, .methods code {
878 .impl-items h4, h4.impl, h3.impl, .methods h3 {
883 /* Push the src link out to the right edge consistently */
884 justify-content: space-between;
891 .variants_table tbody tr td:first-child {
892 width: 1%; /* make the variant name as small as possible */
903 pre.rust .question-mark {
908 display: inline-block;
910 padding: 5px 10px 5px 10px;
918 text-decoration: none;
921 .section-header:hover a:before {
924 padding-right: 10px; /* avoid gap that causes hover to disappear */
925 content: '\2002\00a7\2002';
928 .section-header:hover a {
929 text-decoration: none;
943 h3 > .collapse-toggle, h4 > .collapse-toggle {
948 .toggle-wrapper > .collapse-toggle {
958 .toggle-wrapper.collapsed {
960 transition: height .2s;
964 .collapse-toggle > .inner {
965 display: inline-block;
970 .collapse-toggle.hidden-default {
985 .out-of-band > span.since {
991 .toggle-wrapper > .collapse-toggle {
995 .variant + .toggle-wrapper + .docblock > p {
999 .sub-variant, .sub-variant > h3 {
1000 margin-top: 1px !important;
1003 #main > .sub-variant > h3 {
1009 .sub-variant > div {
1011 margin-bottom: 10px;
1014 .sub-variant > div > span {
1020 display: inline-block;
1025 .enum > .toggle-wrapper + .docblock, .struct > .toggle-wrapper + .docblock {
1027 margin-bottom: 20px;
1031 .docblock > .section-header:first-child {
1036 .docblock > .section-header:first-child:hover > a:before {
1040 .enum > .collapsed, .struct > .collapsed {
1041 margin-bottom: 25px;
1044 #main > .variant, #main > .structfield {
1050 margin-top: 0px !important;
1052 margin-bottom: 0px !important;
1055 .toggle-attributes.collapsed {
1058 .impl-items > .toggle-attributes {
1061 .impl-items .attributes {
1078 display: inline-block;
1085 padding: 5px 3px 3px 3px;
1091 .tooltip.ignore::after {
1092 content: "This example is not tested";
1094 .tooltip.compile_fail::after {
1095 content: "This example deliberately fails to compile";
1097 .tooltip.should_panic::after {
1098 content: "This example panics";
1100 .tooltip.edition::after {
1101 content: "This code runs with edition " attr(data-edition);
1111 border-style: solid;
1115 .tooltip:hover::before, .tooltip:hover::after {
1119 .tooltip.compile_fail, .tooltip.should_panic, .tooltip.ignore {
1124 .notable-traits-tooltip {
1125 display: inline-block;
1129 .notable-traits:hover .notable-traits-tooltiptext,
1130 .notable-traits .notable-traits-tooltiptext.force-tooltip {
1131 display: inline-block;
1134 .notable-traits .notable-traits-tooltiptext {
1136 padding: 5px 3px 3px 3px;
1146 .notable-traits-tooltip::after {
1147 /* The margin on the tooltip does not capture hover events,
1148 this extends the area of hover enough so that mouse hover is not
1149 lost when moving the mouse to the tooltip */
1150 content: "\00a0\00a0\00a0";
1153 .notable-traits .notable, .notable-traits .docblock {
1157 .notable-traits .docblock code.content{
1163 /* Example code has the "Run" button that needs to be positioned relative to the pre */
1164 pre.rust.rust-example-rendered {
1178 .search-failed > ul {
1196 border-top: 2px solid;
1199 #titles > button:not(:last-child) {
1201 width: calc(33.3% - 1px);
1204 #titles > button > div.count {
1205 display: inline-block;
1215 h4 > .notable-traits {
1225 margin-bottom: 10px;
1239 border-top-right-radius: 3px;
1240 border-bottom-right-radius: 3px;
1243 transition: left .5s;
1256 transition: left .5s;
1257 border-right: 1px solid;
1259 #source-sidebar > .title {
1262 border-bottom: 1px solid;
1272 .theme-picker button {
1276 #settings-menu, .help-button {
1288 font-family: "Fira Sans",sans-serif;
1293 #theme-picker, #settings-menu, .help-button {
1313 #theme-choices > button {
1318 background: rgba(0,0,0,0);
1321 #theme-choices > button:not(:first-child) {
1322 border-top: 1px solid;
1327 @media (min-width: 701px) {
1328 /* In case there is no documentation before a code block, we need to add some margin at the top
1329 to prevent an overlay between the "collapse toggle" and the information tooltip.
1330 However, it's needed needed with smaller screen width because the doc/code block is always put
1331 "one line" below. */
1332 .information:first-child > .tooltip {
1337 @media (max-width: 700px) {
1342 .rustdoc > .sidebar {
1352 .sidebar > .location {
1356 padding: 3px 10px 1px 10px;
1358 background: inherit;
1363 .sidebar .location:empty {
1367 .sidebar .logo-container {
1376 .sidebar .logo-container > img {
1390 border-bottom: 1px solid;
1391 border-right: 1px solid;
1395 .rustdoc.source > .sidebar > .sidebar-menu {
1406 border-right: 1px solid;
1410 .sidebar > .block.version {
1411 border-bottom: none;
1416 width: calc(100% - 32px);
1433 .content h4 > .out-of-band {
1437 .toggle-wrapper > .collapse-toggle {
1449 .content .impl-items .method, .content .impl-items > .type, .impl-items > .associatedconstant {
1454 display: none !important;
1467 h4 > .notable-traits {
1473 #titles > button > div.count {
1486 background-color: rgba(0,0,0,0);
1490 width: calc(100% + 30px);
1498 .show-it > .block.items {
1502 .show-it > .block.items > ul {
1506 .show-it > .block.items > ul > li {
1511 .show-it > .block.items > ul > li > a {
1515 /* Because of ios, we need to actually have a full height sidebar title so the
1516 * actual sidebar can show up. But then we need to make it transparent so we don't
1517 * hide content. The filler just allows to create the background for the sidebar
1518 * title. But because of the absolute position, I had to lower the z-index.
1523 width: calc(100% - 45px);
1527 border-bottom: 1px solid;
1534 .impl > .collapse-toggle {
1554 #main > .line-numbers {
1558 .notable-traits .notable-traits-tooltiptext {
1563 /* We don't display the help button on mobile devices. */
1567 .search-container > div {
1568 width: calc(100% - 32px);
1573 nav.sub, .content .out-of-band, .collapse-toggle {
1578 @media (max-width: 416px) {
1579 #titles, #titles > button {
1587 #main > table:not(.table-display) td {
1588 word-break: break-word;
1592 .search-container > div {
1594 width: calc(100% - 37px);
1603 #crate-search + .search-input {
1604 width: calc(100% + 71px);
1608 #theme-picker, #settings-menu {
1625 margin-bottom: 13px;
1630 display: inline-block;
1632 font: 15px monospace;
1634 vertical-align: middle;
1637 box-shadow: inset 0 -1px 0;
1641 .hidden-by-impl-hider,
1642 .hidden-by-usual-hider {
1643 /* important because of conflicting rule for small screens */
1644 display: none !important;
1647 #implementations-list > h3 > span.in-band {
1654 border-collapse: collapse;
1659 .table-display tr td:first-child {
1663 .table-display tr td:last-child {
1666 .table-display .out-of-band {
1671 #implementors-list > .impl-items .table-display .out-of-band {
1675 .table-display td:hover .anchor {
1705 div.files > a:hover, div.name:hover {
1706 background-color: #a14b4b;
1708 div.name.expand + .children {
1719 div.name.expand::before {
1720 transform: rotate(90deg);
1725 /* This part is to fix the "Expand attributes" part in the type declaration. */
1726 .type-decl > pre > .toggle-wrapper.toggle-attributes.top-attr {
1727 margin-left: 0 !important;
1729 .type-decl > pre > .docblock.attributes.top-attr {
1730 margin-left: 1.8em !important;
1732 .type-decl > pre > .toggle-attributes {
1735 .type-decl > pre > .docblock.attributes {