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 :not
(code
)>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
;
397 .docblock-short.nowrap {
401 text-overflow: ellipsis
;
406 text-overflow: ellipsis
;
409 .docblock code, .docblock-short code {
410 white-space: pre-wrap
;
413 .docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5 {
414 border-bottom: 1px solid
;
417 #main > .docblock h1
{ font-size: 1.3em; }
418 #main > .docblock h2
{ font-size: 1.15em; }
419 #main > .docblock h3
, #main
> .docblock h4
, #main
> .docblock h5
{ font-size: 1em; }
421 #main > h2
+ div
, #main
> h2
+ h3
, #main
> h3
+ div
{
422 display: none
; /* Changed to flex or block via js once the page is loaded */
426 .docblock h1 { font-size: 1em; }
427 .docblock h2 { font-size: 0.95em; }
428 .docblock h3, .docblock h4, .docblock h5 { font-size: 0.9em; }
435 .content .out-of-band {
443 h3
.impl
> .out-of-band
{
447 h4
.method
> .out-of-band
{
451 h4
> code
, h3
> code
, .invisible
> code
{
452 max-width: calc
(100% - 41px);
458 display: inline-block
;
467 display: inline-block
;
475 font-family: "Fira Sans", sans-serif
;
478 .content table:not(.table-display) {
479 border-spacing: 0 5px;
481 .content td { vertical-align: top
; }
482 .content td:first-child { padding-right: 20px; }
483 .content td p:first-child { margin-top: 0; }
484 .content td h1, .content td h2 { margin-left: 0; font-size: 1.1em; }
485 .content tr:first-child td { border-top: 0; }
489 width: calc
(100% - 2px);
508 .content .item-list {
509 list-style-type: none
;
513 .content .multi-column {
514 -moz-column-count: 5;
515 -moz-column-gap: 2.5em;
516 -webkit-column-count: 5;
517 -webkit-column-gap: 2.5em;
521 .content .multi-column li { width: 100%; display: inline-block
; }
527 /* Shift "where ..." part of method or fn definition down a line */
528 .content
.method
.where
,
530 .content .where.fmt-newline {
535 .content .methods > div:not(.notable-traits) {
540 .content .docblock > .impl-items {
544 .content .docblock > .impl-items > h4 {
547 .content .docblock >.impl-items .table-display {
550 .content .docblock >.impl-items table td {
553 .toggle-wrapper.marg-left > .collapse-toggle {
556 .content .docblock > .impl-items .table-display, .impl-items table td {
560 .content .stability code {
564 .content .stability {
570 .sub-variant > div > .stability {
574 .content .stability::before {
582 .content .impl-items .method, .content .impl-items > .type, .impl-items > .associatedconstant {
586 .content .impl-items .docblock, .content .impl-items .stability {
590 .content .impl-items > .stability {
594 .methods > .stability, .content .impl-items > .stability {
607 border-bottom: 1px solid
;
608 padding-bottom: 10px;
616 border-top: 1px solid
;
617 border-bottom: 1px solid
;
619 nav
.main
.separator
{
621 display: inline-block
;
625 nav
.sum
{ text-align: right
; }
626 nav
.sub form
{ display: inline
; }
633 text-decoration: none
;
634 background: transparent
;
637 .small-section-header:hover > .anchor {
641 .in-band:hover > .anchor, .impl:hover > .anchor {
642 display: inline-block
;
653 .small-section-header > .anchor {
655 padding-right: 10px; /* avoid gap that causes hover to disappear */
658 content: '\2002\00a7\2002';
661 .docblock
a:not
(.srclink
):not
(.test-arrow
):hover
,
662 .docblock-short a:not(.srclink):not(.test-arrow):hover, .stability a {
663 text-decoration: underline
;
666 .invisible > .srclink, h4 > code + .srclink {
674 .block a.current.crate { font-weight: 500; }
679 .search-container > div {
680 display: inline-flex
;
681 width: calc
(100% - 63px);
690 border-radius: 4px 0 0 4px;
693 border-right: 1px solid
;
694 -moz-appearance: none
;
695 -webkit-appearance: none
;
696 /* Removes default arrow from firefox */
699 background-repeat: no-repeat
;
700 background-color: transparent
;
701 background-size: 20px;
702 background-position: calc
(100% - 1px) 56%;
704 .search-container > .top-button {
710 /* Override Normalize.css: we have margins and do
711 not want to overflow - the `moz` attribute is necessary
712 until Firefox 29, too early to drop at this point */
713 -moz-box-sizing: border-box
!important
;
714 box-sizing: border-box
!important
;
721 transition: border-color
300ms ease
;
722 transition: border-radius
300ms ease-in-out
;
723 transition: box-shadow
300ms ease-in-out
;
727 #crate-search + .search-input
{
728 border-radius: 0 1px 1px 0;
729 width: calc
(100% - 32px);
732 .search-input:focus {
738 .search-results .desc {
740 text-overflow: ellipsis
;
749 .content .search-results td:first-child {
753 .content .search-results td:first-child a {
756 .content .search-results td:first-child a:after {
761 .content .search-results td:first-child a span {
765 tr
.result span
.primitive::after
{
766 content: ' (primitive type)';
770 tr
.result span
.keyword::after
{
771 content: ' (keyword)';
775 body
.blur
> :not
(#help
) {
777 -webkit-filter: blur
(8px);
788 justify-content: center
;
793 box-shadow: 0 0 6px rgba
(0,0,0,.2);
803 #help dd
{ margin: 5px 35px; }
804 #help .infos
{ padding-left: 0; }
805 #help h1
, #help h2
{ margin-top: 0; }
835 display: inline-block
;
841 vertical-align: text-bottom
;
844 .module-item.unstable {
856 .impl-items .since, .impl .since {
863 .impl-items .srclink, .impl .srclink {
865 /* Override header settings otherwise it's too bold */
870 .impl-items code, .impl code {
874 .impl-items h4, h4.impl, h3.impl {
879 /* Push the src link out to the right edge consistently */
880 justify-content: space-between
;
887 .variants_table tbody tr td:first-child {
888 width: 1%; /* make the variant name as small as possible */
899 pre
.rust
.question-mark
{
904 display: inline-block
;
906 padding: 5px 10px 5px 10px;
914 text-decoration: none
;
917 .section-header:hover a:before {
920 padding-right: 10px; /* avoid gap that causes hover to disappear */
921 content: '\2002\00a7\2002';
924 .section-header:hover a {
925 text-decoration: none
;
939 h3
> .collapse-toggle
, h4
> .collapse-toggle
{
944 .toggle-wrapper > .collapse-toggle {
954 .toggle-wrapper.collapsed {
956 transition: height
.2s;
960 .collapse-toggle > .inner {
961 display: inline-block
;
966 .collapse-toggle.hidden-default {
981 .out-of-band > span.since {
987 .toggle-wrapper > .collapse-toggle {
991 .variant + .toggle-wrapper + .docblock > p {
995 .sub-variant, .sub-variant > h3 {
996 margin-top: 1px !important
;
999 #main > .sub-variant
> h3
{
1005 .sub-variant > div {
1007 margin-bottom: 10px;
1010 .sub-variant > div > span {
1016 display: inline-block
;
1021 .enum > .toggle-wrapper + .docblock, .struct > .toggle-wrapper + .docblock {
1023 margin-bottom: 20px;
1027 .docblock > .section-header:first-child {
1032 .docblock > .section-header:first-child:hover > a:before {
1036 .enum > .collapsed, .struct > .collapsed {
1037 margin-bottom: 25px;
1040 #main > .variant
, #main
> .structfield
{
1046 margin-top: 0px !important
;
1048 margin-bottom: 0px !important
;
1051 .toggle-attributes.collapsed {
1054 .impl-items > .toggle-attributes {
1057 .impl-items .attributes {
1074 display: inline-block
;
1078 .tooltip .tooltiptext {
1082 padding: 5px 3px 3px 3px;
1091 .tooltip .tooltiptext::after {
1098 border-style: solid
;
1101 .tooltip.compile_fail, .tooltip.should_panic, .tooltip.ignore {
1106 .notable-traits-tooltip {
1107 display: inline-block
;
1111 .notable-traits:hover
.notable-traits-tooltiptext
,
1112 .notable-traits .notable-traits-tooltiptext.force-tooltip {
1113 display: inline-block
;
1116 .notable-traits .notable-traits-tooltiptext {
1118 padding: 5px 3px 3px 3px;
1128 .notable-traits-tooltip::after {
1129 /* The margin on the tooltip does not capture hover events,
1130 this extends the area of hover enough so that mouse hover is not
1131 lost when moving the mouse to the tooltip */
1132 content: "\00a0\00a0\00a0";
1135 .notable-traits .notable, .notable-traits .docblock {
1139 .notable-traits .docblock code.content{
1145 /* Example code has the "Run" button that needs to be positioned relative to the pre */
1146 pre
.rust
.rust-example-rendered
{
1160 .search-failed > ul {
1177 border-top: 2px solid
;
1180 #titles > div:not
(:last-child
) {
1182 width: calc
(33.3% - 1px);
1185 #titles > div
> div
.count
{
1186 display: inline-block
;
1196 h4
> .notable-traits
{
1206 margin-bottom: 10px;
1220 border-top-right-radius: 3px;
1221 border-bottom-right-radius: 3px;
1224 transition: left
.5s;
1237 transition: left
.5s;
1238 border-right: 1px solid
;
1240 #source-sidebar > .title
{
1243 border-bottom: 1px solid
;
1253 .theme-picker button {
1257 #settings-menu, .help-button
{
1269 font-family: "Fira Sans",sans-serif
;
1274 #theme-picker, #settings-menu
, .help-button
{
1294 #theme-choices > button
{
1299 background: rgba
(0,0,0,0);
1302 #theme-choices > button:not
(:first-child
) {
1303 border-top: 1px solid
;
1308 @media (min-width: 701px) {
1309 /* In case there is no documentation before a code block, we need to add some margin at the top
1310 to prevent an overlay between the "collapse toggle" and the information tooltip.
1311 However, it's needed needed with smaller screen width because the doc/code block is always put
1312 "one line" below. */
1313 .information:first-child > .tooltip {
1318 @media (max-width: 700px) {
1323 .rustdoc > .sidebar {
1333 .sidebar > .location {
1337 padding: 3px 10px 1px 10px;
1339 background: inherit
;
1344 .sidebar .location:empty {
1348 .sidebar .logo-container {
1357 .sidebar .logo-container > img {
1371 border-bottom: 1px solid
;
1372 border-right: 1px solid
;
1376 .rustdoc.source > .sidebar > .sidebar-menu {
1387 border-right: 1px solid
;
1391 .sidebar > .block.version {
1392 border-bottom: none
;
1397 width: calc
(100% - 32px);
1414 .content h4 > .out-of-band {
1418 .toggle-wrapper > .collapse-toggle {
1430 .content .impl-items .method, .content .impl-items > .type, .impl-items > .associatedconstant {
1435 display: none
!important
;
1448 h4
> .notable-traits
{
1454 #titles > div
> div
.count
{
1467 background-color: rgba
(0,0,0,0);
1471 width: calc
(100% + 30px);
1479 .show-it > .block.items {
1483 .show-it > .block.items > ul {
1487 .show-it > .block.items > ul > li {
1492 .show-it > .block.items > ul > li > a {
1496 /* Because of ios, we need to actually have a full height sidebar title so the
1497 * actual sidebar can show up. But then we need to make it transparent so we don't
1498 * hide content. The filler just allows to create the background for the sidebar
1499 * title. But because of the absolute position, I had to lower the z-index.
1504 width: calc
(100% - 45px);
1508 border-bottom: 1px solid
;
1515 .impl > .collapse-toggle {
1535 #main > .line-numbers
{
1539 .notable-traits .notable-traits-tooltiptext {
1546 nav
.sub
, .content
.out-of-band
, .collapse-toggle
{
1551 @media (max-width: 416px) {
1563 margin-bottom: 13px;
1568 display: inline-block
;
1570 font: 15px monospace
;
1572 vertical-align: middle
;
1575 box-shadow: inset
0 -1px 0;
1579 .hidden-by-impl-hider
,
1580 .hidden-by-usual-hider {
1581 /* important because of conflicting rule for small screens */
1582 display: none
!important
;
1585 #implementations-list > h3
> span
.in-band
{
1592 border-collapse: collapse
;
1597 .table-display tr td:first-child {
1601 .table-display tr td:last-child {
1604 .table-display .out-of-band {
1609 #implementors-list > .impl-items
.table-display
.out-of-band
{
1613 .table-display td:hover .anchor {
1643 div
.files
> a:hover
, div
.name:hover
{
1644 background-color: #a14b4b;
1646 div
.name
.expand
+ .children
{
1657 div
.name
.expand::before
{
1658 transform: rotate
(90deg);
1663 /* This part is to fix the "Expand attributes" part in the type declaration. */
1664 .type-decl > pre > .toggle-wrapper.toggle-attributes.top-attr {
1665 margin-left: 0 !important
;
1667 .type-decl > pre > .docblock.attributes.top-attr {
1668 margin-left: 1.8em !important
;
1670 .type-decl > pre > .toggle-attributes {
1673 .type-decl > pre > .docblock.attributes {