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.woff") format
('woff');
55 font-family: 'Source Code Pro';
58 src: url
("SourceCodePro-Semibold.woff") format
('woff');
63 -webkit-box-sizing: border-box
;
64 -moz-box-sizing: border-box
;
65 box-sizing: border-box
;
68 /* This part handles the "default" theme being used depending on the system one. */
72 @media (prefers-color-scheme: light
) {
77 @media (prefers-color-scheme: dark
) {
83 /* General structure and fonts */
86 font: 16px/1.4 "Source Serif Pro", serif
;
89 padding: 10px 15px 20px 15px;
91 -webkit-font-feature-settings: "kern", "liga";
92 -moz-font-feature-settings: "kern", "liga";
93 font-feature-settings: "kern", "liga";
105 h1
, h2
, h3:not
(.impl
):not
(.method
):not
(.type
):not
(.tymethod
):not
(.notable
),
106 h4:not
(.method
):not
(.type
):not
(.tymethod
):not
(.associatedconstant
) {
108 margin: 20px 0 15px 0;
112 border-bottom: 1px dashed
;
115 h1
.fqn
> .in-band
> a:hover
{
116 text-decoration: underline
;
118 h2
, h3:not
(.impl
):not
(.method
):not
(.type
):not
(.tymethod
),
119 h4:not
(.method
):not
(.type
):not
(.tymethod
):not
(.associatedconstant
) {
120 border-bottom: 1px solid
;
122 h3
.impl
, h3
.method
, h4
.method
, h3
.type
, h4
.type
, h4
.associatedconstant
{
129 h3
.impl
, h3
.method
, h3
.type
{
134 .sidebar
, a
.source
, .search-input
, .content table
td:first-child
> a
,
135 .collapse-toggle
, div
.item-list
.out-of-band
,
136 #source-sidebar, #sidebar-toggle
,
137 /* This selector is for the items listed in the "all items" page. */
138 #main > ul
.docblock
> li
> a
{
139 font-family: "Fira Sans", Arial
, sans-serif
;
142 .content ul.crate a.crate {
144 font-family: "Fira Sans", Arial
, sans-serif
;
150 ul ul
, ol ul
, ul ol
, ol ol
{
162 code
, pre
, a
.test-arrow
{
163 font-family: "Source Code Pro", monospace
;
165 .docblock code, .docblock-short code {
169 .docblock pre code, .docblock-short pre code, .docblock code.spotlight {
173 .docblock code.spotlight :last-child {
174 padding-bottom: 0.6em;
180 .source .content pre {
202 text-transform: uppercase
;
214 /* Improve the scrollbar display on firefox */
216 scrollbar-width: initial
;
219 scrollbar-width: thin
;
222 /* Improve the scrollbar display on webkit-based browsers */
223 ::-webkit-scrollbar
{
226 .sidebar::-webkit-scrollbar {
229 ::-webkit-scrollbar-track
{
230 -webkit-box-shadow: inset
0;
233 .sidebar .block > ul > li {
241 /* Everything else */
244 display: none
!important
;
256 .logo-container > img {
262 transform: translate
(-50%, -50%);
269 margin: 30px 10px 20px 10px;
271 word-wrap: break-word
;
277 border-bottom: 1px solid
;
278 overflow-wrap: break-word
;
279 word-wrap: break-word
; /* deprecated */
280 word-break: break-word
; /* Chrome, non-standard */
287 .location a:first-child {
295 .block h2, .block h3 {
300 .block ul, .block li {
308 text-overflow: ellipsis
;
314 transition: border
500ms ease-out
;
318 border-top: 1px solid
;
319 border-bottom: 1px solid
;
342 .source .content pre.rust {
348 .rustdoc:not(.source) .example-wrap {
349 display: inline-flex
;
358 .example-wrap > pre.line-number {
361 border-top-left-radius: 5px;
362 border-bottom-left-radius: 5px;
367 .rustdoc:not(.source) .example-wrap > pre.rust {
372 .rustdoc:not(.source) .example-wrap > pre {
394 .content pre.line-numbers {
399 -webkit-user-select: none
;
400 -moz-user-select: none
;
401 -ms-user-select: none
;
409 overflow-wrap: anywhere
;
417 text-overflow: ellipsis
;
420 .docblock-short code {
421 white-space: pre-wrap
;
424 .docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5 {
425 border-bottom: 1px solid
;
428 #main > .docblock h1
{ font-size: 1.3em; }
429 #main > .docblock h2
{ font-size: 1.15em; }
430 #main > .docblock h3
, #main
> .docblock h4
, #main
> .docblock h5
{ font-size: 1em; }
432 #main > h2
+ div
, #main
> h2
+ h3
, #main
> h3
+ div
{
433 display: none
; /* Changed to flex or block via js once the page is loaded */
437 .docblock h1 { font-size: 1em; }
438 .docblock h2 { font-size: 0.95em; }
439 .docblock h3, .docblock h4, .docblock h5 { font-size: 0.9em; }
446 .content .out-of-band {
454 h3
.impl
> .out-of-band
{
458 h4
.method
> .out-of-band
{
462 h4
> code
, h3
> code
, .invisible
> code
{
463 max-width: calc
(100% - 41px);
469 display: inline-block
;
478 display: inline-block
;
486 font-family: "Fira Sans", Arial
, sans-serif
;
489 .content table:not(.table-display) {
490 border-spacing: 0 5px;
492 .content td { vertical-align: top
; }
493 .content td:first-child { padding-right: 20px; }
494 .content td p:first-child { margin-top: 0; }
495 .content td h1, .content td h2 { margin-left: 0; font-size: 1.1em; }
496 .content tr:first-child td { border-top: 0; }
500 width: calc
(100% - 2px);
519 .content .item-list {
520 list-style-type: none
;
524 .content .multi-column {
525 -moz-column-count: 5;
526 -moz-column-gap: 2.5em;
527 -webkit-column-count: 5;
528 -webkit-column-gap: 2.5em;
532 .content .multi-column li { width: 100%; display: inline-block
; }
538 /* Shift "where ..." part of method or fn definition down a line */
539 .content
.method
.where
,
541 .content .where.fmt-newline {
546 .content .methods > div:not(.notable-traits) {
551 .content .docblock > .impl-items {
555 .content .docblock > .impl-items > h4 {
558 .content .docblock >.impl-items .table-display {
561 .content .docblock >.impl-items table td {
564 .toggle-wrapper.marg-left > .collapse-toggle {
567 .content .docblock > .impl-items .table-display, .impl-items table td {
571 .content .item-info code {
575 .content .item-info {
581 .sub-variant > div > .item-info {
585 .content .item-info::before {
593 .content .impl-items .method, .content .impl-items > .type, .impl-items > .associatedconstant {
597 .content .impl-items .docblock, .content .impl-items .item-info {
601 .content .impl-items > .item-info {
605 .methods > .item-info, .content .impl-items > .item-info {
618 border-bottom: 1px solid
;
619 padding-bottom: 10px;
627 border-top: 1px solid
;
628 border-bottom: 1px solid
;
630 nav
.main
.separator
{
632 display: inline-block
;
636 nav
.sum
{ text-align: right
; }
637 nav
.sub form
{ display: inline
; }
644 text-decoration: none
;
645 background: transparent
;
648 .small-section-header:hover > .anchor {
652 .in-band:hover > .anchor, .impl:hover > .anchor {
653 display: inline-block
;
664 .small-section-header > .anchor {
666 padding-right: 10px; /* avoid gap that causes hover to disappear */
669 content: '\2002\00a7\2002';
672 .docblock
a:not
(.srclink
):not
(.test-arrow
):hover
,
673 .docblock-short a:not(.srclink):not(.test-arrow):hover, .item-info a {
674 text-decoration: underline
;
677 .invisible > .srclink, h4 > code + .srclink, h3 > code + .srclink {
685 .block a.current.crate { font-weight: 500; }
690 .search-container > div {
691 display: inline-flex
;
692 width: calc
(100% - 63px);
702 border-radius: 4px 0 0 4px;
705 border-right: 1px solid
;
706 -moz-appearance: none
;
707 -webkit-appearance: none
;
708 /* Removes default arrow from firefox */
711 background-repeat: no-repeat
;
712 background-color: transparent
;
713 background-size: 20px;
714 background-position: calc
(100% - 1px) 56%;
716 .search-container > .top-button {
722 /* Override Normalize.css: we have margins and do
723 not want to overflow - the `moz` attribute is necessary
724 until Firefox 29, too early to drop at this point */
725 -moz-box-sizing: border-box
!important
;
726 box-sizing: border-box
!important
;
733 transition: border-color
300ms ease
;
734 transition: border-radius
300ms ease-in-out
;
735 transition: box-shadow
300ms ease-in-out
;
739 #crate-search + .search-input
{
740 border-radius: 0 1px 1px 0;
741 width: calc
(100% - 32px);
744 .search-input:focus {
750 .search-results .desc {
752 text-overflow: ellipsis
;
761 .content .search-results td:first-child {
765 .content .search-results td:first-child a {
768 .content .search-results td:first-child a:after {
773 .content .search-results td:first-child a span {
777 tr
.result span
.primitive::after
{
778 content: ' (primitive type)';
782 tr
.result span
.keyword::after
{
783 content: ' (keyword)';
787 body
.blur
> :not
(#help
) {
789 -webkit-filter: blur
(8px);
800 justify-content: center
;
805 box-shadow: 0 0 6px rgba
(0,0,0,.2);
814 margin-right: 0.5rem;
821 border-bottom: 1px solid
#ccc;
825 #help dd
{ margin: 5px 35px; }
826 #help .infos
{ padding-left: 0; }
827 #help h1
, #help h2
{ margin-top: 0; }
831 padding: 0 20px 20px 17px;;
856 display: inline-block
;
862 vertical-align: text-bottom
;
865 .module-item.unstable {
877 .impl-items .since, .impl .since, .methods .since {
884 .impl-items .srclink, .impl .srclink, .methods .srclink {
886 /* Override header settings otherwise it's too bold */
891 .impl-items code, .impl code, .methods code {
895 .impl-items h4, h4.impl, h3.impl, .methods h3 {
900 /* Push the src link out to the right edge consistently */
901 justify-content: space-between
;
908 .variants_table tbody tr td:first-child {
909 width: 1%; /* make the variant name as small as possible */
920 pre
.rust
.question-mark
{
925 display: inline-block
;
927 padding: 5px 10px 5px 10px;
935 text-decoration: none
;
938 .section-header:hover a:before {
941 padding-right: 10px; /* avoid gap that causes hover to disappear */
942 content: '\2002\00a7\2002';
945 .section-header:hover a {
946 text-decoration: none
;
960 h3
> .collapse-toggle
, h4
> .collapse-toggle
{
965 .toggle-wrapper > .collapse-toggle {
975 .toggle-wrapper.collapsed {
977 transition: height
.2s;
981 .collapse-toggle > .inner {
982 display: inline-block
;
987 .collapse-toggle.hidden-default {
1002 .out-of-band > span.since {
1008 .toggle-wrapper > .collapse-toggle {
1012 .variant + .toggle-wrapper + .docblock > p {
1016 .sub-variant, .sub-variant > h3 {
1017 margin-top: 1px !important
;
1020 #main > .sub-variant
> h3
{
1026 .sub-variant > div {
1028 margin-bottom: 10px;
1031 .sub-variant > div > span {
1037 display: inline-block
;
1042 .enum > .toggle-wrapper + .docblock, .struct > .toggle-wrapper + .docblock {
1044 margin-bottom: 20px;
1048 .docblock > .section-header:first-child {
1053 .docblock > .section-header:first-child:hover > a:before {
1057 .enum > .collapsed, .struct > .collapsed {
1058 margin-bottom: 25px;
1061 #main > .variant
, #main
> .structfield
{
1067 margin-top: 0px !important
;
1069 margin-bottom: 0px !important
;
1072 .toggle-attributes.collapsed {
1075 .impl-items > .toggle-attributes {
1078 .impl-items .attributes {
1095 display: inline-block
;
1102 padding: 5px 3px 3px 3px;
1108 .tooltip.ignore::after {
1109 content: "This example is not tested";
1111 .tooltip.compile_fail::after {
1112 content: "This example deliberately fails to compile";
1114 .tooltip.should_panic::after {
1115 content: "This example panics";
1117 .tooltip.edition::after {
1118 content: "This code runs with edition " attr
(data-edition
);
1128 border-style: solid
;
1132 .tooltip:hover::before, .tooltip:hover::after {
1136 .tooltip.compile_fail, .tooltip.should_panic, .tooltip.ignore {
1141 .notable-traits-tooltip {
1142 display: inline-block
;
1146 .notable-traits:hover
.notable-traits-tooltiptext
,
1147 .notable-traits .notable-traits-tooltiptext.force-tooltip {
1148 display: inline-block
;
1151 .notable-traits .notable-traits-tooltiptext {
1153 padding: 5px 3px 3px 3px;
1163 .notable-traits-tooltip::after {
1164 /* The margin on the tooltip does not capture hover events,
1165 this extends the area of hover enough so that mouse hover is not
1166 lost when moving the mouse to the tooltip */
1167 content: "\00a0\00a0\00a0";
1170 .notable-traits .notable, .notable-traits .docblock {
1174 .notable-traits .docblock code.content{
1180 /* Example code has the "Run" button that needs to be positioned relative to the pre */
1181 pre
.rust
.rust-example-rendered
{
1195 .search-failed > ul {
1213 border-top: 2px solid
;
1216 #titles > button:not
(:last-child
) {
1218 width: calc
(33.3% - 1px);
1221 #titles > button
> div
.count
{
1222 display: inline-block
;
1232 h4
> .notable-traits
{
1242 margin-bottom: 10px;
1256 border-top-right-radius: 3px;
1257 border-bottom-right-radius: 3px;
1260 transition: left
.5s;
1273 transition: left
.5s;
1274 border-right: 1px solid
;
1276 #source-sidebar > .title
{
1279 border-bottom: 1px solid
;
1289 .theme-picker button {
1293 #settings-menu, .help-button
{
1305 font-family: "Fira Sans", Arial
, sans-serif
;
1310 #theme-picker, #settings-menu
, .help-button
{
1330 #theme-choices > button
{
1335 background: rgba
(0,0,0,0);
1338 #theme-choices > button:not
(:first-child
) {
1339 border-top: 1px solid
;
1344 @media (min-width: 701px) {
1345 /* In case there is no documentation before a code block, we need to add some margin at the top
1346 to prevent an overlay between the "collapse toggle" and the information tooltip.
1347 However, it's not needed with smaller screen width because the doc/code block is always put
1348 "one line" below. */
1349 .information:first-child > .tooltip {
1354 @media (max-width: 700px) {
1359 .rustdoc > .sidebar {
1369 .sidebar > .location {
1373 padding: 3px 10px 1px 10px;
1375 background: inherit
;
1380 .sidebar .location:empty {
1384 .sidebar .logo-container {
1393 .sidebar .logo-container > img {
1407 border-bottom: 1px solid
;
1408 border-right: 1px solid
;
1412 .rustdoc.source > .sidebar > .sidebar-menu {
1423 border-right: 1px solid
;
1427 .sidebar > .block.version {
1428 border-bottom: none
;
1434 width: calc
(100% - 32px);
1451 .content h4 > .out-of-band {
1455 .toggle-wrapper > .collapse-toggle {
1467 .content .impl-items .method, .content .impl-items > .type, .impl-items > .associatedconstant {
1472 display: none
!important
;
1485 h4
> .notable-traits
{
1491 #titles > button
> div
.count
{
1504 background-color: rgba
(0,0,0,0);
1508 This allows to prevent the version text to overflow the sidebar title on mobile mode when the
1509 sidebar is displayed (after clicking on the "hamburger" button).
1511 .sidebar.mobile > div.version {
1516 width: calc
(100% + 30px);
1524 .show-it > .block.items {
1528 .show-it > .block.items > ul {
1532 .show-it > .block.items > ul > li {
1537 .show-it > .block.items > ul > li > a {
1541 /* Because of ios, we need to actually have a full height sidebar title so the
1542 * actual sidebar can show up. But then we need to make it transparent so we don't
1543 * hide content. The filler just allows to create the background for the sidebar
1544 * title. But because of the absolute position, I had to lower the z-index.
1549 width: calc
(100% - 45px);
1553 border-bottom: 1px solid
;
1560 .impl > .collapse-toggle {
1580 #main > .line-numbers
{
1584 .notable-traits .notable-traits-tooltiptext {
1589 /* We don't display the help button on mobile devices. */
1593 .search-container > div {
1594 width: calc
(100% - 32px);
1599 nav
.sub
, .content
.out-of-band
, .collapse-toggle
{
1604 @media (max-width: 464px) {
1605 #titles, #titles
> button
{
1609 /* This is to prevent the search bar from being underneath the <section>
1610 * element following it.
1616 #main > table:not
(.table-display
) td
{
1617 word-break: break-word
;
1621 .search-container > div {
1623 width: calc
(100% - 37px);
1632 #crate-search + .search-input
{
1633 width: calc
(100% + 71px);
1637 #theme-picker, #settings-menu
{
1658 margin-bottom: 13px;
1663 display: inline-block
;
1665 font: 15px monospace
;
1667 vertical-align: middle
;
1670 box-shadow: inset
0 -1px 0;
1674 .hidden-by-impl-hider
,
1675 .hidden-by-usual-hider {
1676 /* important because of conflicting rule for small screens */
1677 display: none
!important
;
1680 #implementations-list > h3
> span
.in-band
{
1687 border-collapse: collapse
;
1692 .table-display tr td:first-child {
1696 .table-display tr td:last-child {
1699 .table-display .out-of-band {
1704 #implementors-list > .impl-items
.table-display
.out-of-band
{
1708 .table-display td:hover .anchor {
1738 div
.files
> a:hover
, div
.name:hover
{
1739 background-color: #a14b4b;
1741 div
.name
.expand
+ .children
{
1752 div
.name
.expand::before
{
1753 transform: rotate
(90deg);
1758 /* This part is to fix the "Expand attributes" part in the type declaration. */
1759 .type-decl > pre > .toggle-wrapper.toggle-attributes.top-attr {
1760 margin-left: 0 !important
;
1762 .type-decl > pre > .docblock.attributes.top-attr {
1763 margin-left: 1.8em !important
;
1765 .type-decl > pre > .toggle-attributes {
1768 .type-decl > pre > .docblock.attributes {