rust/src/librustdoc/html/static/css/rustdoc.css

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

2375 lines
45 KiB
CSS
Raw Normal View History

/* See FiraSans-LICENSE.txt for the Fira Sans license. */
@font-face {
font-family: 'Fira Sans';
font-style: normal;
font-weight: 400;
src: local('Fira Sans'),
2022-04-21 10:57:57 +02:00
url("FiraSans-Regular.woff2") format("woff2");
font-display: swap;
}
@font-face {
font-family: 'Fira Sans';
font-style: normal;
font-weight: 500;
src: local('Fira Sans Medium'),
2022-04-21 10:57:57 +02:00
url("FiraSans-Medium.woff2") format("woff2");
font-display: swap;
}
/* See SourceSerif4-LICENSE.md for the Source Serif 4 license. */
@font-face {
font-family: 'Source Serif 4';
font-style: normal;
font-weight: 400;
src: local('Source Serif 4'),
2022-04-21 10:57:57 +02:00
url("SourceSerif4-Regular.ttf.woff2") format("woff2");
font-display: swap;
}
@font-face {
font-family: 'Source Serif 4';
font-style: italic;
font-weight: 400;
src: local('Source Serif 4 Italic'),
2022-04-21 10:57:57 +02:00
url("SourceSerif4-It.ttf.woff2") format("woff2");
font-display: swap;
}
@font-face {
font-family: 'Source Serif 4';
font-style: normal;
font-weight: 700;
src: local('Source Serif 4 Bold'),
2022-04-21 10:57:57 +02:00
url("SourceSerif4-Bold.ttf.woff2") format("woff2");
font-display: swap;
}
/* See SourceCodePro-LICENSE.txt for the Source Code Pro license. */
@font-face {
font-family: 'Source Code Pro';
font-style: normal;
font-weight: 400;
/* Avoid using locally installed font because bad versions are in circulation:
* see https://github.com/rust-lang/rust/issues/24355 */
2022-04-21 10:57:57 +02:00
src: url("SourceCodePro-Regular.ttf.woff2") format("woff2");
font-display: swap;
}
@font-face {
font-family: 'Source Code Pro';
font-style: italic;
font-weight: 400;
2022-04-21 10:57:57 +02:00
src: url("SourceCodePro-It.ttf.woff2") format("woff2");
font-display: swap;
}
@font-face {
font-family: 'Source Code Pro';
font-style: normal;
font-weight: 600;
2022-04-21 10:57:57 +02:00
src: url("SourceCodePro-Semibold.ttf.woff2") format("woff2");
font-display: swap;
}
2021-10-12 04:47:34 +09:00
/* Avoid using legacy CJK serif fonts in Windows like Batang. */
@font-face {
font-family: 'NanumBarunGothic';
2022-04-21 10:57:57 +02:00
src: url("NanumBarunGothic.ttf.woff2") format("woff2");
font-display: swap;
unicode-range: U+AC00-D7AF, U+1100-11FF, U+3130-318F, U+A960-A97F, U+D7B0-D7FF;
}
* {
2020-07-15 17:20:46 +02:00
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
2019-05-27 15:57:44 +02:00
/* This part handles the "default" theme being used depending on the system one. */
html {
content: "";
}
@media (prefers-color-scheme: light) {
html {
content: "light";
}
}
@media (prefers-color-scheme: dark) {
html {
content: "dark";
}
}
2013-10-14 21:32:12 +02:00
/* General structure and fonts */
body {
/* Line spacing at least 1.5 per Web Content Accessibility Guidelines
https://www.w3.org/WAI/WCAG21/Understanding/visual-presentation.html */
font: 1rem/1.5 "Source Serif 4", NanumBarunGothic, serif;
margin: 0;
position: relative;
/* We use overflow-wrap: break-word for Safari, which doesn't recognize
`anywhere`: https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-wrap */
overflow-wrap: break-word;
/* Then override it with `anywhere`, which is required to make non-Safari browsers break
more aggressively when we want them to. */
overflow-wrap: anywhere;
-webkit-font-feature-settings: "kern", "liga";
-moz-font-feature-settings: "kern", "liga";
font-feature-settings: "kern", "liga";
background-color: var(--main-background-color);
color: var(--main-color);
}
2014-04-27 09:07:12 +03:00
h1 {
font-size: 1.5rem; /* 24px */
2014-04-27 09:07:12 +03:00
}
h2 {
font-size: 1.375rem; /* 22px */
2014-04-27 09:07:12 +03:00
}
h3 {
font-size: 1.25rem; /* 20px */
2014-04-27 09:07:12 +03:00
}
h1, h2, h3, h4, h5, h6 {
font-weight: 500;
2021-10-18 21:04:38 -07:00
}
h1, h2, h3, h4 {
margin: 20px 0 15px 0;
padding-bottom: 6px;
}
.docblock h3, .docblock h4, h5, h6 {
2021-10-18 21:04:38 -07:00
margin: 15px 0 5px 0;
}
h1.fqn {
margin: 0;
padding: 0;
border-bottom-color: var(--headings-border-bottom-color);
}
h2, h3, h4 {
border-bottom-color: var(--headings-border-bottom-color);
}
.main-heading {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
padding-bottom: 6px;
margin-bottom: 15px;
}
.main-heading a:hover {
text-decoration: underline;
}
#toggle-all-docs {
text-decoration: none;
}
/* The only headings that get underlines are:
Markdown-generated headings within the top-doc
Rustdoc-generated h2 section headings (e.g. "Implementations", "Required Methods", etc)
Underlines elsewhere in the documentation break up visual flow and tend to invert
section hierarchies. */
h2,
.top-doc .docblock > h3,
.top-doc .docblock > h4 {
2022-07-27 15:36:27 +02:00
border-bottom: 1px solid var(--headings-border-bottom-color);
}
h3.code-header {
font-size: 1.125rem; /* 18px */
}
h4.code-header {
font-size: 1rem;
}
.code-header {
font-weight: 600;
border-bottom-style: none;
margin: 0;
padding: 0;
margin-top: 0.6em;
margin-bottom: 0.4em;
}
.impl,
.impl-items .method,
.methods .method,
.impl-items .type,
.methods .type,
.impl-items .associatedconstant,
.methods .associatedconstant,
.impl-items .associatedtype,
.methods .associatedtype {
flex-basis: 100%;
font-weight: 600;
position: relative;
}
div.impl-items > div {
padding-left: 0;
}
h1, h2, h3, h4, h5, h6,
.sidebar,
.mobile-topbar,
a.source,
.search-input,
.search-results .result-name,
.content table td:first-child > a,
.item-left > a,
.out-of-band,
span.since,
#source-sidebar, #sidebar-toggle,
details.rustdoc-toggle > summary::before,
div.impl-items > div:not(.docblock):not(.item-info),
.content ul.crate a.crate,
a.srclink,
2022-07-18 17:45:54 +02:00
#main-content > .since,
#help-button > button,
details.rustdoc-toggle.top-doc > summary,
details.rustdoc-toggle.top-doc > summary::before,
details.rustdoc-toggle.non-exhaustive > summary,
details.rustdoc-toggle.non-exhaustive > summary::before,
.scraped-example-title,
.more-examples-toggle summary, .more-examples-toggle .hide-more,
.example-links a,
/* This selector is for the items listed in the "all items" page. */
2021-11-29 17:14:05 +01:00
#main-content > ul.docblock > li > a {
font-family: "Fira Sans", Arial, NanumBarunGothic, sans-serif;
}
h1, h2, h3, h4,
a#toggle-all-docs,
a.anchor,
.small-section-header a,
#source-sidebar a,
pre.rust a,
.sidebar h2 a,
.sidebar h3 a,
.mobile-topbar h2 a,
.in-band a,
.search-results a,
.module-item .stab,
.import-item .stab,
.result-name .primitive > i, .result-name .keyword > i,
.content .method .where,
.content .fn .where,
.content .where.fmt-newline {
color: var(--main-color);
}
ol, ul {
padding-left: 24px;
}
ul ul, ol ul, ul ol, ol ol {
margin-bottom: .625em;
}
p {
/* Paragraph spacing at least 1.5 times line spacing per Web Content Accessibility Guidelines.
Line-height is 1.5rem, so line spacing is .5rem; .75em is 1.5 times that.
https://www.w3.org/WAI/WCAG21/Understanding/visual-presentation.html */
margin: 0 0 .75em 0;
}
2017-08-18 17:09:51 +02:00
summary {
outline: none;
}
/* Fix some style changes due to normalize.css 8 */
td,
th {
padding: 0;
}
table {
border-collapse: collapse;
}
button,
input,
optgroup,
select,
textarea {
color: inherit;
font: inherit;
margin: 0;
}
button {
/* Buttons on Safari have different default padding than other platforms. Make them the same. */
padding: 1px 6px;
}
/* end tweaks for normalize.css 8 */
.rustdoc {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
}
main {
position: relative;
flex-grow: 1;
padding: 10px 15px 40px 45px;
min-width: 0;
}
2021-10-10 00:52:14 +02:00
.source main {
padding: 15px;
}
.width-limiter {
max-width: 960px;
margin-right: auto;
}
.source .width-limiter {
2021-10-10 00:52:14 +02:00
max-width: unset;
}
details:not(.rustdoc-toggle) summary {
margin-bottom: .6em;
}
code, pre, a.test-arrow, .code-header {
font-family: "Source Code Pro", monospace;
}
2016-09-09 11:54:12 +08:00
.docblock code, .docblock-short code {
border-radius: 3px;
padding: 0 0.125em;
}
.docblock pre code, .docblock-short pre code {
padding: 0;
2015-07-12 19:42:42 -04:00
}
pre {
padding: 14px;
2014-04-25 17:34:32 +09:00
}
.docblock.item-decl {
margin-left: 0;
}
.item-decl pre {
overflow-x: auto;
}
2014-04-25 17:34:32 +09:00
.source .content pre {
padding: 20px;
}
img {
max-width: 100%;
}
li {
position: relative;
}
.source .content {
max-width: none;
overflow: visible;
margin-left: 0px;
}
nav.sub {
2021-10-10 00:52:14 +02:00
position: relative;
font-size: 1rem;
}
2021-10-24 22:41:48 +02:00
.sub-container {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
}
.sub-logo-container {
display: none;
margin-right: 20px;
}
.source .sub-logo-container {
display: block;
}
.source .sub-logo-container > img {
height: 60px;
width: 60px;
object-fit: contain;
}
.sidebar, .mobile-topbar, .sidebar-menu-toggle {
background-color: var(--sidebar-background-color);
}
.sidebar {
font-size: 0.875rem;
width: 250px;
min-width: 200px;
overflow-y: scroll;
position: sticky;
height: 100vh;
2021-11-29 15:55:05 +01:00
top: 0;
left: 0;
}
.sidebar-elems,
.sidebar > .location {
padding-left: 24px;
}
.sidebar .location {
overflow-wrap: anywhere;
}
.rustdoc.source .sidebar {
2021-10-24 21:59:53 +02:00
width: 50px;
min-width: 0px;
max-width: 300px;
flex-grow: 0;
flex-shrink: 0;
flex-basis: auto;
border-right: 1px solid;
overflow-x: hidden;
2021-10-24 21:59:53 +02:00
/* The sidebar is by default hidden */
overflow-y: hidden;
}
.rustdoc.source .sidebar .sidebar-logo {
display: none;
}
.source .sidebar, #sidebar-toggle, #source-sidebar {
background-color: var(--sidebar-background-color);
}
2022-07-03 11:42:44 -07:00
#sidebar-toggle > button:hover, #sidebar-toggle > button:focus {
background-color: var(--sidebar-background-color-hover);
}
.source .sidebar > *:not(#sidebar-toggle) {
2021-10-24 21:59:53 +02:00
opacity: 0;
visibility: hidden;
}
.source-sidebar-expanded .source .sidebar {
2021-10-24 21:59:53 +02:00
overflow-y: auto;
}
.source-sidebar-expanded .source .sidebar > *:not(#sidebar-toggle) {
2021-10-24 21:59:53 +02:00
opacity: 1;
visibility: visible;
2021-10-10 00:52:14 +02:00
}
#all-types {
margin-top: 1em;
}
/* Improve the scrollbar display on firefox */
* {
scrollbar-width: initial;
scrollbar-color: var(--scrollbar-color);
}
.sidebar {
2020-04-01 16:12:40 +02:00
scrollbar-width: thin;
scrollbar-color: var(--scrollbar-color);
2020-04-01 16:12:40 +02:00
}
/* Improve the scrollbar display on webkit-based browsers */
::-webkit-scrollbar {
width: 12px;
}
2020-04-01 16:12:40 +02:00
.sidebar::-webkit-scrollbar {
width: 8px;
}
::-webkit-scrollbar-track {
2020-04-01 16:12:40 +02:00
-webkit-box-shadow: inset 0;
background-color: var(--scrollbar-track-background-color);
}
.sidebar::-webkit-scrollbar-track {
background-color: var(--scrollbar-track-background-color);
}
::-webkit-scrollbar-thumb, .sidebar::-webkit-scrollbar-thumb {
background-color: var(--scrollbar-thumb-background-color);
}
/* Everything else */
.hidden {
2018-02-01 23:40:23 +01:00
display: none !important;
}
.sidebar .logo-container {
2021-10-24 21:59:53 +02:00
display: flex;
margin-top: 10px;
2021-10-24 21:59:53 +02:00
margin-bottom: 10px;
justify-content: center;
}
.version {
overflow-wrap: break-word;
}
2019-04-29 11:45:06 +02:00
.logo-container > img {
2021-10-24 21:59:53 +02:00
height: 100px;
width: 100px;
2019-04-29 11:45:06 +02:00
}
.location:empty {
border: none;
}
.location a:first-of-type {
2018-02-01 23:40:23 +01:00
font-weight: 500;
}
.block {
padding: 0;
}
.block ul, .block li {
padding: 0;
margin: 0;
list-style: none;
}
.block a,
h2.location a {
display: block;
padding: 0.25rem;
margin-left: -0.25rem;
text-overflow: ellipsis;
overflow: hidden;
}
.sidebar h2 {
border-bottom: none;
font-weight: 500;
padding: 0;
margin: 0;
margin-top: 0.7rem;
margin-bottom: 0.7rem;
}
.sidebar h3 {
font-size: 1.125rem; /* 18px */
font-weight: 500;
padding: 0;
margin: 0;
}
.sidebar-elems .block {
margin-bottom: 2em;
}
.sidebar-elems .block li a {
white-space: nowrap;
}
.mobile-topbar {
display: none;
}
.source .content pre.rust {
white-space: pre;
overflow: auto;
padding-left: 0;
}
2017-12-04 22:11:21 +01:00
.rustdoc .example-wrap {
2018-10-08 22:51:37 +02:00
display: inline-flex;
2018-11-10 21:58:47 +01:00
margin-bottom: 10px;
2018-10-29 22:38:26 +01:00
}
.example-wrap {
position: relative;
2018-10-08 22:51:37 +02:00
width: 100%;
}
.example-wrap > pre.line-number {
overflow: initial;
border: 1px solid;
padding: 13px 8px;
text-align: right;
border-top-left-radius: 5px;
border-bottom-left-radius: 5px;
2018-10-08 22:51:37 +02:00
}
2021-04-14 13:26:49 +02:00
.example-wrap > pre.rust a:hover {
text-decoration: underline;
}
.line-numbers {
text-align: right;
}
2021-07-11 12:40:31 +02:00
.rustdoc:not(.source) .example-wrap > pre:not(.line-number) {
2018-10-08 22:51:37 +02:00
width: 100%;
2018-12-02 19:12:37 +01:00
overflow-x: auto;
2018-10-08 22:51:37 +02:00
}
2021-10-19 20:08:30 -07:00
.rustdoc:not(.source) .example-wrap > pre.line-numbers {
width: auto;
overflow-x: visible;
}
.rustdoc .example-wrap > pre {
2018-11-10 21:58:47 +01:00
margin: 0;
}
2017-05-11 22:28:13 +02:00
#search {
2017-12-04 22:11:21 +01:00
position: relative;
2017-05-11 22:28:13 +02:00
}
2017-12-04 22:11:21 +01:00
.search-loading {
text-align: center;
}
2018-03-27 10:33:31 +02:00
#results > table {
width: 100%;
table-layout: fixed;
}
.content > .example-wrap pre.line-numbers {
position: relative;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
2018-02-01 23:40:23 +01:00
.line-numbers span {
cursor: pointer;
}
.docblock-short {
overflow-wrap: break-word;
overflow-wrap: anywhere;
}
.docblock-short p {
display: inline;
}
.docblock-short p {
overflow: hidden;
text-overflow: ellipsis;
margin: 0;
}
/* Wrap non-pre code blocks (`text`) but not (```text```). */
.docblock > :not(pre) > code,
.docblock-short > :not(pre) > code {
white-space: pre-wrap;
}
.top-doc .docblock h2 { font-size: 1.375rem; }
2022-07-27 15:00:43 +02:00
.top-doc .docblock h3 { font-size: 1.25rem; }
2021-05-16 20:47:03 -07:00
.top-doc .docblock h4,
2021-10-18 21:04:38 -07:00
.top-doc .docblock h5 {
font-size: 1.125rem;
2021-10-18 21:04:38 -07:00
}
.top-doc .docblock h6 {
font-size: 1rem;
2021-05-16 20:47:03 -07:00
}
.docblock h5 { font-size: 1rem; }
.docblock h6 { font-size: 0.875rem; }
.docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5, .docblock h6 {
border-bottom-color: var(--headings-border-bottom-color);
}
2016-05-27 12:04:56 +02:00
.docblock {
margin-left: 24px;
position: relative;
2016-05-27 12:04:56 +02:00
}
.docblock > :not(.information):not(.more-examples-toggle) {
max-width: 100%;
overflow-x: auto;
}
.content .out-of-band {
2021-04-22 22:33:54 +02:00
flex-grow: 0;
font-size: 1.125rem;
font-weight: normal;
float: right;
2016-05-05 04:46:45 +02:00
}
.method > .code-header, .trait-impl > .code-header {
max-width: calc(100% - 41px);
display: block;
}
.content .in-band {
2021-04-22 22:33:54 +02:00
flex-grow: 1;
margin: 0px;
padding: 0px;
overflow-wrap: break-word;
overflow-wrap: anywhere;
}
.in-band > code, .in-band > .code-header {
2017-08-28 22:40:09 +02:00
display: inline-block;
}
.docblock code, .docblock-short code,
pre, .rustdoc.source .example-wrap {
background-color: var(--code-block-background-color);
}
2021-11-29 17:14:05 +01:00
#main-content {
2018-02-01 23:40:23 +01:00
position: relative;
}
2021-11-29 17:14:05 +01:00
#main-content > .since {
top: inherit;
}
2018-03-28 09:00:58 +02:00
.content table:not(.table-display) {
border-spacing: 0 5px;
}
.content td { vertical-align: top; }
.content td:first-child { padding-right: 20px; }
.content td p:first-child { margin-top: 0; }
.content td h1, .content td h2 { margin-left: 0; font-size: 1.125rem; }
2018-06-10 23:33:37 +02:00
.content tr:first-child td { border-top: 0; }
.docblock table {
margin: .5em 0;
2019-02-11 22:22:56 +01:00
width: calc(100% - 2px);
2021-07-17 23:39:18 +02:00
overflow-x: auto;
display: block;
}
.docblock table td {
padding: .5em;
2018-06-10 23:33:37 +02:00
border: 1px dashed;
}
.docblock table th {
padding: .5em;
text-align: left;
2018-06-10 23:33:37 +02:00
border: 1px solid;
}
.fields + table {
margin-bottom: 1em;
}
.content .item-list {
list-style-type: none;
padding: 0;
}
.content .multi-column {
-moz-column-count: 5;
-moz-column-gap: 2.5em;
-webkit-column-count: 5;
-webkit-column-gap: 2.5em;
column-count: 5;
column-gap: 2.5em;
}
.content .multi-column li { width: 100%; display: inline-block; }
2021-06-01 21:43:09 -07:00
.content > .methods > .method {
font-size: 1rem;
position: relative;
}
/* Shift "where ..." part of method or fn definition down a line */
.content .method .where,
.content .fn .where,
.content .where.fmt-newline {
2017-03-09 19:02:59 +01:00
display: block;
font-size: 0.875rem;
}
.content .methods > div:not(.notable-traits):not(.method) {
2018-03-28 10:48:00 +02:00
margin-left: 40px;
margin-bottom: 15px;
}
.content .docblock > .impl-items {
margin-left: 20px;
margin-top: -34px;
}
.content .docblock >.impl-items .table-display {
margin: 0;
}
.content .docblock >.impl-items table td {
padding: 0;
}
.content .docblock > .impl-items .table-display, .impl-items table td {
border: none;
}
.item-info {
display: block;
}
.content .item-info code {
font-size: 0.875rem;
}
.content .item-info {
2018-08-04 00:02:46 +02:00
position: relative;
margin-left: 24px;
2018-08-04 00:02:46 +02:00
}
.sub-variant > div > .item-info {
2018-10-19 01:34:46 +02:00
margin-top: initial;
}
.content .impl-items .docblock, .content .impl-items .item-info {
margin-bottom: .6em;
}
.content .impl-items > .item-info {
margin-left: 40px;
}
.methods > .item-info, .content .impl-items > .item-info {
margin-top: -8px;
}
2018-08-04 00:02:46 +02:00
.impl-items {
flex-basis: 100%;
}
2021-11-29 17:14:05 +01:00
#main-content > .item-info {
margin-top: 0;
margin-left: 0;
}
nav.sub {
2021-10-24 22:41:48 +02:00
flex-grow: 1;
margin-bottom: 25px;
}
.source nav.sub {
margin-left: 32px;
2021-10-10 00:52:14 +02:00
}
nav.main {
padding: 20px 0;
text-align: center;
}
nav.main .current {
border-top: 1px solid;
border-bottom: 1px solid;
}
nav.main .separator {
border: 1px solid;
display: inline-block;
height: 23px;
margin: 0 20px;
}
nav.sum { text-align: right; }
nav.sub form { display: inline; }
a {
text-decoration: none;
background: transparent;
}
2021-06-17 09:57:48 +02:00
.small-section-header {
display: flex;
justify-content: space-between;
position: relative;
}
2017-08-08 22:16:08 +02:00
.small-section-header:hover > .anchor {
display: initial;
}
.in-band:hover > .anchor, .impl:hover > .anchor, .method.trait-impl:hover > .anchor,
.type.trait-impl:hover > .anchor, .associatedconstant.trait-impl:hover > .anchor,
.associatedtype.trait-impl:hover > .anchor {
2017-08-28 22:40:09 +02:00
display: inline-block;
position: absolute;
}
2017-08-08 22:16:08 +02:00
.anchor {
display: none;
position: absolute;
left: -0.5em;
2021-08-06 16:47:35 +02:00
background: none !important;
2017-08-08 22:16:08 +02:00
}
.anchor.field {
left: -5px;
}
.small-section-header > .anchor {
2021-08-06 16:47:35 +02:00
left: -15px;
padding-right: 8px;
}
h2.small-section-header > .anchor {
padding-right: 6px;
}
2021-08-06 16:47:35 +02:00
.anchor::before {
content: '§';
2017-08-08 22:16:08 +02:00
}
.docblock a:not(.srclink):not(.test-arrow):not(.scrape-help):hover,
.docblock-short a:not(.srclink):not(.test-arrow):not(.scrape-help):hover, .item-info a {
text-decoration: underline;
}
.block a.current.crate { font-weight: 500; }
/* In most contexts we use `overflow-wrap: anywhere` to ensure that we can wrap
as much as needed on mobile (see
src/test/rustdoc-gui/type-declaration-overflow.goml for an example of why
this matters). The `anywhere` value means:
"Soft wrap opportunities introduced by the word break are considered when
calculating min-content intrinsic sizes."
https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-wrap#values
For table layouts, that becomes a problem: the browser tries to make each
column as narrow as possible, and `overflow-wrap: anywhere` means it can do
so by breaking words - even if some other column could be shrunk without
breaking words! This shows up, for instance, in the `Structs` / `Modules` /
`Functions` (etcetera) sections of a module page, and when a docblock
contains a table.
So, for table layouts, override the default with break-word, which does
_not_ affect min-content intrinsic sizes.
*/
table,
.item-table {
overflow-wrap: break-word;
}
.item-table {
2021-10-11 00:38:56 +02:00
display: table;
}
.item-row {
display: table-row;
}
.item-left, .item-right {
display: table-cell;
}
.item-left {
padding-right: 1.25rem;
}
2018-04-13 22:54:09 +02:00
.search-container {
position: relative;
2022-01-20 14:18:59 +01:00
display: flex;
height: 34px;
2018-04-13 22:54:09 +02:00
}
2022-01-20 14:18:59 +01:00
.search-container > * {
height: 100%;
2018-10-01 00:47:54 +02:00
}
.search-results-title {
Improve crate selection on rustdoc search results page Resolves all of issue #93240 Reproduces a similar change as #99086, but with improvements In particular, this PR inlcludes: * redesigning the crate-search selector so the background color matches its surroundings * decrease the font of the dropdown menu to a reaonable size * add a hover effect * make the color of the arrow theme-dependent, using a surrounding div, with :after pseudo-element that can then be transformed using CSS filters to approximate the desired color * fix the text "in" to match the title font * remove the "for xyz" in the "Results for xyz in [All crates]" title when searching for search term "xyz"; you can already see what you're searching for as it's typed in the search bar! * in line with #99086, handle super-long crate names appropriately without a long <select> element escaping the screen area; the improvement is that we also keep the title within a single line now; uses some flex layout shenanigans... * the margins / paddings are adjusted so the selected label of the <select> fits within the rest of that title nicely; also some inconsistency in the way that Firefox renders a <select> with "appearance: none" (roughly 4px more padding left and right of the text than e.g. Chrome) is worked around, and it now produces a result that looks (essentially) identical to Chrome * the color of the help menu and settings menu border in light theme is made to match with the color of the corresponding buttons, like they do (match) in the ayu theme * the casing of "All crates" changes to "all crates" * the new tests from #99086 are temporarily disabled, until they can be adapted later
2022-07-03 20:10:19 +02:00
margin-top: 0;
white-space: nowrap;
/* flex layout allows shrinking the <select> appropriately if it becomes too large */
display: inline-flex;
max-width: 100%;
/* make things look like in a line, despite the fact that we're using a layout
with boxes (i.e. from the flex layout) */
align-items: baseline;
}
Improve crate selection on rustdoc search results page Resolves all of issue #93240 Reproduces a similar change as #99086, but with improvements In particular, this PR inlcludes: * redesigning the crate-search selector so the background color matches its surroundings * decrease the font of the dropdown menu to a reaonable size * add a hover effect * make the color of the arrow theme-dependent, using a surrounding div, with :after pseudo-element that can then be transformed using CSS filters to approximate the desired color * fix the text "in" to match the title font * remove the "for xyz" in the "Results for xyz in [All crates]" title when searching for search term "xyz"; you can already see what you're searching for as it's typed in the search bar! * in line with #99086, handle super-long crate names appropriately without a long <select> element escaping the screen area; the improvement is that we also keep the title within a single line now; uses some flex layout shenanigans... * the margins / paddings are adjusted so the selected label of the <select> fits within the rest of that title nicely; also some inconsistency in the way that Firefox renders a <select> with "appearance: none" (roughly 4px more padding left and right of the text than e.g. Chrome) is worked around, and it now produces a result that looks (essentially) identical to Chrome * the color of the help menu and settings menu border in light theme is made to match with the color of the corresponding buttons, like they do (match) in the ayu theme * the casing of "All crates" changes to "all crates" * the new tests from #99086 are temporarily disabled, until they can be adapted later
2022-07-03 20:10:19 +02:00
#crate-search-div {
display: inline-block;
/* ensures that 100% in properties of #crate-search-div:after
are relative to the size of this div */
position: relative;
/* allows this div (and with it the <select>-element "#crate-search") to be shrunk */
min-width: 5em;
}
2018-10-01 00:47:54 +02:00
#crate-search {
min-width: 115px;
Improve crate selection on rustdoc search results page Resolves all of issue #93240 Reproduces a similar change as #99086, but with improvements In particular, this PR inlcludes: * redesigning the crate-search selector so the background color matches its surroundings * decrease the font of the dropdown menu to a reaonable size * add a hover effect * make the color of the arrow theme-dependent, using a surrounding div, with :after pseudo-element that can then be transformed using CSS filters to approximate the desired color * fix the text "in" to match the title font * remove the "for xyz" in the "Results for xyz in [All crates]" title when searching for search term "xyz"; you can already see what you're searching for as it's typed in the search bar! * in line with #99086, handle super-long crate names appropriately without a long <select> element escaping the screen area; the improvement is that we also keep the title within a single line now; uses some flex layout shenanigans... * the margins / paddings are adjusted so the selected label of the <select> fits within the rest of that title nicely; also some inconsistency in the way that Firefox renders a <select> with "appearance: none" (roughly 4px more padding left and right of the text than e.g. Chrome) is worked around, and it now produces a result that looks (essentially) identical to Chrome * the color of the help menu and settings menu border in light theme is made to match with the color of the corresponding buttons, like they do (match) in the ayu theme * the casing of "All crates" changes to "all crates" * the new tests from #99086 are temporarily disabled, until they can be adapted later
2022-07-03 20:10:19 +02:00
padding: 0;
/* keep these two in sync with "@-moz-document url-prefix()" below */
padding-left: 4px;
padding-right: 23px;
Improve crate selection on rustdoc search results page Resolves all of issue #93240 Reproduces a similar change as #99086, but with improvements In particular, this PR inlcludes: * redesigning the crate-search selector so the background color matches its surroundings * decrease the font of the dropdown menu to a reaonable size * add a hover effect * make the color of the arrow theme-dependent, using a surrounding div, with :after pseudo-element that can then be transformed using CSS filters to approximate the desired color * fix the text "in" to match the title font * remove the "for xyz" in the "Results for xyz in [All crates]" title when searching for search term "xyz"; you can already see what you're searching for as it's typed in the search bar! * in line with #99086, handle super-long crate names appropriately without a long <select> element escaping the screen area; the improvement is that we also keep the title within a single line now; uses some flex layout shenanigans... * the margins / paddings are adjusted so the selected label of the <select> fits within the rest of that title nicely; also some inconsistency in the way that Firefox renders a <select> with "appearance: none" (roughly 4px more padding left and right of the text than e.g. Chrome) is worked around, and it now produces a result that looks (essentially) identical to Chrome * the color of the help menu and settings menu border in light theme is made to match with the color of the corresponding buttons, like they do (match) in the ayu theme * the casing of "All crates" changes to "all crates" * the new tests from #99086 are temporarily disabled, until they can be adapted later
2022-07-03 20:10:19 +02:00
/* prevents the <select> from overflowing the containing div in case it's shrunk */
max-width: 100%;
/* contents can overflow because of max-width limit, then show ellipsis */
text-overflow: ellipsis;
border: 1px solid;
border-radius: 4px;
2018-10-01 00:47:54 +02:00
outline: none;
cursor: pointer;
-moz-appearance: none;
-webkit-appearance: none;
/* Removes default arrow from firefox */
Improve crate selection on rustdoc search results page Resolves all of issue #93240 Reproduces a similar change as #99086, but with improvements In particular, this PR inlcludes: * redesigning the crate-search selector so the background color matches its surroundings * decrease the font of the dropdown menu to a reaonable size * add a hover effect * make the color of the arrow theme-dependent, using a surrounding div, with :after pseudo-element that can then be transformed using CSS filters to approximate the desired color * fix the text "in" to match the title font * remove the "for xyz" in the "Results for xyz in [All crates]" title when searching for search term "xyz"; you can already see what you're searching for as it's typed in the search bar! * in line with #99086, handle super-long crate names appropriately without a long <select> element escaping the screen area; the improvement is that we also keep the title within a single line now; uses some flex layout shenanigans... * the margins / paddings are adjusted so the selected label of the <select> fits within the rest of that title nicely; also some inconsistency in the way that Firefox renders a <select> with "appearance: none" (roughly 4px more padding left and right of the text than e.g. Chrome) is worked around, and it now produces a result that looks (essentially) identical to Chrome * the color of the help menu and settings menu border in light theme is made to match with the color of the corresponding buttons, like they do (match) in the ayu theme * the casing of "All crates" changes to "all crates" * the new tests from #99086 are temporarily disabled, until they can be adapted later
2022-07-03 20:10:19 +02:00
text-indent: 0.01px;
background-color: var(--main-background-color);
}
/* cancel stylistic differences in padding
in firefox for "appearance: none" <select>s */
@-moz-document url-prefix() {
#crate-search {
padding-left: 0px; /* == 4px - 4px */
padding-right: 19px; /* == 23px - 4px */
}
}
/* pseudo-element for holding the dropdown-arrow image; needs to be a separate thing
so that we can apply CSS-filters to change the arrow color in themes */
#crate-search-div::after {
/* lets clicks through! */
pointer-events: none;
/* completely covers the underlying div */
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
content: "";
2018-11-29 01:29:49 +01:00
background-repeat: no-repeat;
2018-12-08 16:35:51 +01:00
background-size: 20px;
Improve crate selection on rustdoc search results page Resolves all of issue #93240 Reproduces a similar change as #99086, but with improvements In particular, this PR inlcludes: * redesigning the crate-search selector so the background color matches its surroundings * decrease the font of the dropdown menu to a reaonable size * add a hover effect * make the color of the arrow theme-dependent, using a surrounding div, with :after pseudo-element that can then be transformed using CSS filters to approximate the desired color * fix the text "in" to match the title font * remove the "for xyz" in the "Results for xyz in [All crates]" title when searching for search term "xyz"; you can already see what you're searching for as it's typed in the search bar! * in line with #99086, handle super-long crate names appropriately without a long <select> element escaping the screen area; the improvement is that we also keep the title within a single line now; uses some flex layout shenanigans... * the margins / paddings are adjusted so the selected label of the <select> fits within the rest of that title nicely; also some inconsistency in the way that Firefox renders a <select> with "appearance: none" (roughly 4px more padding left and right of the text than e.g. Chrome) is worked around, and it now produces a result that looks (essentially) identical to Chrome * the color of the help menu and settings menu border in light theme is made to match with the color of the corresponding buttons, like they do (match) in the ayu theme * the casing of "All crates" changes to "all crates" * the new tests from #99086 are temporarily disabled, until they can be adapted later
2022-07-03 20:10:19 +02:00
background-position: calc(100% - 2px) 56%;
/* image is black color, themes should apply a "filter" property to change the color */
background-image: /* AUTOREPLACE: */url("down-arrow.svg");
Improve crate selection on rustdoc search results page Resolves all of issue #93240 Reproduces a similar change as #99086, but with improvements In particular, this PR inlcludes: * redesigning the crate-search selector so the background color matches its surroundings * decrease the font of the dropdown menu to a reaonable size * add a hover effect * make the color of the arrow theme-dependent, using a surrounding div, with :after pseudo-element that can then be transformed using CSS filters to approximate the desired color * fix the text "in" to match the title font * remove the "for xyz" in the "Results for xyz in [All crates]" title when searching for search term "xyz"; you can already see what you're searching for as it's typed in the search bar! * in line with #99086, handle super-long crate names appropriately without a long <select> element escaping the screen area; the improvement is that we also keep the title within a single line now; uses some flex layout shenanigans... * the margins / paddings are adjusted so the selected label of the <select> fits within the rest of that title nicely; also some inconsistency in the way that Firefox renders a <select> with "appearance: none" (roughly 4px more padding left and right of the text than e.g. Chrome) is worked around, and it now produces a result that looks (essentially) identical to Chrome * the color of the help menu and settings menu border in light theme is made to match with the color of the corresponding buttons, like they do (match) in the ayu theme * the casing of "All crates" changes to "all crates" * the new tests from #99086 are temporarily disabled, until they can be adapted later
2022-07-03 20:10:19 +02:00
}
#crate-search > option {
font-size: 1rem;
2018-10-01 00:47:54 +02:00
}
2022-01-20 14:18:59 +01:00
.search-container {
margin-top: 4px;
2018-04-13 22:54:09 +02:00
}
.search-input {
/* Override Normalize.css: it has a rule that sets
-webkit-appearance: textfield for search inputs. That
causes rounded corners and no border on iOS Safari. */
-webkit-appearance: none;
/* Override Normalize.css: we have margins and do
not want to overflow - the `moz` attribute is necessary
until Firefox 29, too early to drop at this point */
-moz-box-sizing: border-box !important;
box-sizing: border-box !important;
outline: none;
2022-01-20 14:18:59 +01:00
border: 1px solid;
border-radius: 2px;
padding: 8px;
font-size: 1rem;
width: 100%;
}
2021-05-09 12:56:21 -07:00
.search-results {
display: none;
padding-bottom: 2em;
}
.search-results.active {
display: block;
2021-05-21 23:11:06 +02:00
/* prevent overhanging tabs from moving the first result */
clear: both;
2021-05-09 12:56:21 -07:00
}
.search-results .desc > span {
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
display: block;
}
2021-05-21 16:39:03 +02:00
.search-results > a {
2021-05-21 23:11:06 +02:00
display: block;
width: 100%;
2021-05-09 12:56:21 -07:00
/* A little margin ensures the browser's outlining of focused links has room to display. */
margin-left: 2px;
margin-right: 2px;
2021-05-21 23:11:06 +02:00
border-bottom: 1px solid #aaa3;
}
2021-05-21 16:39:03 +02:00
.search-results > a > div {
display: flex;
2021-05-21 23:11:06 +02:00
flex-flow: row wrap;
}
.search-results .result-name, .search-results div.desc, .search-results .result-description {
width: 50%;
2021-05-21 16:39:03 +02:00
}
2021-05-21 23:54:49 +02:00
.search-results .result-name {
2021-05-21 23:11:06 +02:00
padding-right: 1em;
2021-05-21 16:39:03 +02:00
}
2021-05-21 23:54:49 +02:00
.search-results .result-name > span {
2021-05-21 16:39:03 +02:00
display: inline-block;
2021-06-05 23:03:54 +02:00
margin: 0;
font-weight: normal;
2018-03-27 10:33:31 +02:00
}
.popover {
font-size: 1rem;
position: absolute;
right: 0;
z-index: 2;
display: block;
margin-top: 7px;
border-radius: 3px;
border: 1px solid;
font-size: 1rem;
}
/* This rule is to draw the little arrow connecting the settings menu to the gear icon. */
.popover::before {
content: '';
position: absolute;
right: 11px;
border: solid;
border-width: 1px 1px 0 0;
display: inline-block;
padding: 4px;
transform: rotate(-45deg);
top: -5px;
}
.popover, .popover::before {
background-color: var(--main-background-color);
color: var(--main-color);
}
#help-button .popover {
max-width: 600px;
}
#help-button .popover::before {
right: 48px;
}
#help-button dt {
float: left;
clear: left;
display: block;
margin-right: 0.5rem;
}
#help-button span.top, #help-button span.bottom {
text-align: center;
display: block;
font-size: 1.125rem;
}
#help-button span.top {
text-align: center;
display: block;
margin: 10px 0;
border-bottom: 1px solid;
padding-bottom: 4px;
margin-bottom: 6px;
}
#help-button span.bottom {
clear: both;
border-top: 1px solid;
}
.side-by-side {
text-align: initial;
}
.side-by-side > div {
width: 50%;
float: left;
padding: 0 20px 20px 17px;
}
2021-07-18 12:25:49 +02:00
.item-info .stab {
width: fit-content;
/* This min-height is needed to unify the height of the stab elements because some of them
have emojis.
*/
min-height: 36px;
display: flex;
align-items: center;
white-space: pre-wrap;
2021-07-18 12:25:49 +02:00
}
.stab {
padding: 3px;
margin-bottom: 5px;
font-size: 0.875rem;
font-weight: normal;
}
.stab p {
display: inline;
margin: 0;
}
.stab .emoji {
font-size: 1.25rem;
}
/* Black one-pixel outline around emoji shapes */
.emoji {
text-shadow:
1px 0 0 black,
-1px 0 0 black,
0 1px 0 black,
0 -1px 0 black;
}
2021-04-13 17:23:27 +02:00
.module-item .stab,
.import-item .stab {
border-radius: 3px;
display: inline-block;
font-size: 0.875rem;
line-height: 1.2;
margin-bottom: 0;
margin-left: 0.3125em;
padding: 2px;
vertical-align: text-bottom;
}
2021-04-13 17:23:27 +02:00
.module-item.unstable,
.import-item.unstable {
opacity: 0.65;
}
.since {
font-weight: normal;
font-size: initial;
}
.rightside {
padding-left: 12px;
padding-right: 2px;
position: initial;
}
.impl-items .srclink, .impl .srclink, .methods .srclink {
/* Override header settings otherwise it's too bold */
font-weight: normal;
font-size: 1rem;
}
.rightside {
float: right;
}
.variants_table {
width: 100%;
}
.variants_table tbody tr td:first-child {
width: 1%; /* make the variant name as small as possible */
}
td.summary-column {
width: 100%;
}
.summary {
padding-right: 0px;
}
pre.rust .question-mark {
font-weight: bold;
}
a.test-arrow {
display: inline-block;
visibility: hidden;
position: absolute;
padding: 5px 10px 5px 10px;
border-radius: 5px;
font-size: 1.375rem;
top: 5px;
right: 5px;
z-index: 1;
}
.example-wrap:hover .test-arrow {
visibility: visible;
}
a.test-arrow:hover{
text-decoration: none;
}
2021-04-17 18:08:50 -07:00
.code-attribute {
font-weight: 300;
}
2017-07-09 00:40:29 +02:00
.item-spacer {
width: 100%;
height: 12px;
}
.out-of-band > span.since {
position: initial;
font-size: 1.25rem;
2016-05-10 21:01:10 +02:00
}
h3.variant {
font-weight: 600;
font-size: 1.125rem;
margin-bottom: 10px;
border-bottom: none;
2018-10-19 01:34:46 +02:00
}
.sub-variant h4 {
font-size: 1rem;
font-weight: 400;
border-bottom: none;
margin-top: 0;
margin-bottom: 0;
2018-10-19 01:34:46 +02:00
}
.sub-variant {
margin-left: 24px;
margin-bottom: 40px;
2018-10-19 01:34:46 +02:00
}
.sub-variant > .sub-variant-field {
margin-left: 24px;
}
.toggle-label {
display: inline-block;
margin-left: 4px;
margin-top: 3px;
}
:target > code, :target > .code-header {
2017-03-09 19:02:59 +01:00
opacity: 1;
2016-05-16 22:36:13 +02:00
}
:target {
padding-right: 3px;
}
2017-09-09 15:33:57 +02:00
.information {
position: absolute;
left: -25px;
2017-09-09 15:33:57 +02:00
margin-top: 7px;
2017-09-18 12:51:48 +02:00
z-index: 1;
2017-09-09 15:33:57 +02:00
}
.tooltip {
position: relative;
display: inline-block;
cursor: pointer;
}
.tooltip::after {
2017-09-09 15:33:57 +02:00
display: none;
text-align: center;
padding: 5px 3px 3px 3px;
2017-09-09 15:33:57 +02:00
border-radius: 6px;
margin-left: 5px;
font-size: 1rem;
2017-09-09 15:33:57 +02:00
}
.tooltip.ignore::after {
content: "This example is not tested";
}
.tooltip.compile_fail::after {
content: "This example deliberately fails to compile";
}
.tooltip.should_panic::after {
content: "This example panics";
}
.tooltip.edition::after {
content: "This code runs with edition " attr(data-edition);
}
.tooltip::before {
2017-09-09 15:33:57 +02:00
content: " ";
position: absolute;
top: 50%;
left: 16px;
2017-09-09 15:33:57 +02:00
margin-top: -5px;
border-width: 5px;
border-style: solid;
display: none;
2017-09-09 15:33:57 +02:00
}
2017-09-18 12:51:48 +02:00
.tooltip:hover::before, .tooltip:hover::after {
2020-10-07 11:31:15 +02:00
display: inline;
}
.tooltip.compile_fail, .tooltip.should_panic, .tooltip.ignore {
font-weight: bold;
font-size: 1.25rem;
}
.notable-traits-tooltip {
display: inline-block;
cursor: pointer;
}
.notable-traits:hover .notable-traits-tooltiptext,
.notable-traits .notable-traits-tooltiptext.force-tooltip {
display: inline-block;
}
.notable-traits .notable-traits-tooltiptext {
display: none;
padding: 5px 3px 3px 3px;
border-radius: 6px;
margin-left: 5px;
z-index: 10;
font-size: 1rem;
cursor: default;
position: absolute;
border: 1px solid;
}
.notable-traits-tooltip::after {
/* The margin on the tooltip does not capture hover events,
this extends the area of hover enough so that mouse hover is not
lost when moving the mouse to the tooltip */
2020-07-15 17:20:46 +02:00
content: "\00a0\00a0\00a0";
}
.notable-traits .notable, .notable-traits .docblock {
margin: 0;
}
2021-06-02 21:16:33 +02:00
.notable-traits .notable {
margin: 0;
margin-bottom: 13px;
font-size: 1.1875rem;
2021-06-02 21:16:33 +02:00
font-weight: 600;
display: block;
2021-06-02 21:16:33 +02:00
}
.notable-traits .docblock code.content{
2020-07-15 17:20:46 +02:00
margin: 0;
padding: 0;
font-size: 1.25rem;
}
2020-07-15 17:20:46 +02:00
/* Example code has the "Run" button that needs to be positioned relative to the pre */
pre.rust.rust-example-rendered {
2017-09-18 12:51:48 +02:00
position: relative;
}
pre.rust {
2020-03-28 11:49:12 +01:00
tab-size: 4;
-moz-tab-size: 4;
2017-09-18 12:51:48 +02:00
}
.search-failed {
text-align: center;
margin-top: 20px;
2021-05-09 12:56:21 -07:00
display: none;
}
.search-failed.active {
display: block;
}
.search-failed > ul {
text-align: left;
max-width: 570px;
margin-left: auto;
margin-right: auto;
}
#titles {
height: 35px;
}
#titles > button {
float: left;
width: 33.3%;
text-align: center;
font-size: 1.125rem;
cursor: pointer;
border: 0;
2018-10-16 19:07:41 +02:00
border-top: 2px solid;
}
#titles > button:first-child:last-child {
margin-right: 1px;
width: calc(100% - 1px);
}
#titles > button:not(:last-child) {
2018-10-16 19:07:41 +02:00
margin-right: 1px;
width: calc(33.3% - 1px);
}
2017-11-02 01:01:51 +01:00
#titles > button > div.count {
2017-11-02 01:01:51 +01:00
display: inline-block;
font-size: 1rem;
2017-11-02 01:01:51 +01:00
}
2017-11-15 20:04:02 +01:00
.notable-traits {
cursor: pointer;
z-index: 2;
2020-07-06 14:13:47 -07:00
margin-left: 5px;
}
#sidebar-toggle {
2021-10-24 21:59:53 +02:00
position: sticky;
top: 0;
left: 0;
font-weight: bold;
font-size: 1.25rem;
2021-10-24 21:59:53 +02:00
border-bottom: 1px solid;
display: flex;
height: 40px;
justify-content: center;
align-items: center;
z-index: 10;
}
#source-sidebar {
2021-12-14 11:48:30 +01:00
width: 100%;
z-index: 1;
overflow: auto;
}
#source-sidebar > .title {
font-size: 1.5rem;
text-align: center;
border-bottom: 1px solid;
margin-bottom: 6px;
}
#sidebar-toggle > button {
background: none;
color: inherit;
cursor: pointer;
text-align: center;
border: none;
outline: none;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
/* work around button layout strangeness: https://stackoverflow.com/q/7271561 */
width: 100%;
/* iOS button gradient: https://stackoverflow.com/q/5438567 */
-webkit-appearance: none;
opacity: 1;
}
#settings-menu, #help-button {
2022-01-20 14:18:59 +01:00
margin-left: 4px;
2019-04-29 23:43:39 +02:00
outline: none;
}
2022-05-11 23:11:18 +02:00
#copy-path {
2022-01-20 14:18:59 +01:00
height: 34px;
}
#settings-menu > a, #help-button > button, #copy-path {
2022-01-20 14:18:59 +01:00
padding: 5px;
width: 33px;
border: 1px solid;
2022-01-20 14:18:59 +01:00
border-radius: 2px;
cursor: pointer;
}
2022-05-10 16:09:41 +02:00
#settings-menu {
padding: 0;
}
#settings-menu > a, #help-button > button {
2022-05-10 16:09:41 +02:00
padding: 5px;
height: 100%;
display: block;
}
@keyframes rotating {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
2022-05-11 23:11:18 +02:00
#settings-menu.rotate > a img {
animation: rotating 2s linear infinite;
}
.setting-line .radio-line input:checked {
box-shadow: inset 0 0 0 3px var(--main-background-color);
background-color: var(--settings-input-color);
}
.setting-line .radio-line input:focus {
box-shadow: 0 0 1px 1px var(--settings-input-color);
}
/* In here we combine both `:focus` and `:checked` properties. */
.setting-line .radio-line input:checked:focus {
box-shadow: inset 0 0 0 3px var(--main-background-color),
0 0 2px 2px var(--settings-input-color);
}
.setting-line .radio-line input:hover {
border-color: var(--settings-input-color) !important;
}
input:checked + .slider {
background-color: var(--settings-input-color);
}
#help-button > button {
2020-08-10 16:42:11 +02:00
text-align: center;
/* Rare exception to specifying font sizes in rem. Since this is acting
as an icon, it's okay to specify their sizes in pixels. */
2022-01-20 14:18:59 +01:00
font-size: 20px;
padding-top: 2px;
2020-08-10 16:42:11 +02:00
}
#copy-path {
background: initial;
margin-left: 10px;
padding: 0;
padding-left: 2px;
border: 0;
2019-04-29 23:43:39 +02:00
}
#theme-choices {
display: none;
position: absolute;
left: 0;
top: 28px;
border: 1px solid;
border-radius: 3px;
z-index: 1;
cursor: pointer;
}
#theme-choices > button {
border: none;
width: 100%;
2020-08-24 22:32:59 +08:00
padding: 4px 8px;
2019-04-29 23:43:39 +02:00
text-align: center;
background: rgba(0,0,0,0);
overflow-wrap: normal;
2019-04-29 23:43:39 +02:00
}
#theme-choices > button:not(:first-child) {
border-top: 1px solid;
}
kbd {
display: inline-block;
padding: 3px 5px;
font: 15px monospace;
line-height: 10px;
vertical-align: middle;
border: solid 1px;
border-radius: 3px;
cursor: default;
}
.hidden-by-impl-hider,
.hidden-by-usual-hider {
/* important because of conflicting rule for small screens */
display: none !important;
}
#implementations-list > h3 > span.in-band {
width: 100%;
}
.table-display {
width: 100%;
border: 0;
border-collapse: collapse;
border-spacing: 0;
font-size: 1rem;
}
.table-display tr td:first-child {
padding-right: 0;
}
.table-display tr td:last-child {
float: right;
}
.table-display .out-of-band {
position: relative;
font-size: 1.125rem;
display: block;
}
.table-display td:hover .anchor {
display: block;
top: 2px;
left: -5px;
}
2021-11-29 17:14:05 +01:00
#main-content > ul {
padding-left: 10px;
}
2021-11-29 17:14:05 +01:00
#main-content > ul > li {
list-style: none;
}
.non-exhaustive {
margin-bottom: 1em;
}
details.dir-entry {
padding-left: 4px;
}
details.dir-entry > summary {
margin: 0 0 0 13px;
list-style-position: outside;
cursor: pointer;
}
details.dir-entry div.folders, details.dir-entry div.files {
padding-left: 23px;
}
details.dir-entry a {
display: block;
}
/* The hideme class is used on summary tags that contain a span with
placeholder text shown only when the toggle is closed. For instance,
"Expand description" or "Show methods". */
details.rustdoc-toggle > summary.hideme {
cursor: pointer;
}
details.rustdoc-toggle > summary {
list-style: none;
}
details.rustdoc-toggle > summary::-webkit-details-marker,
details.rustdoc-toggle > summary::marker {
display: none;
}
details.rustdoc-toggle > summary.hideme > span {
margin-left: 9px;
}
details.rustdoc-toggle > summary::before {
content: "";
cursor: pointer;
width: 16px;
height: 16px;
2021-07-31 16:23:51 +02:00
background-repeat: no-repeat;
background-position: top left;
display: inline-block;
vertical-align: middle;
opacity: .5;
}
/* Screen readers see the text version at the end the line.
Visual readers see the icon at the start of the line, but small and transparent. */
details.rustdoc-toggle > summary::after {
content: "Expand";
overflow: hidden;
width: 0;
height: 0;
position: absolute;
}
details.rustdoc-toggle > summary.hideme::after {
/* "hideme" toggles already have a description when they're contracted */
content: "";
}
details.rustdoc-toggle > summary:focus::before,
details.rustdoc-toggle > summary:hover::before {
opacity: 1;
}
details.rustdoc-toggle.top-doc > summary,
details.rustdoc-toggle.top-doc > summary::before,
details.rustdoc-toggle.non-exhaustive > summary,
details.rustdoc-toggle.non-exhaustive > summary::before {
font-size: 1rem;
}
details.non-exhaustive {
margin-bottom: 8px;
}
details.rustdoc-toggle > summary.hideme::before {
position: relative;
}
details.rustdoc-toggle > summary:not(.hideme)::before {
position: absolute;
left: -24px;
top: 4px;
}
.impl-items > details.rustdoc-toggle > summary:not(.hideme)::before {
position: absolute;
left: -24px;
}
/* When a "hideme" summary is open and the "Expand description" or "Show
methods" text is hidden, we want the [-] toggle that remains to not
affect the layout of the items to its right. To do that, we use
absolute positioning. Note that we also set position: relative
on the parent <details> to make this work properly. */
details.rustdoc-toggle[open] > summary.hideme {
position: absolute;
}
details.rustdoc-toggle {
position: relative;
}
details.rustdoc-toggle[open] > summary.hideme > span {
display: none;
}
details.rustdoc-toggle[open] > summary::before,
details.rustdoc-toggle[open] > summary.hideme::before {
background-image: /* AUTOREPLACE: */url("toggle-minus.svg");
}
2022-07-14 14:59:25 +02:00
details.rustdoc-toggle > summary::before {
background-image: /* AUTOREPLACE: */url("toggle-plus.svg");
}
details.rustdoc-toggle[open] > summary::before,
details.rustdoc-toggle[open] > summary.hideme::before {
width: 16px;
height: 16px;
2021-07-31 16:23:51 +02:00
background-repeat: no-repeat;
background-position: top left;
display: inline-block;
content: "";
}
details.rustdoc-toggle[open] > summary::after,
details.rustdoc-toggle[open] > summary.hideme::after {
content: "Collapse";
}
/* This is needed in docblocks to have the "▶" element to be on the same line. */
.docblock summary > * {
display: inline-block;
}
/* Media Queries */
/*
WARNING: RUSTDOC_MOBILE_BREAKPOINT MEDIA QUERY;
If you update this line, then you also need to update the line with the same warning
in storage.js plus the media query with (max-width: 700px)
*/
@media (min-width: 701px) {
/* In case there is no documentation before a code block, we need to add some margin at the top
to prevent an overlay between the "collapse toggle" and the information tooltip.
2021-03-09 21:14:43 +01:00
However, it's not needed with smaller screen width because the doc/code block is always put
"one line" below. */
2021-03-22 22:17:21 +01:00
.docblock > .information:first-child > .tooltip {
margin-top: 16px;
}
2021-11-29 15:55:05 +01:00
/* When we expand the sidebar on the source code page, we hide the logo on the left of the
search bar to have more space. */
.source-sidebar-expanded .source .sidebar + main .width-limiter .sub-logo-container.rust-logo {
2021-11-29 15:55:05 +01:00
display: none;
}
.source-sidebar-expanded .source .sidebar {
2021-12-14 11:48:30 +01:00
width: 300px;
}
}
/*
WARNING: RUSTDOC_MOBILE_BREAKPOINT MEDIA QUERY
If you update this line, then you also need to update the line with the same warning
in storage.js plus the media query with (min-width: 701px)
*/
@media (max-width: 700px) {
/* When linking to an item with an `id` (for instance, by clicking a link in the sidebar,
or visiting a URL with a fragment like `#method.new`, we don't want the item to be obscured
by the topbar. Anything with an `id` gets scroll-margin-top equal to .mobile-topbar's size.
*/
*[id] {
scroll-margin-top: 45px;
}
.rustdoc {
padding-top: 0px;
/* Sidebar should overlay main content, rather than pushing main content to the right.
Turn off `display: flex` on the body element. */
display: block;
}
main {
padding-left: 15px;
padding-top: 0px;
}
.rustdoc,
.main-heading {
flex-direction: column;
}
.content .out-of-band {
text-align: left;
margin-left: initial;
padding: initial;
}
.content .out-of-band .since::before {
content: "Since ";
}
#copy-path {
display: none;
}
/* Hide the logo and item name from the sidebar. Those are displayed
in the mobile-topbar instead. */
.sidebar .sidebar-logo,
.sidebar .location {
display: none;
}
.sidebar-elems {
margin-top: 1em;
}
.sidebar {
position: fixed;
top: 45px;
/* Hide the sidebar offscreen while not in use. Doing this instead of display: none means
the sidebar stays visible for screen readers, which is useful for navigation. */
left: -1000px;
margin-left: 0;
margin: 0;
padding: 0;
z-index: 11;
/* Reduce height slightly to account for mobile topbar. */
height: calc(100vh - 45px);
}
/* The source view uses a different design for the sidebar toggle, and doesn't have a topbar,
so don't bump down the main content or the sidebar. */
.source main,
.rustdoc.source .sidebar {
top: 0;
padding: 0;
height: 100vh;
border: 0;
}
.sidebar.shown,
.source-sidebar-expanded .source .sidebar,
.sidebar:focus-within {
left: 0;
}
.rustdoc.source > .sidebar {
position: fixed;
margin: 0;
z-index: 11;
width: 0;
}
.mobile-topbar .location a {
padding: 0;
margin: 0;
}
.mobile-topbar .location {
border: none;
padding: 0;
margin: auto 0.5em auto auto;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
/* Rare exception to specifying font sizes in rem. Since the topbar
height is specified in pixels, this also has to be specified in
pixels to avoid overflowing the topbar when the user sets a bigger
font size. */
font-size: 24px;
}
.mobile-topbar .logo-container {
max-height: 45px;
}
.mobile-topbar .logo-container > img {
2019-04-29 11:45:06 +02:00
max-width: 35px;
max-height: 35px;
margin-left: 20px;
margin-top: 5px;
margin-bottom: 5px;
2019-04-29 11:45:06 +02:00
}
.mobile-topbar {
display: flex;
flex-direction: row;
position: sticky;
z-index: 10;
font-size: 2rem;
height: 45px;
width: 100%;
left: 0;
2021-11-29 15:55:05 +01:00
top: 0;
}
.source .mobile-topbar {
display: none;
}
.sidebar-menu-toggle {
width: 45px;
/* Rare exception to specifying font sizes in rem. Since this is acting
as an icon, it's okay to specify its sizes in pixels. */
font-size: 32px;
border: none;
}
.sidebar-elems {
background-color: var(--sidebar-background-color);
}
2021-10-10 00:52:14 +02:00
.source nav:not(.sidebar).sub {
margin-left: 32px;
}
.content {
margin-left: 0px;
}
2021-10-10 00:52:14 +02:00
.source .content {
margin-top: 10px;
}
#search {
margin-left: 0;
padding: 0;
}
.anchor {
display: none !important;
}
2018-10-06 18:51:56 +02:00
2021-06-01 21:43:09 -07:00
.notable-traits {
position: absolute;
left: -22px;
top: 24px;
}
#titles > button > div.count {
2017-12-18 21:27:19 +01:00
float: left;
width: 100%;
}
#titles {
height: 50px;
}
2017-12-20 00:44:44 +01:00
/* Because of ios, we need to actually have a full height sidebar title so the
* actual sidebar can show up. But then we need to make it transparent so we don't
* hide content. The filler just allows to create the background for the sidebar
* title. But because of the absolute position, I had to lower the z-index.
*/
#sidebar-filler {
position: fixed;
left: 45px;
width: calc(100% - 45px);
top: 0;
height: 45px;
z-index: -1;
border-bottom: 1px solid;
}
2021-11-29 17:14:05 +01:00
#main-content > details.rustdoc-toggle > summary::before,
#main-content > div > details.rustdoc-toggle > summary::before {
left: -11px;
}
#sidebar-toggle {
2021-10-24 21:59:53 +02:00
position: fixed;
left: 1px;
top: 100px;
width: 30px;
font-size: 1.5rem;
text-align: center;
padding: 0;
2021-10-24 21:59:53 +02:00
z-index: 10;
border-top-right-radius: 3px;
border-bottom-right-radius: 3px;
cursor: pointer;
font-weight: bold;
border: 1px solid;
border-left: 0;
}
.source-sidebar-expanded #sidebar-toggle {
left: unset;
top: unset;
width: unset;
border-top-right-radius: unset;
border-bottom-right-radius: unset;
position: sticky;
border: 0;
border-bottom: 1px solid;
}
#source-sidebar {
z-index: 11;
}
2019-04-29 23:43:39 +02:00
2021-11-29 17:14:05 +01:00
#main-content > .line-numbers {
2019-04-29 23:43:39 +02:00
margin-top: 0;
}
.notable-traits .notable-traits-tooltiptext {
left: 0;
top: 100%;
}
2020-10-15 17:28:42 +02:00
/* We don't display the help button on mobile devices. */
#help-button {
2020-10-15 17:28:42 +02:00
display: none;
}
/* Display an alternating layout on tablets and phones */
.item-table {
display: block;
}
.item-row {
display: flex;
flex-flow: column wrap;
}
.item-left, .item-right {
width: 100%;
}
2021-05-21 23:11:06 +02:00
/* Display an alternating layout on tablets and phones */
.search-results > a {
border-bottom: 1px solid #aaa9;
padding: 5px 0px;
2021-05-21 23:11:06 +02:00
}
.search-results .result-name, .search-results div.desc, .search-results .result-description {
2021-05-21 23:11:06 +02:00
width: 100%;
}
.search-results div.desc, .search-results .result-description, .item-right {
2021-05-21 23:11:06 +02:00
padding-left: 2em;
}
2021-12-14 11:48:30 +01:00
.source-sidebar-expanded .source .sidebar {
2021-12-14 11:48:30 +01:00
max-width: 100vw;
width: 100vw;
}
2021-12-29 18:54:33 +01:00
/* Position of the "[-]" element. */
details.rustdoc-toggle:not(.top-doc) > summary {
margin-left: 10px;
}
.impl-items > details.rustdoc-toggle > summary:not(.hideme)::before,
#main-content > details.rustdoc-toggle:not(.top-doc) > summary::before,
#main-content > div > details.rustdoc-toggle > summary::before {
left: -11px;
}
2017-12-18 21:27:19 +01:00
}
2019-04-29 23:43:39 +02:00
@media print {
nav.sidebar, nav.sub, .content .out-of-band, a.srclink, #copy-path,
2022-07-08 01:54:55 -04:00
details.rustdoc-toggle[open] > summary::before, details.rustdoc-toggle > summary::before,
details.rustdoc-toggle.top-doc > summary {
2019-04-29 23:43:39 +02:00
display: none;
}
2022-07-08 01:54:55 -04:00
.docblock {
margin-left: 0;
}
main {
padding: 10px;
2022-07-08 01:54:55 -04:00
}
2019-04-29 23:43:39 +02:00
}
2017-12-18 21:27:19 +01:00
2021-01-31 13:42:16 +01:00
@media (max-width: 464px) {
#titles, #titles > button {
2017-12-18 21:27:19 +01:00
height: 73px;
}
2021-11-29 17:14:05 +01:00
#main-content > table:not(.table-display) td {
word-break: break-word;
2020-12-11 18:02:23 +01:00
width: 50%;
}
#crate-search {
border-radius: 4px;
}
.docblock {
margin-left: 12px;
}
.docblock code {
overflow-wrap: break-word;
overflow-wrap: anywhere;
}
2021-10-24 22:41:48 +02:00
.sub-container {
flex-direction: column;
}
.sub-logo-container {
align-self: center;
}
.source .sub-logo-container > img {
height: 35px;
width: 35px;
}
2021-11-29 15:55:05 +01:00
#sidebar-toggle {
2021-11-29 15:55:05 +01:00
top: 10px;
}
.source-sidebar-expanded #sidebar-toggle {
top: unset;
}
}
.method-toggle summary,
.implementors-toggle summary,
.impl {
margin-bottom: 0.75em;
}
.method-toggle[open] {
margin-bottom: 2em;
}
.implementors-toggle[open] {
margin-bottom: 2em;
}
#trait-implementations-list .method-toggle,
#synthetic-implementations-list .method-toggle,
#blanket-implementations-list .method-toggle {
margin-bottom: 1em;
}
/* Begin: styles for --scrape-examples feature */
2022-02-14 19:49:39 -08:00
.scraped-example-list .scrape-help {
margin-left: 10px;
padding: 0 4px;
font-weight: normal;
font-size: 12px;
position: relative;
bottom: 1px;
background: transparent;
border-width: 1px;
border-style: solid;
border-radius: 50px;
}
.scraped-example .code-wrapper {
position: relative;
display: flex;
flex-direction: row;
flex-wrap: wrap;
width: 100%;
}
.scraped-example:not(.expanded) .code-wrapper {
max-height: 240px;
}
.scraped-example:not(.expanded) .code-wrapper pre {
overflow-y: hidden;
max-height: 240px;
padding-bottom: 0;
}
.scraped-example:not(.expanded) .code-wrapper pre.line-numbers {
overflow-x: hidden;
}
.scraped-example .code-wrapper .prev {
position: absolute;
top: 0.25em;
right: 2.25em;
z-index: 100;
cursor: pointer;
}
.scraped-example .code-wrapper .next {
position: absolute;
top: 0.25em;
right: 1.25em;
z-index: 100;
cursor: pointer;
}
.scraped-example .code-wrapper .expand {
position: absolute;
top: 0.25em;
right: 0.25em;
z-index: 100;
cursor: pointer;
}
.scraped-example:not(.expanded) .code-wrapper:before {
content: " ";
width: 100%;
height: 5px;
position: absolute;
z-index: 100;
top: 0;
}
.scraped-example:not(.expanded) .code-wrapper:after {
content: " ";
width: 100%;
height: 5px;
position: absolute;
z-index: 100;
bottom: 0;
}
.scraped-example .code-wrapper .line-numbers {
margin: 0;
padding: 14px 0;
}
.scraped-example .code-wrapper .line-numbers span {
padding: 0 14px;
}
.scraped-example .code-wrapper .example-wrap {
flex: 1;
overflow-x: auto;
overflow-y: hidden;
margin-bottom: 0;
}
.scraped-example:not(.expanded) .code-wrapper .example-wrap {
overflow-x: hidden;
}
.scraped-example .code-wrapper .example-wrap pre.rust {
overflow-x: inherit;
width: inherit;
overflow-y: hidden;
}
.more-examples-toggle {
max-width: calc(100% + 25px);
margin-top: 10px;
margin-left: -25px;
}
.more-examples-toggle .hide-more {
margin-left: 25px;
margin-bottom: 5px;
cursor: pointer;
}
.more-scraped-examples {
margin-left: 5px;
display: flex;
flex-direction: row;
}
.more-scraped-examples-inner {
/* 20px is width of toggle-line + toggle-line-inner */
width: calc(100% - 20px);
}
.toggle-line {
align-self: stretch;
margin-right: 10px;
margin-top: 5px;
padding: 0 4px;
cursor: pointer;
}
.toggle-line-inner {
min-width: 2px;
height: 100%;
}
.more-scraped-examples .scraped-example {
margin-bottom: 20px;
}
.more-scraped-examples .scraped-example:last-child {
margin-bottom: 0;
}
.example-links a {
margin-top: 20px;
}
.example-links ul {
margin-bottom: 0;
}
/* End: styles for --scrape-examples feature */