From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- src/librustdoc/html/static/css/normalize.css | 2 + src/librustdoc/html/static/css/noscript.css | 20 + src/librustdoc/html/static/css/rustdoc.css | 2335 +++++++++++++++++++++++ src/librustdoc/html/static/css/settings.css | 90 + src/librustdoc/html/static/css/themes/ayu.css | 563 ++++++ src/librustdoc/html/static/css/themes/dark.css | 409 ++++ src/librustdoc/html/static/css/themes/light.css | 395 ++++ 7 files changed, 3814 insertions(+) create mode 100644 src/librustdoc/html/static/css/normalize.css create mode 100644 src/librustdoc/html/static/css/noscript.css create mode 100644 src/librustdoc/html/static/css/rustdoc.css create mode 100644 src/librustdoc/html/static/css/settings.css create mode 100644 src/librustdoc/html/static/css/themes/ayu.css create mode 100644 src/librustdoc/html/static/css/themes/dark.css create mode 100644 src/librustdoc/html/static/css/themes/light.css (limited to 'src/librustdoc/html/static/css') diff --git a/src/librustdoc/html/static/css/normalize.css b/src/librustdoc/html/static/css/normalize.css new file mode 100644 index 000000000..fdb8a8c65 --- /dev/null +++ b/src/librustdoc/html/static/css/normalize.css @@ -0,0 +1,2 @@ +/* ignore-tidy-linelength */ +/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */ html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace, monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type="button"],[type="reset"],[type="submit"],button{-webkit-appearance:button}[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px}[type="search"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none} diff --git a/src/librustdoc/html/static/css/noscript.css b/src/librustdoc/html/static/css/noscript.css new file mode 100644 index 000000000..0a19a99ab --- /dev/null +++ b/src/librustdoc/html/static/css/noscript.css @@ -0,0 +1,20 @@ +/* +This whole CSS file is used only in case rustdoc is rendered with javascript disabled. Since a lot +of content is hidden by default (depending on the settings too), we have to overwrite some of the +rules. +*/ + +#main-content .attributes { + /* Since there is no toggle (the "[-]") when JS is disabled, no need for this margin either. */ + margin-left: 0 !important; +} + +#copy-path { + /* It requires JS to work so no need to display it in this case. */ + display: none; +} + +.sub { + /* The search bar and related controls don't work without JS */ + display: none; +} diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css new file mode 100644 index 000000000..83fe14550 --- /dev/null +++ b/src/librustdoc/html/static/css/rustdoc.css @@ -0,0 +1,2335 @@ +/* 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'), + 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'), + 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'), + 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'), + 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'), + 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 */ + src: url("SourceCodePro-Regular.ttf.woff2") format("woff2"); + font-display: swap; +} +@font-face { + font-family: 'Source Code Pro'; + font-style: italic; + font-weight: 400; + src: url("SourceCodePro-It.ttf.woff2") format("woff2"); + font-display: swap; +} +@font-face { + font-family: 'Source Code Pro'; + font-style: normal; + font-weight: 600; + src: url("SourceCodePro-Semibold.ttf.woff2") format("woff2"); + font-display: swap; +} + +/* Avoid using legacy CJK serif fonts in Windows like Batang. */ +@font-face { + font-family: 'NanumBarunGothic'; + 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; +} + +* { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +/* 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"; + } +} + +/* 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); +} + +h1 { + font-size: 1.5rem; /* 24px */ +} +h2 { + font-size: 1.375rem; /* 22px */ +} +h3 { + font-size: 1.25rem; /* 20px */ +} +h1, h2, h3, h4, h5, h6 { + font-weight: 500; +} +h1, h2, h3, h4 { + margin: 20px 0 15px 0; + padding-bottom: 6px; +} +.docblock h3, .docblock h4, h5, h6 { + 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 { + 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, +#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. */ +#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; +} + +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; +} + +.source main { + padding: 15px; +} + +.width-limiter { + max-width: 960px; + margin-right: auto; +} + +.source .width-limiter { + max-width: unset; +} + +details:not(.rustdoc-toggle) summary { + margin-bottom: .6em; +} + +code, pre, a.test-arrow, .code-header { + font-family: "Source Code Pro", monospace; +} +.docblock code, .docblock-short code { + border-radius: 3px; + padding: 0 0.125em; +} +.docblock pre code, .docblock-short pre code { + padding: 0; +} +pre { + padding: 14px; +} +.docblock.item-decl { + margin-left: 0; +} +.item-decl pre { + overflow-x: auto; +} + +.source .content pre { + padding: 20px; +} + +img { + max-width: 100%; +} + +li { + position: relative; +} + +.source .content { + max-width: none; + overflow: visible; + margin-left: 0px; +} + +nav.sub { + position: relative; + font-size: 1rem; +} + +.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; + top: 0; + left: 0; +} + +.sidebar-elems, +.sidebar > .location { + padding-left: 24px; +} + +.sidebar .location { + overflow-wrap: anywhere; +} + +.rustdoc.source .sidebar { + width: 50px; + min-width: 0px; + max-width: 300px; + flex-grow: 0; + flex-shrink: 0; + flex-basis: auto; + border-right: 1px solid; + overflow-x: hidden; + /* 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); +} + +#sidebar-toggle > button:hover, #sidebar-toggle > button:focus { + background-color: var(--sidebar-background-color-hover); +} + +.source .sidebar > *:not(#sidebar-toggle) { + opacity: 0; + visibility: hidden; +} + +.source-sidebar-expanded .source .sidebar { + overflow-y: auto; +} + +.source-sidebar-expanded .source .sidebar > *:not(#sidebar-toggle) { + opacity: 1; + visibility: visible; +} + +#all-types { + margin-top: 1em; +} + +/* Improve the scrollbar display on firefox */ +* { + scrollbar-width: initial; + scrollbar-color: var(--scrollbar-color); +} +.sidebar { + scrollbar-width: thin; + scrollbar-color: var(--scrollbar-color); +} + +/* Improve the scrollbar display on webkit-based browsers */ +::-webkit-scrollbar { + width: 12px; +} +.sidebar::-webkit-scrollbar { + width: 8px; +} +::-webkit-scrollbar-track { + -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 { + display: none !important; +} + +.sidebar .logo-container { + display: flex; + margin-top: 10px; + margin-bottom: 10px; + justify-content: center; +} + +.version { + overflow-wrap: break-word; +} + +.logo-container > img { + height: 100px; + width: 100px; +} + +.location:empty { + border: none; +} + +.location a:first-of-type { + 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; +} + +.rustdoc .example-wrap { + display: inline-flex; + margin-bottom: 10px; +} + +.example-wrap { + position: relative; + 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; +} + +.example-wrap > pre.rust a:hover { + text-decoration: underline; +} + +.line-numbers { + text-align: right; +} +.rustdoc:not(.source) .example-wrap > pre:not(.line-number) { + width: 100%; + overflow-x: auto; +} + +.rustdoc:not(.source) .example-wrap > pre.line-numbers { + width: auto; + overflow-x: visible; +} + +.rustdoc .example-wrap > pre { + margin: 0; +} + +#search { + position: relative; +} + +.search-loading { + text-align: center; +} + +#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; +} +.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; } +.top-doc .docblock h3 { font-size: 1.25rem; } +.top-doc .docblock h4, +.top-doc .docblock h5 { + font-size: 1.125rem; +} +.top-doc .docblock h6 { + font-size: 1rem; +} + +.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); +} + +.docblock { + margin-left: 24px; + position: relative; +} + +.docblock > :not(.information):not(.more-examples-toggle) { + max-width: 100%; + overflow-x: auto; +} + +.content .out-of-band { + flex-grow: 0; + font-size: 1.125rem; + font-weight: normal; + float: right; +} + +.method > .code-header, .trait-impl > .code-header { + max-width: calc(100% - 41px); + display: block; +} + +.content .in-band { + flex-grow: 1; + margin: 0px; + padding: 0px; + overflow-wrap: break-word; + overflow-wrap: anywhere; +} + +.in-band > code, .in-band > .code-header { + display: inline-block; +} + +.docblock code, .docblock-short code, +pre, .rustdoc.source .example-wrap { + background-color: var(--code-block-background-color); +} + +#main-content { + position: relative; +} +#main-content > .since { + top: inherit; +} + +.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; } +.content tr:first-child td { border-top: 0; } + +.docblock table { + margin: .5em 0; + width: calc(100% - 2px); + overflow-x: auto; + display: block; +} + +.docblock table td { + padding: .5em; + border: 1px dashed; +} + +.docblock table th { + padding: .5em; + text-align: left; + 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; } + +.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 { + display: block; + font-size: 0.875rem; +} + +.content .methods > div:not(.notable-traits):not(.method) { + 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 { + position: relative; + margin-left: 24px; +} + +.sub-variant > div > .item-info { + 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; +} + +.impl-items { + flex-basis: 100%; +} + +#main-content > .item-info { + margin-top: 0; + margin-left: 0; +} + +nav.sub { + flex-grow: 1; + margin-bottom: 25px; +} +.source nav.sub { + margin-left: 32px; +} +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; +} + +.small-section-header { + display: flex; + justify-content: space-between; + position: relative; +} + +.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 { + display: inline-block; + position: absolute; +} +.anchor { + display: none; + position: absolute; + left: -0.5em; + background: none !important; +} +.anchor.field { + left: -5px; +} +.small-section-header > .anchor { + left: -15px; + padding-right: 8px; +} +h2.small-section-header > .anchor { + padding-right: 6px; +} +.anchor::before { + content: '§'; +} + +.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 { + display: table; +} +.item-row { + display: table-row; +} +.item-left, .item-right { + display: table-cell; +} +.item-left { + padding-right: 1.25rem; +} + +.search-container { + position: relative; + display: flex; + height: 34px; +} +.search-container > * { + height: 100%; +} +.search-results-title { + display: inline; +} +#search-settings { + font-size: 1.5rem; + font-weight: 500; + margin-bottom: 20px; +} +#crate-search { + min-width: 115px; + margin-top: 5px; + padding-left: 0.15em; + padding-right: 23px; + border: 1px solid; + border-radius: 4px; + outline: none; + cursor: pointer; + -moz-appearance: none; + -webkit-appearance: none; + /* Removes default arrow from firefox */ + background-repeat: no-repeat; + background-color: transparent; + background-size: 20px; + background-position: calc(100% - 1px) 56%; + background-image: /* AUTOREPLACE: */url("down-arrow.svg"); + max-width: 100%; + text-overflow: ellipsis; +} +.search-container { + margin-top: 4px; +} +.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; + border: 1px solid; + border-radius: 2px; + padding: 8px; + font-size: 1rem; + width: 100%; +} + +.search-results { + display: none; + padding-bottom: 2em; +} + +.search-results.active { + display: block; + /* prevent overhanging tabs from moving the first result */ + clear: both; +} + +.search-results .desc > span { + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + display: block; +} + +.search-results > a { + display: block; + width: 100%; + /* A little margin ensures the browser's outlining of focused links has room to display. */ + margin-left: 2px; + margin-right: 2px; + border-bottom: 1px solid #aaa3; +} + +.search-results > a > div { + display: flex; + flex-flow: row wrap; +} + +.search-results .result-name, .search-results div.desc, .search-results .result-description { + width: 50%; +} +.search-results .result-name { + padding-right: 1em; +} + +.search-results .result-name > span { + display: inline-block; + margin: 0; + font-weight: normal; +} + +.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; +} + +.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; +} +.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; +} + +.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; +} + +.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; +} + +.code-attribute { + font-weight: 300; +} + +.item-spacer { + width: 100%; + height: 12px; +} + +.out-of-band > span.since { + position: initial; + font-size: 1.25rem; +} + +h3.variant { + font-weight: 600; + font-size: 1.125rem; + margin-bottom: 10px; + border-bottom: none; +} + +.sub-variant h4 { + font-size: 1rem; + font-weight: 400; + border-bottom: none; + margin-top: 0; + margin-bottom: 0; +} + +.sub-variant { + margin-left: 24px; + margin-bottom: 40px; +} + +.sub-variant > .sub-variant-field { + margin-left: 24px; +} + +.toggle-label { + display: inline-block; + margin-left: 4px; + margin-top: 3px; +} + +:target > code, :target > .code-header { + opacity: 1; +} + +:target { + padding-right: 3px; +} + +.information { + position: absolute; + left: -25px; + margin-top: 7px; + z-index: 1; +} + +.tooltip { + position: relative; + display: inline-block; + cursor: pointer; +} + +.tooltip::after { + display: none; + text-align: center; + padding: 5px 3px 3px 3px; + border-radius: 6px; + margin-left: 5px; + font-size: 1rem; +} + +.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 { + content: " "; + position: absolute; + top: 50%; + left: 16px; + margin-top: -5px; + border-width: 5px; + border-style: solid; + display: none; +} + +.tooltip:hover::before, .tooltip:hover::after { + 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 */ + content: "\00a0\00a0\00a0"; +} + +.notable-traits .notable, .notable-traits .docblock { + margin: 0; +} + +.notable-traits .notable { + margin: 0; + margin-bottom: 13px; + font-size: 1.1875rem; + font-weight: 600; + display: block; +} + +.notable-traits .docblock code.content{ + margin: 0; + padding: 0; + font-size: 1.25rem; +} + +/* Example code has the "Run" button that needs to be positioned relative to the pre */ +pre.rust.rust-example-rendered { + position: relative; +} + +pre.rust { + tab-size: 4; + -moz-tab-size: 4; +} + +.search-failed { + text-align: center; + margin-top: 20px; + 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; + border-top: 2px solid; +} + +#titles > button:first-child:last-child { + margin-right: 1px; + width: calc(100% - 1px); +} + +#titles > button:not(:last-child) { + margin-right: 1px; + width: calc(33.3% - 1px); +} + +#titles > button > div.count { + display: inline-block; + font-size: 1rem; +} + +.notable-traits { + cursor: pointer; + z-index: 2; + margin-left: 5px; +} + +#sidebar-toggle { + position: sticky; + top: 0; + left: 0; + font-weight: bold; + font-size: 1.25rem; + border-bottom: 1px solid; + display: flex; + height: 40px; + justify-content: center; + align-items: center; + z-index: 10; +} +#source-sidebar { + 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 { + margin-left: 4px; + outline: none; +} + +#copy-path { + height: 34px; +} +#settings-menu > a, #help-button > button, #copy-path { + padding: 5px; + width: 33px; + border: 1px solid; + border-radius: 2px; + cursor: pointer; +} +#settings-menu { + padding: 0; +} +#settings-menu > a, #help-button > button { + padding: 5px; + height: 100%; + display: block; +} + +@keyframes rotating { + from { + transform: rotate(0deg); + } + to { + transform: rotate(360deg); + } +} +#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 { + 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. */ + font-size: 20px; + padding-top: 2px; +} + +#copy-path { + background: initial; + margin-left: 10px; + padding: 0; + padding-left: 2px; + border: 0; +} + +#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%; + padding: 4px 8px; + text-align: center; + background: rgba(0,0,0,0); + overflow-wrap: normal; +} + +#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; +} + +#main-content > ul { + padding-left: 10px; +} +#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; + 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
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"); +} + +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; + 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. + However, it's not needed with smaller screen width because the doc/code block is always put + "one line" below. */ + .docblock > .information:first-child > .tooltip { + margin-top: 16px; + } + + /* 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 { + display: none; + } + + .source-sidebar-expanded .source .sidebar { + 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 { + max-width: 35px; + max-height: 35px; + margin-left: 20px; + margin-top: 5px; + margin-bottom: 5px; + } + + .mobile-topbar { + display: flex; + flex-direction: row; + position: sticky; + z-index: 10; + font-size: 2rem; + height: 45px; + width: 100%; + left: 0; + 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); + } + + .source nav:not(.sidebar).sub { + margin-left: 32px; + } + + .content { + margin-left: 0px; + } + + .source .content { + margin-top: 10px; + } + + #search { + margin-left: 0; + padding: 0; + } + + .anchor { + display: none !important; + } + + .notable-traits { + position: absolute; + left: -22px; + top: 24px; + } + + #titles > button > div.count { + float: left; + width: 100%; + } + + #titles { + height: 50px; + } + + /* 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; + } + + #main-content > details.rustdoc-toggle > summary::before, + #main-content > div > details.rustdoc-toggle > summary::before { + left: -11px; + } + + #sidebar-toggle { + position: fixed; + left: 1px; + top: 100px; + width: 30px; + font-size: 1.5rem; + text-align: center; + padding: 0; + 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; + } + + #main-content > .line-numbers { + margin-top: 0; + } + + .notable-traits .notable-traits-tooltiptext { + left: 0; + top: 100%; + } + + /* We don't display the help button on mobile devices. */ + #help-button { + 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%; + } + + /* Display an alternating layout on tablets and phones */ + .search-results > a { + border-bottom: 1px solid #aaa9; + padding: 5px 0px; + } + .search-results .result-name, .search-results div.desc, .search-results .result-description { + width: 100%; + } + .search-results div.desc, .search-results .result-description, .item-right { + padding-left: 2em; + } + + .source-sidebar-expanded .source .sidebar { + max-width: 100vw; + width: 100vw; + } + + /* 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; + } +} + +@media print { + nav.sidebar, nav.sub, .content .out-of-band, a.srclink, #copy-path, + details.rustdoc-toggle[open] > summary::before, details.rustdoc-toggle > summary::before, + details.rustdoc-toggle.top-doc > summary { + display: none; + } + + .docblock { + margin-left: 0; + } + + main { + padding: 10px; + } +} + +@media (max-width: 464px) { + #titles, #titles > button { + height: 73px; + } + + #main-content > table:not(.table-display) td { + word-break: break-word; + width: 50%; + } + + #crate-search { + border-radius: 4px; + } + + .docblock { + margin-left: 12px; + } + + .docblock code { + overflow-wrap: break-word; + overflow-wrap: anywhere; + } + + .sub-container { + flex-direction: column; + } + + .sub-logo-container { + align-self: center; + } + + .source .sub-logo-container > img { + height: 35px; + width: 35px; + } + + #sidebar-toggle { + 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 */ + +.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 */ diff --git a/src/librustdoc/html/static/css/settings.css b/src/librustdoc/html/static/css/settings.css new file mode 100644 index 000000000..e82ec0426 --- /dev/null +++ b/src/librustdoc/html/static/css/settings.css @@ -0,0 +1,90 @@ +.setting-line { + margin: 0.6em 0 0.6em 0.3em; + position: relative; +} + +.setting-line .choices { + display: flex; + flex-wrap: wrap; +} + +.setting-line .radio-line input { + margin-right: 0.3em; + height: 1.2rem; + width: 1.2rem; + border: 1px solid; + outline: none; + -webkit-appearance: none; + cursor: pointer; + border-radius: 50%; +} +.setting-line .radio-line input + span { + padding-bottom: 1px; +} + +.radio-line .setting-name { + width: 100%; +} + +.radio-line .choice { + margin-top: 0.1em; + margin-bottom: 0.1em; + min-width: 3.8em; + padding: 0.3em; + display: flex; + align-items: center; + cursor: pointer; +} +.radio-line .choice + .choice { + margin-left: 0.5em; +} + +.toggle { + position: relative; + width: 100%; + margin-right: 20px; + display: flex; + align-items: center; + cursor: pointer; +} + +.toggle input { + opacity: 0; + position: absolute; +} + +.slider { + position: relative; + width: 45px; + min-width: 45px; + display: block; + height: 28px; + margin-right: 20px; + cursor: pointer; + background-color: #ccc; + transition: .3s; +} + +.slider:before { + position: absolute; + content: ""; + height: 19px; + width: 19px; + left: 4px; + bottom: 4px; + transition: .3s; +} + +input:checked + .slider:before { + transform: translateX(19px); +} + +.setting-line > .sub-settings { + padding-left: 42px; + width: 100%; + display: block; +} + +#settings .setting-line { + margin: 1.2em 0.6em; +} diff --git a/src/librustdoc/html/static/css/themes/ayu.css b/src/librustdoc/html/static/css/themes/ayu.css new file mode 100644 index 000000000..c42cac59b --- /dev/null +++ b/src/librustdoc/html/static/css/themes/ayu.css @@ -0,0 +1,563 @@ +/* +Based off of the Ayu theme +Original by Dempfi (https://github.com/dempfi/ayu) +*/ + +:root { + --main-background-color: #0f1419; + --main-color: #c5c5c5; + --settings-input-color: #ffb454; + --sidebar-background-color: #14191f; + --sidebar-background-color-hover: rgba(70, 70, 70, 0.33); + --code-block-background-color: #191f26; + --scrollbar-track-background-color: transparent; + --scrollbar-thumb-background-color: #5c6773; + --scrollbar-color: #5c6773 #24292f; + --headings-border-bottom-color: #5c6773; +} + +.slider { + background-color: #ccc; +} +.slider:before { + background-color: white; +} +input:focus + .slider { + box-shadow: 0 0 0 2px #0a84ff, 0 0 0 6px rgba(10, 132, 255, 0.3); +} + +h1, h2, h3, h4 { + color: white; +} +h1.fqn a { + color: #fff; +} +h4 { + border: none; +} + +.in-band { + background-color: #0f1419; +} + +.docblock code { + color: #ffb454; +} +.code-header { + color: #e6e1cf; +} +.docblock pre > code, pre > code { + color: #e6e1cf; +} +span code { + color: #e6e1cf; +} +.docblock a > code { + color: #39AFD7 !important; +} +pre, .rustdoc.source .example-wrap { + color: #e6e1cf; +} + +.rust-logo { + filter: drop-shadow(1px 0 0px #fff) + drop-shadow(0 1px 0 #fff) + drop-shadow(-1px 0 0 #fff) + drop-shadow(0 -1px 0 #fff); +} + +.sidebar .current, +.sidebar a:hover { + background-color: transparent; + color: #ffb44c; +} + +.sidebar-elems .location { + color: #ff7733; +} + +.line-numbers span { color: #5c6773; } +.line-numbers .line-highlighted { + color: #708090; + background-color: rgba(255, 236, 164, 0.06); + padding-right: 4px; + border-right: 1px solid #ffb44c; +} + +.docblock table td, .docblock table th { + border-color: #5c6773; +} + +.search-results a:hover { + background-color: #777; +} + +.search-results a:focus { + color: #000 !important; + background-color: #c6afb3; +} +.search-results a { + color: #0096cf; +} +.search-results a div.desc { + color: #c5c5c5; +} + +.content .item-info::before { color: #ccc; } + +.content span.foreigntype, .content a.foreigntype { color: #ffa0a5; } +.content span.union, .content a.union { color: #ffa0a5; } +.content span.constant, .content a.constant, +.content span.static, .content a.static { color: #39AFD7; } +.content span.primitive, .content a.primitive { color: #ffa0a5; } +.content span.traitalias, .content a.traitalias { color: #39AFD7; } +.content span.keyword, .content a.keyword { color: #39AFD7; } + +.content span.externcrate, .content span.mod, .content a.mod { + color: #39AFD7; +} +.content span.struct, .content a.struct { + color: #ffa0a5; +} +.content span.enum, .content a.enum { + color: #ffa0a5; +} +.content span.trait, .content a.trait { + color: #39AFD7; +} +.content span.type, .content a.type { + color: #39AFD7; +} +.content span.type, +.content a.type, +.block a.current.type { color: #39AFD7; } +.content span.associatedtype, +.content a.associatedtype, +.block a.current.associatedtype { color: #39AFD7; } +.content span.fn, .content a.fn, .content span.method, +.content a.method, .content span.tymethod, +.content a.tymethod, .content .fnname { + color: #fdd687; +} +.content span.attr, .content a.attr, .content span.derive, +.content a.derive, .content span.macro, .content a.macro { + color: #a37acc; +} + +.sidebar a { color: #53b1db; } +.sidebar a.current.type { color: #53b1db; } +.sidebar a.current.associatedtype { color: #53b1db; } + +pre.rust .comment { color: #788797; } +pre.rust .doccomment { color: #a1ac88; } + +nav.main .current { + border-top-color: #5c6773; + border-bottom-color: #5c6773; +} +nav.main .separator { + border: 1px solid #5c6773; +} +a { + color: #39AFD7; +} + +.sidebar h2 a, +.sidebar h3 a { + color: white; +} +.search-results a { + color: #0096cf; +} +body.source .example-wrap pre.rust a { + background: #333; +} + +details.rustdoc-toggle > summary.hideme > span, +details.rustdoc-toggle > summary::before { + color: #999; +} + +details.rustdoc-toggle > summary::before { + filter: invert(100%); +} + +#crate-search, .search-input { + background-color: #141920; + border-color: #424c57; +} + +#crate-search { + /* Without the `!important`, the border-color is ignored for ``... + It cannot be in the group above because `.search-input` has a different border color on + hover. */ + border-color: #f0f0f0 !important; +} + +.search-input { + border-color: #e0e0e0; +} + +.search-input:focus { + border-color: #008dfd; +} + +.stab.empty-impl { background: #FFF5D6; border-color: #FFC600; color: #2f2f2f; } +.stab.unstable { background: #FFF5D6; border-color: #FFC600; color: #2f2f2f; } +.stab.deprecated { background: #ffc4c4; border-color: #db7b7b; color: #2f2f2f; } +.stab.must_implement { background: #F3DFFF; border-color: #b07bdb; color: #2f2f2f; } +.stab.portability { background: #F3DFFF; border-color: #b07bdb; color: #2f2f2f; } +.stab.portability > code { background: none; } + +.rightside, +.out-of-band { + color: grey; +} + +.line-numbers :target { background-color: transparent; } + +/* Code highlighting */ +pre.rust .kw { color: #ab8ac1; } +pre.rust .kw-2, pre.rust .prelude-ty { color: #769acb; } +pre.rust .number, pre.rust .string { color: #83a300; } +pre.rust .self, pre.rust .bool-val, pre.rust .prelude-val, +pre.rust .attribute, pre.rust .attribute .ident { color: #ee6868; } +pre.rust .macro, pre.rust .macro-nonterminal { color: #3E999F; } +pre.rust .lifetime { color: #d97f26; } +pre.rust .question-mark { + color: #ff9011; +} + +.example-wrap > pre.line-number { + border-color: #4a4949; +} + +a.test-arrow { + color: #dedede; + background-color: rgba(78, 139, 202, 0.2); +} + +a.test-arrow:hover{ + background-color: #4e8bca; +} + +.toggle-label, +.code-attribute { + color: #999; +} + +:target { + background-color: #494a3d; + border-right: 3px solid #bb7410; +} + +pre.compile_fail { + border-left: 2px solid rgba(255,0,0,.8); +} + +pre.compile_fail:hover, .information:hover + pre.compile_fail { + border-left: 2px solid #f00; +} + +pre.should_panic { + border-left: 2px solid rgba(255,0,0,.8); +} + +pre.should_panic:hover, .information:hover + pre.should_panic { + border-left: 2px solid #f00; +} + +pre.ignore { + border-left: 2px solid rgba(255,142,0,.6); +} + +pre.ignore:hover, .information:hover + pre.ignore { + border-left: 2px solid #ff9200; +} + +.tooltip.compile_fail { + color: rgba(255,0,0,.8); +} + +.information > .compile_fail:hover { + color: #f00; +} + +.tooltip.should_panic { + color: rgba(255,0,0,.8); +} + +.information > .should_panic:hover { + color: #f00; +} + +.tooltip.ignore { + color: rgba(255,142,0,.6); +} + +.information > .ignore:hover { + color: #ff9200; +} + +.search-failed a { + color: #0089ff; +} + +.tooltip::after { + background-color: #000; + color: #fff; + border-color: #000; +} + +.tooltip::before { + border-color: transparent black transparent transparent; +} + +.notable-traits-tooltiptext { + background-color: #111; + border-color: #777; +} + +.notable-traits-tooltiptext .notable { + border-bottom-color: #d2d2d2; +} + +#titles > button:not(.selected) { + background-color: #252525; + border-top-color: #252525; +} + +#titles > button:hover, #titles > button.selected { + border-top-color: #0089ff; + background-color: #353535; +} + +#titles > button > div.count { + color: #888; +} + +@media (max-width: 700px) { + .sidebar-elems { + border-right-color: #000; + } +} + +kbd { + color: #000; + background-color: #fafbfc; + border-color: #d1d5da; + border-bottom-color: #c6cbd1; + box-shadow: inset 0 -1px 0 #c6cbd1; +} + +#settings-menu > a, #help-button > button { + border-color: #e0e0e0; + background: #f0f0f0; + color: #000; +} + +#settings-menu > a:hover, #settings-menu > a:focus, +#help-button > button:hover, #help-button > button:focus { + border-color: #ffb900; +} + +.popover, .popover::before, +#help-button span.top, #help-button span.bottom { + border-color: #d2d2d2; +} + +#copy-path { + color: #999; +} +#copy-path > img { + filter: invert(50%); +} +#copy-path:hover > img { + filter: invert(65%); +} + +#theme-choices { + border-color: #e0e0e0; + background-color: #353535; +} + +#theme-choices > button:not(:first-child) { + border-top-color: #e0e0e0; +} + +#theme-choices > button:hover, #theme-choices > button:focus { + background-color: #4e4e4e; +} + +.search-results .result-name span.alias { + color: #fff; +} +.search-results .result-name span.grey { + color: #ccc; +} + +#source-sidebar > .title { + border-bottom-color: #ccc; +} +#source-sidebar div.files > a:hover, details.dir-entry summary:hover, +#source-sidebar div.files > a:focus, details.dir-entry summary:focus { + background-color: #444; +} +#source-sidebar div.files > a.selected { + background-color: #333; +} + +.scraped-example-list .scrape-help { + border-color: #aaa; + color: #eee; +} +.scraped-example-list .scrape-help:hover { + border-color: white; + color: white; +} +.more-examples-toggle summary, .more-examples-toggle .hide-more { + color: #999; +} +.scraped-example .example-wrap .rust span.highlight { + background: rgb(91, 59, 1); +} +.scraped-example .example-wrap .rust span.highlight.focus { + background: rgb(124, 75, 15); +} +.scraped-example:not(.expanded) .code-wrapper:before { + background: linear-gradient(to bottom, rgba(53, 53, 53, 1), rgba(53, 53, 53, 0)); +} +.scraped-example:not(.expanded) .code-wrapper:after { + background: linear-gradient(to top, rgba(53, 53, 53, 1), rgba(53, 53, 53, 0)); +} +.toggle-line-inner { + background: #999; +} +.toggle-line:hover .toggle-line-inner { + background: #c5c5c5; +} diff --git a/src/librustdoc/html/static/css/themes/light.css b/src/librustdoc/html/static/css/themes/light.css new file mode 100644 index 000000000..b751acff1 --- /dev/null +++ b/src/librustdoc/html/static/css/themes/light.css @@ -0,0 +1,395 @@ +:root { + --main-background-color: white; + --main-color: black; + --settings-input-color: #2196f3; + --sidebar-background-color: #F5F5F5; + --sidebar-background-color-hover: #E0E0E0; + --code-block-background-color: #F5F5F5; + --scrollbar-track-background-color: #dcdcdc; + --scrollbar-thumb-background-color: rgba(36, 37, 39, 0.6); + --scrollbar-color: rgba(36, 37, 39, 0.6) #d9d9d9; + --headings-border-bottom-color: #ddd; +} + +.slider { + background-color: #ccc; +} +.slider:before { + background-color: white; +} +input:focus + .slider { + box-shadow: 0 0 0 2px #0a84ff, 0 0 0 6px rgba(10, 132, 255, 0.3); +} + +.in-band { + background-color: white; +} + +.rust-logo { + /* This rule exists to force other themes to explicitly style the logo. + * Rustdoc has a custom linter for this purpose. + */ +} + +.sidebar .current, +.sidebar a:hover { + background-color: #fff; +} + +.line-numbers span { color: #c67e2d; } +.line-numbers .line-highlighted { + background-color: #FDFFD3 !important; +} + +.docblock table td, .docblock table th { + border-color: #ddd; +} + +.search-results a:hover { + background-color: #ddd; +} + +.search-results a:focus { + color: #000 !important; + background-color: #ccc; +} +.search-results a:focus span { color: #000 !important; } +a.result-trait:focus { background-color: #c7b6ff; } +a.result-traitalias:focus { background-color: #c7b6ff; } +a.result-mod:focus, +a.result-externcrate:focus { background-color: #afc6e4; } +a.result-enum:focus { background-color: #e7b1a0; } +a.result-struct:focus { background-color: #e7b1a0; } +a.result-union:focus { background-color: #e7b1a0; } +a.result-fn:focus, +a.result-method:focus, +a.result-tymethod:focus { background-color: #c6afb3; } +a.result-type:focus { background-color: #e7b1a0; } +a.result-associatedtype:focus { background-color: #afc6e4; } +a.result-foreigntype:focus { background-color: #e7b1a0; } +a.result-attr:focus, +a.result-derive:focus, +a.result-macro:focus { background-color: #8ce488; } +a.result-constant:focus, +a.result-static:focus { background-color: #afc6e4; } +a.result-primitive:focus { background-color: #e7b1a0; } +a.result-keyword:focus { background-color: #afc6e4; } + +.content .item-info::before { color: #ccc; } + +.content span.enum, .content a.enum, .block a.current.enum { color: #AD378A; } +.content span.struct, .content a.struct, .block a.current.struct { color: #AD378A; } +.content span.type, .content a.type, .block a.current.type { color: #AD378A; } +.content span.foreigntype, .content a.foreigntype, .block a.current.foreigntype { color: #3873AD; } +.content span.associatedtype, +.content a.associatedtype, +.block a.current.associatedtype { color: #3873AD; } +.content span.attr, .content a.attr, .block a.current.attr, +.content span.derive, .content a.derive, .block a.current.derive, +.content span.macro, .content a.macro, .block a.current.macro { color: #068000; } +.content span.union, .content a.union, .block a.current.union { color: #AD378A; } +.content span.constant, .content a.constant, .block a.current.constant, +.content span.static, .content a.static, .block a.current.static { color: #3873AD; } +.content span.primitive, .content a.primitive, .block a.current.primitive { color: #AD378A; } +.content span.externcrate, +.content span.mod, .content a.mod, .block a.current.mod { color: #3873AD; } +.content span.trait, .content a.trait, .block a.current.trait { color: #6E4FC9; } +.content span.traitalias, .content a.traitalias, .block a.current.traitalias { color: #5137AD; } +.content span.fn, .content a.fn, .block a.current.fn, +.content span.method, .content a.method, .block a.current.method, +.content span.tymethod, .content a.tymethod, .block a.current.tymethod, +.content .fnname { color: #AD7C37; } +.content span.keyword, .content a.keyword, .block a.current.keyword { color: #3873AD; } + +.sidebar a { color: #356da4; } +.sidebar a.current.enum { color: #a63283; } +.sidebar a.current.struct { color: #a63283; } +.sidebar a.current.type { color: #a63283; } +.sidebar a.current.associatedtype { color: #356da4; } +.sidebar a.current.foreigntype { color: #356da4; } +.sidebar a.current.attr, +.sidebar a.current.derive, +.sidebar a.current.macro { color: #067901; } +.sidebar a.current.union { color: #a63283; } +.sidebar a.current.constant +.sidebar a.current.static { color: #356da4; } +.sidebar a.current.primitive { color: #a63283; } +.sidebar a.current.externcrate +.sidebar a.current.mod { color: #356da4; } +.sidebar a.current.trait { color: #6849c3; } +.sidebar a.current.traitalias { color: #4b349e; } +.sidebar a.current.fn, +.sidebar a.current.method, +.sidebar a.current.tymethod { color: #a67736; } +.sidebar a.current.keyword { color: #356da4; } + +nav.main .current { + border-top-color: #000; + border-bottom-color: #000; +} +nav.main .separator { + border: 1px solid #000; +} + +a { + color: #3873AD; +} + +body.source .example-wrap pre.rust a { + background: #eee; +} + +details.rustdoc-toggle > summary.hideme > span, +details.rustdoc-toggle > summary::before { + color: #999; +} + +#crate-search, .search-input { + background-color: white; + border-color: #e0e0e0; +} + +#crate-search { + /* Without the `!important`, the border-color is ignored for `