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 /* This selector is for the items listed in the "all items" page. */
127 #main > ul.docblock > li > a {
128 font-family: "Fira Sans", sans-serif;
131 .content ul.crate a.crate {
132 font: 16px/1.6 "Fira Sans";
138 ul ul, ol ul, ul ol, ol ol {
150 code, pre, a.test-arrow {
151 font-family: "Source Code Pro", monospace;
153 .docblock code, .docblock-short code {
157 .docblock pre code, .docblock-short pre code, .docblock code.spotlight {
160 .docblock code.spotlight :last-child {
161 padding-bottom: 0.6em;
167 .source .content pre {
189 text-transform: uppercase;
201 /* Improve the scrollbar display on firefox */
203 scrollbar-width: initial;
206 scrollbar-width: thin;
209 /* Improve the scrollbar display on webkit-based browsers */
210 ::-webkit-scrollbar {
213 .sidebar::-webkit-scrollbar {
216 ::-webkit-scrollbar-track {
217 -webkit-box-shadow: inset 0;
220 .sidebar .block > ul > li {
228 /* Everything else */
231 display: none !important;
243 .logo-container > img {
249 transform: translate(-50%, -50%);
256 margin: 30px 10px 20px 10px;
258 word-wrap: break-word;
264 border-bottom: 1px solid;
265 overflow-wrap: break-word;
266 word-wrap: break-word; /* deprecated */
267 word-break: break-word; /* Chrome, non-standard */
274 .location a:first-child {
282 .block h2, .block h3 {
287 .block ul, .block li {
295 text-overflow: ellipsis;
301 transition: border 500ms ease-out;
305 border-top: 1px solid;
306 border-bottom: 1px solid;
329 .source .content pre.rust {
335 .rustdoc:not(.source) .example-wrap {
336 display: inline-flex;
345 .example-wrap > pre.line-number {
348 border-top-left-radius: 5px;
349 border-bottom-left-radius: 5px;
354 .rustdoc:not(.source) .example-wrap > pre.rust {
359 .rustdoc:not(.source) .example-wrap > pre {
381 .content pre.line-numbers {
386 -webkit-user-select: none;
387 -moz-user-select: none;
388 -ms-user-select: none;
396 overflow-wrap: anywhere;
404 text-overflow: ellipsis;
407 .docblock code, .docblock-short code {
408 white-space: pre-wrap;
411 .docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5 {
412 border-bottom: 1px solid;
415 #main > .docblock h1 { font-size: 1.3em; }
416 #main > .docblock h2 { font-size: 1.15em; }
417 #main > .docblock h3, #main > .docblock h4, #main > .docblock h5 { font-size: 1em; }
419 #main > h2 + div, #main > h2 + h3, #main > h3 + div {
420 display: none; /* Changed to flex or block via js once the page is loaded */
424 .docblock h1 { font-size: 1em; }
425 .docblock h2 { font-size: 0.95em; }
426 .docblock h3, .docblock h4, .docblock h5 { font-size: 0.9em; }
433 .content .out-of-band {
441 h3.impl > .out-of-band {
445 h4.method > .out-of-band {
449 h4 > code, h3 > code, .invisible > code {
450 max-width: calc(100% - 41px);
456 display: inline-block;
465 display: inline-block;
473 font-family: "Fira Sans", sans-serif;
476 .content table:not(.table-display) {
477 border-spacing: 0 5px;
479 .content td { vertical-align: top; }
480 .content td:first-child { padding-right: 20px; }
481 .content td p:first-child { margin-top: 0; }
482 .content td h1, .content td h2 { margin-left: 0; font-size: 1.1em; }
483 .content tr:first-child td { border-top: 0; }
487 width: calc(100% - 2px);
506 .content .item-list {
507 list-style-type: none;
511 .content .multi-column {
512 -moz-column-count: 5;
513 -moz-column-gap: 2.5em;
514 -webkit-column-count: 5;
515 -webkit-column-gap: 2.5em;
519 .content .multi-column li { width: 100%; display: inline-block; }
525 /* Shift "where ..." part of method or fn definition down a line */
526 .content .method .where,
528 .content .where.fmt-newline {
533 .content .methods > div:not(.notable-traits) {
538 .content .docblock > .impl-items {
542 .content .docblock > .impl-items > h4 {
545 .content .docblock >.impl-items .table-display {
548 .content .docblock >.impl-items table td {
551 .toggle-wrapper.marg-left > .collapse-toggle {
554 .content .docblock > .impl-items .table-display, .impl-items table td {
558 .content .item-info code {
562 .content .item-info {
568 .sub-variant > div > .item-info {
572 .content .item-info::before {
580 .content .impl-items .method, .content .impl-items > .type, .impl-items > .associatedconstant {
584 .content .impl-items .docblock, .content .impl-items .item-info {
588 .content .impl-items > .item-info {
592 .methods > .item-info, .content .impl-items > .item-info {
605 border-bottom: 1px solid;
606 padding-bottom: 10px;
614 border-top: 1px solid;
615 border-bottom: 1px solid;
617 nav.main .separator {
619 display: inline-block;
623 nav.sum { text-align: right; }
624 nav.sub form { display: inline; }
631 text-decoration: none;
632 background: transparent;
635 .small-section-header:hover > .anchor {
639 .in-band:hover > .anchor, .impl:hover > .anchor {
640 display: inline-block;
651 .small-section-header > .anchor {
653 padding-right: 10px; /* avoid gap that causes hover to disappear */
656 content: '\2002\00a7\2002';
659 .docblock a:not(.srclink):not(.test-arrow):hover,
660 .docblock-short a:not(.srclink):not(.test-arrow):hover, .item-info a {
661 text-decoration: underline;
664 .invisible > .srclink, h4 > code + .srclink, h3 > code + .srclink {
672 .block a.current.crate { font-weight: 500; }
677 .search-container > div {
678 display: inline-flex;
679 width: calc(100% - 63px);
688 border-radius: 4px 0 0 4px;
691 border-right: 1px solid;
692 -moz-appearance: none;
693 -webkit-appearance: none;
694 /* Removes default arrow from firefox */
697 background-repeat: no-repeat;
698 background-color: transparent;
699 background-size: 20px;
700 background-position: calc(100% - 1px) 56%;
702 .search-container > .top-button {
708 /* Override Normalize.css: we have margins and do
709 not want to overflow - the `moz` attribute is necessary
710 until Firefox 29, too early to drop at this point */
711 -moz-box-sizing: border-box !important;
712 box-sizing: border-box !important;
719 transition: border-color 300ms ease;
720 transition: border-radius 300ms ease-in-out;
721 transition: box-shadow 300ms ease-in-out;
725 #crate-search + .search-input {
726 border-radius: 0 1px 1px 0;
727 width: calc(100% - 32px);
730 .search-input:focus {
736 .search-results .desc {
738 text-overflow: ellipsis;
747 .content .search-results td:first-child {
751 .content .search-results td:first-child a {
754 .content .search-results td:first-child a:after {
759 .content .search-results td:first-child a span {
763 tr.result span.primitive::after {
764 content: ' (primitive type)';
768 tr.result span.keyword::after {
769 content: ' (keyword)';
773 body.blur > :not(#help) {
775 -webkit-filter: blur(8px);
786 justify-content: center;
791 box-shadow: 0 0 6px rgba(0,0,0,.2);
806 border-bottom: 1px solid #ccc;
810 #help dd { margin: 5px 35px; }
811 #help .infos { padding-left: 0; }
812 #help h1, #help h2 { margin-top: 0; }
816 padding: 0 20px 20px 17px;;
841 display: inline-block;
847 vertical-align: text-bottom;
850 .module-item.unstable {
862 .impl-items .since, .impl .since, .methods .since {
869 .impl-items .srclink, .impl .srclink, .methods .srclink {
871 /* Override header settings otherwise it's too bold */
876 .impl-items code, .impl code, .methods code {
880 .impl-items h4, h4.impl, h3.impl, .methods h3 {
885 /* Push the src link out to the right edge consistently */
886 justify-content: space-between;
893 .variants_table tbody tr td:first-child {
894 width: 1%; /* make the variant name as small as possible */
905 pre.rust .question-mark {
910 display: inline-block;
912 padding: 5px 10px 5px 10px;
920 text-decoration: none;
923 .section-header:hover a:before {
926 padding-right: 10px; /* avoid gap that causes hover to disappear */
927 content: '\2002\00a7\2002';
930 .section-header:hover a {
931 text-decoration: none;
945 h3 > .collapse-toggle, h4 > .collapse-toggle {
950 .toggle-wrapper > .collapse-toggle {
960 .toggle-wrapper.collapsed {
962 transition: height .2s;
966 .collapse-toggle > .inner {
967 display: inline-block;
972 .collapse-toggle.hidden-default {
987 .out-of-band > span.since {
993 .toggle-wrapper > .collapse-toggle {
997 .variant + .toggle-wrapper + .docblock > p {
1001 .sub-variant, .sub-variant > h3 {
1002 margin-top: 1px !important;
1005 #main > .sub-variant > h3 {
1011 .sub-variant > div {
1013 margin-bottom: 10px;
1016 .sub-variant > div > span {
1022 display: inline-block;
1027 .enum > .toggle-wrapper + .docblock, .struct > .toggle-wrapper + .docblock {
1029 margin-bottom: 20px;
1033 .docblock > .section-header:first-child {
1038 .docblock > .section-header:first-child:hover > a:before {
1042 .enum > .collapsed, .struct > .collapsed {
1043 margin-bottom: 25px;
1046 #main > .variant, #main > .structfield {
1052 margin-top: 0px !important;
1054 margin-bottom: 0px !important;
1057 .toggle-attributes.collapsed {
1060 .impl-items > .toggle-attributes {
1063 .impl-items .attributes {
1080 display: inline-block;
1087 padding: 5px 3px 3px 3px;
1093 .tooltip.ignore::after {
1094 content: "This example is not tested";
1096 .tooltip.compile_fail::after {
1097 content: "This example deliberately fails to compile";
1099 .tooltip.should_panic::after {
1100 content: "This example panics";
1102 .tooltip.edition::after {
1103 content: "This code runs with edition " attr(data-edition);
1113 border-style: solid;
1117 .tooltip:hover::before, .tooltip:hover::after {
1121 .tooltip.compile_fail, .tooltip.should_panic, .tooltip.ignore {
1126 .notable-traits-tooltip {
1127 display: inline-block;
1131 .notable-traits:hover .notable-traits-tooltiptext,
1132 .notable-traits .notable-traits-tooltiptext.force-tooltip {
1133 display: inline-block;
1136 .notable-traits .notable-traits-tooltiptext {
1138 padding: 5px 3px 3px 3px;
1148 .notable-traits-tooltip::after {
1149 /* The margin on the tooltip does not capture hover events,
1150 this extends the area of hover enough so that mouse hover is not
1151 lost when moving the mouse to the tooltip */
1152 content: "\00a0\00a0\00a0";
1155 .notable-traits .notable, .notable-traits .docblock {
1159 .notable-traits .docblock code.content{
1165 /* Example code has the "Run" button that needs to be positioned relative to the pre */
1166 pre.rust.rust-example-rendered {
1180 .search-failed > ul {
1198 border-top: 2px solid;
1201 #titles > button:not(:last-child) {
1203 width: calc(33.3% - 1px);
1206 #titles > button > div.count {
1207 display: inline-block;
1217 h4 > .notable-traits {
1227 margin-bottom: 10px;
1241 border-top-right-radius: 3px;
1242 border-bottom-right-radius: 3px;
1245 transition: left .5s;
1258 transition: left .5s;
1259 border-right: 1px solid;
1261 #source-sidebar > .title {
1264 border-bottom: 1px solid;
1274 .theme-picker button {
1278 #settings-menu, .help-button {
1290 font-family: "Fira Sans",sans-serif;
1295 #theme-picker, #settings-menu, .help-button {
1315 #theme-choices > button {
1320 background: rgba(0,0,0,0);
1323 #theme-choices > button:not(:first-child) {
1324 border-top: 1px solid;
1329 @media (min-width: 701px) {
1330 /* In case there is no documentation before a code block, we need to add some margin at the top
1331 to prevent an overlay between the "collapse toggle" and the information tooltip.
1332 However, it's needed needed with smaller screen width because the doc/code block is always put
1333 "one line" below. */
1334 .information:first-child > .tooltip {
1339 @media (max-width: 700px) {
1344 .rustdoc > .sidebar {
1354 .sidebar > .location {
1358 padding: 3px 10px 1px 10px;
1360 background: inherit;
1365 .sidebar .location:empty {
1369 .sidebar .logo-container {
1378 .sidebar .logo-container > img {
1392 border-bottom: 1px solid;
1393 border-right: 1px solid;
1397 .rustdoc.source > .sidebar > .sidebar-menu {
1408 border-right: 1px solid;
1412 .sidebar > .block.version {
1413 border-bottom: none;
1418 width: calc(100% - 32px);
1435 .content h4 > .out-of-band {
1439 .toggle-wrapper > .collapse-toggle {
1451 .content .impl-items .method, .content .impl-items > .type, .impl-items > .associatedconstant {
1456 display: none !important;
1469 h4 > .notable-traits {
1475 #titles > button > div.count {
1488 background-color: rgba(0,0,0,0);
1492 width: calc(100% + 30px);
1500 .show-it > .block.items {
1504 .show-it > .block.items > ul {
1508 .show-it > .block.items > ul > li {
1513 .show-it > .block.items > ul > li > a {
1517 /* Because of ios, we need to actually have a full height sidebar title so the
1518 * actual sidebar can show up. But then we need to make it transparent so we don't
1519 * hide content. The filler just allows to create the background for the sidebar
1520 * title. But because of the absolute position, I had to lower the z-index.
1525 width: calc(100% - 45px);
1529 border-bottom: 1px solid;
1536 .impl > .collapse-toggle {
1556 #main > .line-numbers {
1560 .notable-traits .notable-traits-tooltiptext {
1565 /* We don't display the help button on mobile devices. */
1569 .search-container > div {
1570 width: calc(100% - 32px);
1575 nav.sub, .content .out-of-band, .collapse-toggle {
1580 @media (max-width: 416px) {
1581 #titles, #titles > button {
1585 /* This is to prevent the search bar from being underneath the <section>
1586 * element following it.
1592 #main > table:not(.table-display) td {
1593 word-break: break-word;
1597 .search-container > div {
1599 width: calc(100% - 37px);
1608 #crate-search + .search-input {
1609 width: calc(100% + 71px);
1613 #theme-picker, #settings-menu {
1630 margin-bottom: 13px;
1635 display: inline-block;
1637 font: 15px monospace;
1639 vertical-align: middle;
1642 box-shadow: inset 0 -1px 0;
1646 .hidden-by-impl-hider,
1647 .hidden-by-usual-hider {
1648 /* important because of conflicting rule for small screens */
1649 display: none !important;
1652 #implementations-list > h3 > span.in-band {
1659 border-collapse: collapse;
1664 .table-display tr td:first-child {
1668 .table-display tr td:last-child {
1671 .table-display .out-of-band {
1676 #implementors-list > .impl-items .table-display .out-of-band {
1680 .table-display td:hover .anchor {
1710 div.files > a:hover, div.name:hover {
1711 background-color: #a14b4b;
1713 div.name.expand + .children {
1724 div.name.expand::before {
1725 transform: rotate(90deg);
1730 /* This part is to fix the "Expand attributes" part in the type declaration. */
1731 .type-decl > pre > .toggle-wrapper.toggle-attributes.top-attr {
1732 margin-left: 0 !important;
1734 .type-decl > pre > .docblock.attributes.top-attr {
1735 margin-left: 1.8em !important;
1737 .type-decl > pre > .toggle-attributes {
1740 .type-decl > pre > .docblock.attributes {