2023-01-27 15:49:08 +01:00
|
|
|
/* When static files are updated, their suffixes need to be updated.
|
|
|
|
1. In the top directory run:
|
|
|
|
./x.py doc --stage 1 library/core
|
|
|
|
2. Find the directory containing files named with updated suffixes:
|
|
|
|
find build -path '*'/stage1-std/'*'/static.files
|
|
|
|
3. Copy the filenames with updated suffixes from the directory.
|
|
|
|
*/
|
|
|
|
|
2015-09-19 10:42:03 +01:00
|
|
|
/* See FiraSans-LICENSE.txt for the Fira Sans license. */
|
2014-04-12 21:39:12 +02:00
|
|
|
@font-face {
|
2016-11-06 21:03:08 +01:00
|
|
|
font-family: 'Fira Sans';
|
|
|
|
font-style: normal;
|
|
|
|
font-weight: 400;
|
2021-02-26 00:02:11 -08:00
|
|
|
src: local('Fira Sans'),
|
2022-10-24 01:28:55 -07:00
|
|
|
url("FiraSans-Regular-018c141bf0843ffd.woff2") format("woff2");
|
2021-02-19 17:54:41 -08:00
|
|
|
font-display: swap;
|
2014-04-12 21:39:12 +02:00
|
|
|
}
|
|
|
|
@font-face {
|
2016-11-06 21:03:08 +01:00
|
|
|
font-family: 'Fira Sans';
|
|
|
|
font-style: normal;
|
|
|
|
font-weight: 500;
|
2021-02-26 00:02:11 -08:00
|
|
|
src: local('Fira Sans Medium'),
|
2022-10-24 01:28:55 -07:00
|
|
|
url("FiraSans-Medium-8f9a781e4970d388.woff2") format("woff2");
|
2021-02-19 17:54:41 -08:00
|
|
|
font-display: swap;
|
2014-04-12 21:39:12 +02:00
|
|
|
}
|
2015-09-19 10:42:03 +01:00
|
|
|
|
2021-03-29 18:33:22 +02:00
|
|
|
/* See SourceSerif4-LICENSE.md for the Source Serif 4 license. */
|
2014-04-12 21:39:12 +02:00
|
|
|
@font-face {
|
2021-03-29 18:33:22 +02:00
|
|
|
font-family: 'Source Serif 4';
|
2016-11-06 21:03:08 +01:00
|
|
|
font-style: normal;
|
|
|
|
font-weight: 400;
|
2021-06-17 17:36:42 +02:00
|
|
|
src: local('Source Serif 4'),
|
2023-01-27 12:43:00 +01:00
|
|
|
url("SourceSerif4-Regular-46f98efaafac5295.ttf.woff2") format("woff2");
|
2021-02-19 17:54:41 -08:00
|
|
|
font-display: swap;
|
2014-04-12 21:39:12 +02:00
|
|
|
}
|
|
|
|
@font-face {
|
2021-03-29 18:33:22 +02:00
|
|
|
font-family: 'Source Serif 4';
|
2016-11-06 21:03:08 +01:00
|
|
|
font-style: italic;
|
|
|
|
font-weight: 400;
|
2021-06-17 17:36:42 +02:00
|
|
|
src: local('Source Serif 4 Italic'),
|
2023-01-27 12:43:00 +01:00
|
|
|
url("SourceSerif4-It-acdfaf1a8af734b1.ttf.woff2") format("woff2");
|
2021-02-19 17:54:41 -08:00
|
|
|
font-display: swap;
|
2014-04-12 21:39:12 +02:00
|
|
|
}
|
|
|
|
@font-face {
|
2021-03-29 18:33:22 +02:00
|
|
|
font-family: 'Source Serif 4';
|
2016-11-06 21:03:08 +01:00
|
|
|
font-style: normal;
|
|
|
|
font-weight: 700;
|
2021-06-17 17:36:42 +02:00
|
|
|
src: local('Source Serif 4 Bold'),
|
2023-01-27 12:43:00 +01:00
|
|
|
url("SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2") format("woff2");
|
2021-02-19 17:54:41 -08:00
|
|
|
font-display: swap;
|
2014-04-12 21:39:12 +02:00
|
|
|
}
|
2015-09-19 10:42:03 +01:00
|
|
|
|
|
|
|
/* See SourceCodePro-LICENSE.txt for the Source Code Pro license. */
|
2014-07-08 20:26:23 +02:00
|
|
|
@font-face {
|
2016-11-06 21:03:08 +01:00
|
|
|
font-family: 'Source Code Pro';
|
|
|
|
font-style: normal;
|
|
|
|
font-weight: 400;
|
2016-12-04 13:44:19 -08:00
|
|
|
/* Avoid using locally installed font because bad versions are in circulation:
|
|
|
|
* see https://github.com/rust-lang/rust/issues/24355 */
|
2022-10-24 01:28:55 -07:00
|
|
|
src: url("SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2") format("woff2");
|
2021-03-04 15:38:31 +01:00
|
|
|
font-display: swap;
|
|
|
|
}
|
|
|
|
@font-face {
|
|
|
|
font-family: 'Source Code Pro';
|
|
|
|
font-style: italic;
|
|
|
|
font-weight: 400;
|
2022-10-24 01:28:55 -07:00
|
|
|
src: url("SourceCodePro-It-1cc31594bf4f1f79.ttf.woff2") format("woff2");
|
2021-02-19 17:54:41 -08:00
|
|
|
font-display: swap;
|
2014-07-08 20:26:23 +02:00
|
|
|
}
|
|
|
|
@font-face {
|
2016-11-06 21:03:08 +01:00
|
|
|
font-family: 'Source Code Pro';
|
|
|
|
font-style: normal;
|
|
|
|
font-weight: 600;
|
2022-10-24 01:28:55 -07:00
|
|
|
src: url("SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2") format("woff2");
|
2021-02-19 17:54:41 -08:00
|
|
|
font-display: swap;
|
2014-07-08 20:26:23 +02:00
|
|
|
}
|
2014-04-12 21:39:12 +02:00
|
|
|
|
2021-10-12 04:47:34 +09:00
|
|
|
/* Avoid using legacy CJK serif fonts in Windows like Batang. */
|
2021-05-15 14:01:27 +09:00
|
|
|
@font-face {
|
2021-10-26 10:58:13 +09:00
|
|
|
font-family: 'NanumBarunGothic';
|
2022-10-24 01:28:55 -07:00
|
|
|
src: url("NanumBarunGothic-0f09457c7a19b7c6.ttf.woff2") format("woff2");
|
2021-05-15 14:01:27 +09:00
|
|
|
font-display: swap;
|
2021-10-26 10:58:13 +09:00
|
|
|
unicode-range: U+AC00-D7AF, U+1100-11FF, U+3130-318F, U+A960-A97F, U+D7B0-D7FF;
|
2021-05-15 14:01:27 +09:00
|
|
|
}
|
|
|
|
|
2013-09-18 22:18:38 -07:00
|
|
|
* {
|
2020-07-15 17:20:46 +02:00
|
|
|
box-sizing: border-box;
|
2013-09-18 22:18:38 -07:00
|
|
|
}
|
|
|
|
|
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 */
|
2013-09-18 22:18:38 -07:00
|
|
|
|
|
|
|
body {
|
2022-02-05 05:05:05 -08:00
|
|
|
/* 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;
|
2016-11-06 21:03:08 +01:00
|
|
|
margin: 0;
|
|
|
|
position: relative;
|
2022-01-11 17:36:52 -08:00
|
|
|
/* 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;
|
2016-11-06 21:03:08 +01:00
|
|
|
font-feature-settings: "kern", "liga";
|
2022-06-24 17:03:04 +02:00
|
|
|
background-color: var(--main-background-color);
|
|
|
|
color: var(--main-color);
|
2013-09-18 22:18:38 -07:00
|
|
|
}
|
|
|
|
|
2014-04-27 09:07:12 +03:00
|
|
|
h1 {
|
2022-02-05 05:05:05 -08:00
|
|
|
font-size: 1.5rem; /* 24px */
|
2014-04-27 09:07:12 +03:00
|
|
|
}
|
|
|
|
h2 {
|
2022-02-05 05:05:05 -08:00
|
|
|
font-size: 1.375rem; /* 22px */
|
2014-04-27 09:07:12 +03:00
|
|
|
}
|
|
|
|
h3 {
|
2022-02-05 05:05:05 -08:00
|
|
|
font-size: 1.25rem; /* 20px */
|
2014-04-27 09:07:12 +03:00
|
|
|
}
|
2021-10-01 06:17:15 -04:00
|
|
|
h1, h2, h3, h4, h5, h6 {
|
2016-11-06 21:03:08 +01:00
|
|
|
font-weight: 500;
|
2021-10-18 21:04:38 -07:00
|
|
|
}
|
|
|
|
h1, h2, h3, h4 {
|
2022-09-27 09:21:24 -07:00
|
|
|
margin: 25px 0 15px 0;
|
2016-11-06 21:03:08 +01:00
|
|
|
padding-bottom: 6px;
|
2013-09-18 22:18:38 -07:00
|
|
|
}
|
2021-10-21 23:09:11 -07:00
|
|
|
.docblock h3, .docblock h4, h5, h6 {
|
2021-10-18 21:04:38 -07:00
|
|
|
margin: 15px 0 5px 0;
|
|
|
|
}
|
2022-09-28 14:33:56 -07:00
|
|
|
.docblock > h2:first-child,
|
|
|
|
.docblock > h3:first-child,
|
|
|
|
.docblock > h4:first-child,
|
|
|
|
.docblock > h5:first-child,
|
|
|
|
.docblock > h6:first-child {
|
|
|
|
margin-top: 0;
|
|
|
|
}
|
2023-01-13 10:09:25 -07:00
|
|
|
.main-heading h1 {
|
2021-12-03 17:09:04 -08:00
|
|
|
margin: 0;
|
|
|
|
padding: 0;
|
2022-10-04 11:54:40 -07:00
|
|
|
flex-grow: 1;
|
|
|
|
/* 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;
|
2021-12-03 17:09:04 -08:00
|
|
|
}
|
|
|
|
.main-heading {
|
2021-04-20 22:31:48 +02:00
|
|
|
display: flex;
|
2022-01-13 09:54:44 -08:00
|
|
|
flex-wrap: wrap;
|
|
|
|
padding-bottom: 6px;
|
2021-12-03 17:09:04 -08:00
|
|
|
margin-bottom: 15px;
|
2014-03-18 01:44:55 -06:00
|
|
|
}
|
2021-10-21 23:09:11 -07:00
|
|
|
/* 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. */
|
2022-10-18 11:14:01 -07:00
|
|
|
.content h2,
|
2022-05-21 13:57:52 +02:00
|
|
|
.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);
|
2014-03-18 01:44:55 -06:00
|
|
|
}
|
2021-10-21 18:46:47 -07:00
|
|
|
h3.code-header {
|
2022-02-05 05:05:05 -08:00
|
|
|
font-size: 1.125rem; /* 18px */
|
2021-10-21 18:46:47 -07:00
|
|
|
}
|
|
|
|
h4.code-header {
|
Set font size proportional to user's font size
According to MDN
(https://developer.mozilla.org/en-US/docs/Web/CSS/font-size),
> To maximize accessibility, it is generally best to use values that
> are relative to the user's default font size.
> Defining font sizes in px is not accessible, because the user cannot
> change the font size in some browsers.
Note that changing font size (in browser or OS settings) is distinct
from the zoom functionality triggered with Ctrl/Cmd-+. Zoom
functionality increases the size of everything on the page, effectively
applying a multiplier to all pixel sizes. Font size changes apply to
just text.
For relative font sizes, we could use `em`, as we do in several places
already. However that has a problem of "compounding" (see MDN article
for details). The compounding problem is nicely solved by `rem`, which
make font sizes relative to the root element, not the parent element.
Since we were using a hodge-podge of pixel sizes, em, rem, and
percentage sizes before, this change switching everything to rem, while
keeping the same size relative to our old default of 16px.
16px is still the default on most browsers, for users that haven't set a
larger or smaller font size.
2021-12-30 16:42:06 -05:00
|
|
|
font-size: 1rem;
|
2021-10-21 18:46:47 -07:00
|
|
|
}
|
2022-01-07 12:39:56 -05:00
|
|
|
.code-header {
|
2021-07-25 21:41:57 +00:00
|
|
|
font-weight: 600;
|
|
|
|
margin: 0;
|
2022-01-07 12:39:56 -05:00
|
|
|
padding: 0;
|
2023-02-02 15:10:41 -07:00
|
|
|
white-space: pre-wrap;
|
2021-07-25 21:41:57 +00:00
|
|
|
}
|
2017-10-01 15:54:50 +03:00
|
|
|
|
2022-09-28 13:52:13 -07:00
|
|
|
#crate-search,
|
2021-10-01 06:17:15 -04:00
|
|
|
h1, h2, h3, h4, h5, h6,
|
Simplify and unify rustdoc sidebar styles
This switches to just use size, weight, and spacing to distinguish
headings in the sidebar. We no longer use boxes, horizontal bars, or
centering to distinguish headings. This makes it much easier to
understand the hierarchy of headings, and reduces visual noise.
I also refactored how the mobile topbar works. Previously, we tried to
shift around elements from the sidebar to make the topbar. Now, the
topbar gets its own elements, which can be styled on their own. This
makes styling and reasoning about those elements simpler.
Because the heading font sizes are bigger, increase the sidebar width
slightly.
As a very minor change, removed version from the "All types" page. It's
now only on the crate page.
2022-01-06 19:48:24 -05:00
|
|
|
.sidebar,
|
|
|
|
.mobile-topbar,
|
|
|
|
.search-input,
|
|
|
|
.search-results .result-name,
|
2021-06-18 00:33:42 +02:00
|
|
|
.item-left > a,
|
2021-12-03 17:09:04 -08:00
|
|
|
.out-of-band,
|
|
|
|
span.since,
|
|
|
|
a.srclink,
|
2022-10-14 09:48:19 -07:00
|
|
|
#help-button > a,
|
2022-12-05 11:15:09 -07:00
|
|
|
summary.hideme,
|
2022-12-01 11:31:44 -07:00
|
|
|
.scraped-example-list,
|
2020-12-29 15:56:52 +01:00
|
|
|
/* This selector is for the items listed in the "all items" page. */
|
2022-09-16 13:40:21 -07:00
|
|
|
ul.all-items {
|
2021-10-26 10:58:13 +09:00
|
|
|
font-family: "Fira Sans", Arial, NanumBarunGothic, sans-serif;
|
2014-04-12 21:39:12 +02:00
|
|
|
}
|
|
|
|
|
2022-09-17 09:38:57 -07:00
|
|
|
#toggle-all-docs,
|
2022-06-24 17:03:04 +02:00
|
|
|
a.anchor,
|
|
|
|
.small-section-header a,
|
|
|
|
#source-sidebar a,
|
|
|
|
pre.rust a,
|
|
|
|
.sidebar h2 a,
|
|
|
|
.sidebar h3 a,
|
|
|
|
.mobile-topbar h2 a,
|
2022-10-11 09:22:40 -07:00
|
|
|
h1 a,
|
2022-06-24 17:03:04 +02:00
|
|
|
.search-results a,
|
2022-12-09 10:40:49 -07:00
|
|
|
.stab,
|
2022-11-16 13:28:51 -07:00
|
|
|
.result-name .primitive > i, .result-name .keyword > i {
|
2022-06-24 17:03:04 +02:00
|
|
|
color: var(--main-color);
|
|
|
|
}
|
|
|
|
|
2022-10-19 17:14:50 +02:00
|
|
|
.content span.enum, .content a.enum,
|
|
|
|
.content span.struct, .content a.struct,
|
|
|
|
.content span.union, .content a.union,
|
|
|
|
.content span.primitive, .content a.primitive,
|
|
|
|
.content span.type, .content a.type,
|
|
|
|
.content span.foreigntype, .content a.foreigntype {
|
2022-09-16 17:57:07 +02:00
|
|
|
color: var(--type-link-color);
|
|
|
|
}
|
|
|
|
|
2022-10-19 17:14:50 +02:00
|
|
|
.content span.trait, .content a.trait,
|
|
|
|
.content span.traitalias, .content a.traitalias {
|
2022-09-16 17:57:07 +02:00
|
|
|
color: var(--trait-link-color);
|
|
|
|
}
|
|
|
|
|
2022-10-19 17:14:50 +02:00
|
|
|
.content span.associatedtype, .content a.associatedtype,
|
|
|
|
.content span.constant, .content a.constant,
|
|
|
|
.content span.static, .content a.static {
|
2022-09-16 17:57:07 +02:00
|
|
|
color: var(--assoc-item-link-color);
|
|
|
|
}
|
|
|
|
|
2022-10-19 17:14:50 +02:00
|
|
|
.content span.fn, .content a.fn,
|
|
|
|
.content span.method, .content a.method,
|
|
|
|
.content span.tymethod, .content a.tymethod {
|
2022-09-16 17:57:07 +02:00
|
|
|
color: var(--function-link-color);
|
|
|
|
}
|
|
|
|
|
2022-10-19 17:14:50 +02:00
|
|
|
.content span.attr, .content a.attr,
|
|
|
|
.content span.derive, .content a.derive,
|
|
|
|
.content span.macro, .content a.macro {
|
2022-09-16 17:57:07 +02:00
|
|
|
color: var(--macro-link-color);
|
|
|
|
}
|
|
|
|
|
2022-10-19 17:14:50 +02:00
|
|
|
.content span.mod, .content a.mod {
|
2022-09-16 17:57:07 +02:00
|
|
|
color: var(--mod-link-color);
|
|
|
|
}
|
|
|
|
|
2022-10-19 17:14:50 +02:00
|
|
|
.content span.keyword, .content a.keyword {
|
2022-09-16 17:57:07 +02:00
|
|
|
color: var(--keyword-link-color);
|
|
|
|
}
|
|
|
|
|
|
|
|
a {
|
|
|
|
color: var(--link-color);
|
2023-01-09 11:09:19 -07:00
|
|
|
text-decoration: none;
|
2022-09-16 17:57:07 +02:00
|
|
|
}
|
|
|
|
|
2014-04-18 11:08:34 +09:00
|
|
|
ol, ul {
|
2022-02-05 05:05:05 -08:00
|
|
|
padding-left: 24px;
|
2014-04-12 21:39:12 +02:00
|
|
|
}
|
2014-04-18 11:08:34 +09:00
|
|
|
ul ul, ol ul, ul ol, ol ol {
|
2022-02-05 05:05:05 -08:00
|
|
|
margin-bottom: .625em;
|
2014-04-18 11:08:34 +09:00
|
|
|
}
|
2014-04-12 21:39:12 +02:00
|
|
|
|
|
|
|
p {
|
2022-02-05 05:05:05 -08:00
|
|
|
/* 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;
|
2014-04-12 21:39:12 +02:00
|
|
|
}
|
2022-09-27 09:21:24 -07:00
|
|
|
/* For the last child of a div, the margin will be taken care of
|
|
|
|
by the margin-top of the next item. */
|
|
|
|
p:last-child {
|
|
|
|
margin: 0;
|
|
|
|
}
|
2014-03-20 19:05:22 +01:00
|
|
|
|
2021-06-30 04:13:46 +09:00
|
|
|
/* Fix some style changes due to normalize.css 8 */
|
|
|
|
|
Simplify and unify rustdoc sidebar styles
This switches to just use size, weight, and spacing to distinguish
headings in the sidebar. We no longer use boxes, horizontal bars, or
centering to distinguish headings. This makes it much easier to
understand the hierarchy of headings, and reduces visual noise.
I also refactored how the mobile topbar works. Previously, we tried to
shift around elements from the sidebar to make the topbar. Now, the
topbar gets its own elements, which can be styled on their own. This
makes styling and reasoning about those elements simpler.
Because the heading font sizes are bigger, increase the sidebar width
slightly.
As a very minor change, removed version from the "All types" page. It's
now only on the crate page.
2022-01-06 19:48:24 -05:00
|
|
|
button {
|
|
|
|
/* Buttons on Safari have different default padding than other platforms. Make them the same. */
|
|
|
|
padding: 1px 6px;
|
2022-11-20 21:48:57 -07:00
|
|
|
/* Opinionated tweak: use pointer cursor as clickability signifier. */
|
|
|
|
cursor: pointer;
|
Simplify and unify rustdoc sidebar styles
This switches to just use size, weight, and spacing to distinguish
headings in the sidebar. We no longer use boxes, horizontal bars, or
centering to distinguish headings. This makes it much easier to
understand the hierarchy of headings, and reduces visual noise.
I also refactored how the mobile topbar works. Previously, we tried to
shift around elements from the sidebar to make the topbar. Now, the
topbar gets its own elements, which can be styled on their own. This
makes styling and reasoning about those elements simpler.
Because the heading font sizes are bigger, increase the sidebar width
slightly.
As a very minor change, removed version from the "All types" page. It's
now only on the crate page.
2022-01-06 19:48:24 -05:00
|
|
|
}
|
|
|
|
|
2022-11-20 21:48:57 -07:00
|
|
|
/* end tweaks for normalize.css 8 */
|
|
|
|
|
2022-09-17 09:38:57 -07:00
|
|
|
button#toggle-all-docs {
|
|
|
|
padding: 0;
|
|
|
|
background: none;
|
|
|
|
border: none;
|
2022-09-17 09:53:31 -07:00
|
|
|
/* iOS button gradient: https://stackoverflow.com/q/5438567 */
|
|
|
|
-webkit-appearance: none;
|
|
|
|
opacity: 1;
|
2022-09-17 09:38:57 -07:00
|
|
|
}
|
|
|
|
|
2021-09-30 04:23:02 +02:00
|
|
|
.rustdoc {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
flex-wrap: nowrap;
|
|
|
|
}
|
|
|
|
|
|
|
|
main {
|
|
|
|
position: relative;
|
|
|
|
flex-grow: 1;
|
|
|
|
padding: 10px 15px 40px 45px;
|
2022-11-29 11:37:32 -07:00
|
|
|
min-width: 0; /* avoid growing beyond the size limit */
|
2021-09-30 04:23:02 +02:00
|
|
|
}
|
|
|
|
|
2021-10-10 00:52:14 +02:00
|
|
|
.source main {
|
|
|
|
padding: 15px;
|
|
|
|
}
|
|
|
|
|
2021-12-02 14:21:32 +01:00
|
|
|
.width-limiter {
|
2021-09-30 04:23:02 +02:00
|
|
|
max-width: 960px;
|
|
|
|
margin-right: auto;
|
|
|
|
}
|
|
|
|
|
2023-01-10 11:35:37 -07:00
|
|
|
details:not(.toggle) summary {
|
2021-06-24 15:41:31 +09:00
|
|
|
margin-bottom: .6em;
|
|
|
|
}
|
|
|
|
|
2021-07-25 21:41:57 +00:00
|
|
|
code, pre, a.test-arrow, .code-header {
|
2018-11-07 11:02:08 -05:00
|
|
|
font-family: "Source Code Pro", monospace;
|
2013-11-11 15:16:23 +01:00
|
|
|
}
|
2016-09-09 11:54:12 +08:00
|
|
|
.docblock code, .docblock-short code {
|
2016-11-06 21:03:08 +01:00
|
|
|
border-radius: 3px;
|
2022-02-05 05:05:05 -08:00
|
|
|
padding: 0 0.125em;
|
2014-08-06 11:03:18 +01:00
|
|
|
}
|
2021-04-01 13:31:55 -07:00
|
|
|
.docblock pre code, .docblock-short pre code {
|
2016-11-06 21:03:08 +01:00
|
|
|
padding: 0;
|
2015-07-12 19:42:42 -04:00
|
|
|
}
|
2013-11-11 15:16:23 +01:00
|
|
|
pre {
|
2016-11-06 21:03:08 +01:00
|
|
|
padding: 14px;
|
2022-12-19 10:18:10 -07:00
|
|
|
line-height: 1.5; /* https://github.com/rust-lang/rust/issues/105906 */
|
2014-04-25 17:34:32 +09:00
|
|
|
}
|
2023-01-30 11:05:12 -07:00
|
|
|
pre.item-decl {
|
2021-07-15 18:19:07 +02:00
|
|
|
overflow-x: auto;
|
|
|
|
}
|
2023-01-10 18:27:00 +01:00
|
|
|
/* This rule allows to have scrolling on the X axis. */
|
|
|
|
.item-decl .type-contents-toggle {
|
|
|
|
contain: initial;
|
|
|
|
}
|
2014-04-25 17:34:32 +09:00
|
|
|
|
2017-03-23 23:05:30 -04:00
|
|
|
.source .content pre {
|
2016-11-06 21:03:08 +01:00
|
|
|
padding: 20px;
|
2013-09-18 22:18:38 -07:00
|
|
|
}
|
2022-12-23 22:55:04 -07:00
|
|
|
.rustdoc.source .example-wrap > pre.src-line-numbers {
|
|
|
|
padding: 20px 0 20px 4px;
|
|
|
|
}
|
2013-09-18 22:18:38 -07:00
|
|
|
|
2016-01-02 21:38:36 -05:00
|
|
|
img {
|
2016-11-06 21:03:08 +01:00
|
|
|
max-width: 100%;
|
2016-01-02 21:38:36 -05:00
|
|
|
}
|
|
|
|
|
rustdoc: clean up `.logo-container` layout CSS
This commit should result in no appearance changes.
To make the logo container exactly the desired height, you want to get rid
of the part of the box used for typographic descenders (you know, the part
of g, y, and j that descends below the baseline). After all, it contains no
text, but the space is still left open in the layout by default, because
`<img>` is `display:inline`. The CSS used to employ three different tricks
to accomplish this:
* By making `.sidebar .logo-container` a flex container, the image becomes
a flex item and is [blockified], without synthesizing any inline boxes.
No inline boxes means no descenders.
* By giving `.mobile-topbar .logo-container` a max-height exactly the same
as the height of the image plus the padding, the descender area gets
cut off.
* By setting `.sub-logo-container { line-height: 0 }`, we ensure that the
only box that contributes to the height of the line box is the image
itself, and not any zero-content text boxes that neighbor it. See the
[logical height algorithm].
This commit gets rid of the first two hacks, leaving only the third,
since it requires only one line of code to accomplish and doesn't require
setting the value based on math.
[blockified]: https://drafts.csswg.org/css-flexbox-1/#flex-items
[logical height algorithm]: https://www.w3.org/TR/css-inline-3/#inline-height
2022-11-04 15:13:13 -07:00
|
|
|
.sub-logo-container, .logo-container {
|
|
|
|
/* zero text boxes so that computed line height = image height exactly */
|
2022-10-20 13:22:36 -07:00
|
|
|
line-height: 0;
|
2023-01-04 13:04:30 -07:00
|
|
|
display: block;
|
2021-10-24 22:41:48 +02:00
|
|
|
}
|
|
|
|
|
2022-12-25 22:35:34 -07:00
|
|
|
.sub-logo-container {
|
|
|
|
margin-right: 32px;
|
|
|
|
}
|
|
|
|
|
2022-10-16 16:59:21 -07:00
|
|
|
.sub-logo-container > img {
|
2021-10-24 22:41:48 +02:00
|
|
|
height: 60px;
|
|
|
|
width: 60px;
|
|
|
|
object-fit: contain;
|
|
|
|
}
|
|
|
|
|
2022-11-06 18:20:28 +01:00
|
|
|
.rust-logo {
|
|
|
|
filter: var(--rust-logo-filter);
|
|
|
|
}
|
|
|
|
|
2013-09-18 22:18:38 -07:00
|
|
|
.sidebar {
|
2022-02-05 05:05:05 -08:00
|
|
|
font-size: 0.875rem;
|
2022-11-16 22:52:30 -07:00
|
|
|
flex: 0 0 200px;
|
2021-11-17 14:45:17 +01:00
|
|
|
overflow-y: scroll;
|
2021-10-24 20:03:13 +02:00
|
|
|
position: sticky;
|
|
|
|
height: 100vh;
|
2021-11-29 15:55:05 +01:00
|
|
|
top: 0;
|
|
|
|
left: 0;
|
2020-04-07 22:10:17 +02:00
|
|
|
}
|
|
|
|
|
2021-11-25 17:08:23 +01:00
|
|
|
.rustdoc.source .sidebar {
|
2022-11-16 22:52:30 -07:00
|
|
|
flex-basis: 50px;
|
2021-10-10 19:08:08 +02:00
|
|
|
border-right: 1px solid;
|
|
|
|
overflow-x: hidden;
|
2021-10-24 21:59:53 +02:00
|
|
|
/* The sidebar is by default hidden */
|
|
|
|
overflow-y: hidden;
|
|
|
|
}
|
|
|
|
|
2022-12-27 13:59:00 -07:00
|
|
|
.sidebar, .mobile-topbar, .sidebar-menu-toggle,
|
|
|
|
#src-sidebar-toggle, #source-sidebar {
|
2022-06-24 17:03:04 +02:00
|
|
|
background-color: var(--sidebar-background-color);
|
|
|
|
}
|
|
|
|
|
2022-12-15 16:29:52 -07:00
|
|
|
#src-sidebar-toggle > button:hover, #src-sidebar-toggle > button:focus {
|
2022-06-24 17:03:04 +02:00
|
|
|
background-color: var(--sidebar-background-color-hover);
|
|
|
|
}
|
|
|
|
|
2022-12-15 16:29:52 -07:00
|
|
|
.source .sidebar > *:not(#src-sidebar-toggle) {
|
2021-10-24 21:59:53 +02:00
|
|
|
visibility: hidden;
|
|
|
|
}
|
|
|
|
|
2022-06-20 12:41:11 -07:00
|
|
|
.source-sidebar-expanded .source .sidebar {
|
2021-10-24 21:59:53 +02:00
|
|
|
overflow-y: auto;
|
2022-11-16 22:52:30 -07:00
|
|
|
flex-basis: 300px;
|
2021-10-24 21:59:53 +02:00
|
|
|
}
|
|
|
|
|
2022-12-15 16:29:52 -07:00
|
|
|
.source-sidebar-expanded .source .sidebar > *:not(#src-sidebar-toggle) {
|
2021-10-24 21:59:53 +02:00
|
|
|
visibility: visible;
|
2021-10-10 00:52:14 +02:00
|
|
|
}
|
|
|
|
|
Simplify and unify rustdoc sidebar styles
This switches to just use size, weight, and spacing to distinguish
headings in the sidebar. We no longer use boxes, horizontal bars, or
centering to distinguish headings. This makes it much easier to
understand the hierarchy of headings, and reduces visual noise.
I also refactored how the mobile topbar works. Previously, we tried to
shift around elements from the sidebar to make the topbar. Now, the
topbar gets its own elements, which can be styled on their own. This
makes styling and reasoning about those elements simpler.
Because the heading font sizes are bigger, increase the sidebar width
slightly.
As a very minor change, removed version from the "All types" page. It's
now only on the crate page.
2022-01-06 19:48:24 -05:00
|
|
|
#all-types {
|
|
|
|
margin-top: 1em;
|
|
|
|
}
|
|
|
|
|
2020-04-07 22:10:17 +02:00
|
|
|
/* Improve the scrollbar display on firefox */
|
|
|
|
* {
|
|
|
|
scrollbar-width: initial;
|
2022-07-11 14:51:39 +02:00
|
|
|
scrollbar-color: var(--scrollbar-color);
|
2020-04-07 22:10:17 +02:00
|
|
|
}
|
|
|
|
.sidebar {
|
2020-04-01 16:12:40 +02:00
|
|
|
scrollbar-width: thin;
|
2022-07-11 14:51:39 +02:00
|
|
|
scrollbar-color: var(--scrollbar-color);
|
2020-04-01 16:12:40 +02:00
|
|
|
}
|
|
|
|
|
2020-04-07 22:10:17 +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;
|
|
|
|
}
|
2020-04-07 22:10:17 +02:00
|
|
|
::-webkit-scrollbar-track {
|
2020-04-01 16:12:40 +02:00
|
|
|
-webkit-box-shadow: inset 0;
|
2022-07-11 14:51:39 +02:00
|
|
|
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);
|
2017-02-15 20:21:25 -05:00
|
|
|
}
|
|
|
|
|
2013-09-18 22:18:38 -07:00
|
|
|
/* Everything else */
|
|
|
|
|
2019-11-11 16:54:45 +01:00
|
|
|
.hidden {
|
2018-02-01 23:40:23 +01:00
|
|
|
display: none !important;
|
|
|
|
}
|
2013-09-18 22:18:38 -07:00
|
|
|
|
Simplify and unify rustdoc sidebar styles
This switches to just use size, weight, and spacing to distinguish
headings in the sidebar. We no longer use boxes, horizontal bars, or
centering to distinguish headings. This makes it much easier to
understand the hierarchy of headings, and reduces visual noise.
I also refactored how the mobile topbar works. Previously, we tried to
shift around elements from the sidebar to make the topbar. Now, the
topbar gets its own elements, which can be styled on their own. This
makes styling and reasoning about those elements simpler.
Because the heading font sizes are bigger, increase the sidebar width
slightly.
As a very minor change, removed version from the "All types" page. It's
now only on the crate page.
2022-01-06 19:48:24 -05:00
|
|
|
.sidebar .logo-container {
|
2017-10-10 23:39:10 +02:00
|
|
|
margin-top: 10px;
|
2021-10-24 21:59:53 +02:00
|
|
|
margin-bottom: 10px;
|
rustdoc: clean up `.logo-container` layout CSS
This commit should result in no appearance changes.
To make the logo container exactly the desired height, you want to get rid
of the part of the box used for typographic descenders (you know, the part
of g, y, and j that descends below the baseline). After all, it contains no
text, but the space is still left open in the layout by default, because
`<img>` is `display:inline`. The CSS used to employ three different tricks
to accomplish this:
* By making `.sidebar .logo-container` a flex container, the image becomes
a flex item and is [blockified], without synthesizing any inline boxes.
No inline boxes means no descenders.
* By giving `.mobile-topbar .logo-container` a max-height exactly the same
as the height of the image plus the padding, the descender area gets
cut off.
* By setting `.sub-logo-container { line-height: 0 }`, we ensure that the
only box that contributes to the height of the line box is the image
itself, and not any zero-content text boxes that neighbor it. See the
[logical height algorithm].
This commit gets rid of the first two hacks, leaving only the third,
since it requires only one line of code to accomplish and doesn't require
setting the value based on math.
[blockified]: https://drafts.csswg.org/css-flexbox-1/#flex-items
[logical height algorithm]: https://www.w3.org/TR/css-inline-3/#inline-height
2022-11-04 15:13:13 -07:00
|
|
|
text-align: center;
|
2013-09-18 22:18:38 -07:00
|
|
|
}
|
|
|
|
|
Simplify and unify rustdoc sidebar styles
This switches to just use size, weight, and spacing to distinguish
headings in the sidebar. We no longer use boxes, horizontal bars, or
centering to distinguish headings. This makes it much easier to
understand the hierarchy of headings, and reduces visual noise.
I also refactored how the mobile topbar works. Previously, we tried to
shift around elements from the sidebar to make the topbar. Now, the
topbar gets its own elements, which can be styled on their own. This
makes styling and reasoning about those elements simpler.
Because the heading font sizes are bigger, increase the sidebar width
slightly.
As a very minor change, removed version from the "All types" page. It's
now only on the crate page.
2022-01-06 19:48:24 -05:00
|
|
|
.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
|
|
|
}
|
|
|
|
|
2022-10-10 11:37:19 -07:00
|
|
|
ul.block, .block li {
|
2016-11-06 21:03:08 +01:00
|
|
|
padding: 0;
|
2022-02-03 22:50:32 -08:00
|
|
|
margin: 0;
|
2016-11-06 21:03:08 +01:00
|
|
|
list-style: none;
|
2015-09-09 00:46:44 +09:00
|
|
|
}
|
2014-03-18 01:44:55 -06:00
|
|
|
|
2022-11-30 07:51:18 -07:00
|
|
|
.sidebar-elems a,
|
|
|
|
.sidebar > h2 a {
|
2016-11-06 21:03:08 +01:00
|
|
|
display: block;
|
2022-11-30 07:51:18 -07:00
|
|
|
padding: 0.25rem; /* 4px */
|
2022-02-05 05:05:05 -08:00
|
|
|
margin-left: -0.25rem;
|
2014-03-18 01:44:55 -06:00
|
|
|
}
|
|
|
|
|
Simplify and unify rustdoc sidebar styles
This switches to just use size, weight, and spacing to distinguish
headings in the sidebar. We no longer use boxes, horizontal bars, or
centering to distinguish headings. This makes it much easier to
understand the hierarchy of headings, and reduces visual noise.
I also refactored how the mobile topbar works. Previously, we tried to
shift around elements from the sidebar to make the topbar. Now, the
topbar gets its own elements, which can be styled on their own. This
makes styling and reasoning about those elements simpler.
Because the heading font sizes are bigger, increase the sidebar width
slightly.
As a very minor change, removed version from the "All types" page. It's
now only on the crate page.
2022-01-06 19:48:24 -05:00
|
|
|
.sidebar h2 {
|
2022-10-18 11:14:01 -07:00
|
|
|
overflow-wrap: anywhere;
|
2021-07-16 21:58:23 -07:00
|
|
|
padding: 0;
|
2022-10-29 09:04:31 -07:00
|
|
|
margin: 0.7rem 0;
|
2017-10-10 23:39:10 +02:00
|
|
|
}
|
|
|
|
|
Simplify and unify rustdoc sidebar styles
This switches to just use size, weight, and spacing to distinguish
headings in the sidebar. We no longer use boxes, horizontal bars, or
centering to distinguish headings. This makes it much easier to
understand the hierarchy of headings, and reduces visual noise.
I also refactored how the mobile topbar works. Previously, we tried to
shift around elements from the sidebar to make the topbar. Now, the
topbar gets its own elements, which can be styled on their own. This
makes styling and reasoning about those elements simpler.
Because the heading font sizes are bigger, increase the sidebar width
slightly.
As a very minor change, removed version from the "All types" page. It's
now only on the crate page.
2022-01-06 19:48:24 -05:00
|
|
|
.sidebar h3 {
|
2022-02-05 05:05:05 -08:00
|
|
|
font-size: 1.125rem; /* 18px */
|
Simplify and unify rustdoc sidebar styles
This switches to just use size, weight, and spacing to distinguish
headings in the sidebar. We no longer use boxes, horizontal bars, or
centering to distinguish headings. This makes it much easier to
understand the hierarchy of headings, and reduces visual noise.
I also refactored how the mobile topbar works. Previously, we tried to
shift around elements from the sidebar to make the topbar. Now, the
topbar gets its own elements, which can be styled on their own. This
makes styling and reasoning about those elements simpler.
Because the heading font sizes are bigger, increase the sidebar width
slightly.
As a very minor change, removed version from the "All types" page. It's
now only on the crate page.
2022-01-06 19:48:24 -05:00
|
|
|
padding: 0;
|
|
|
|
margin: 0;
|
2017-10-10 23:39:10 +02:00
|
|
|
}
|
|
|
|
|
2022-10-18 11:14:01 -07:00
|
|
|
.sidebar-elems,
|
|
|
|
.sidebar > h2 {
|
|
|
|
padding-left: 24px;
|
|
|
|
}
|
|
|
|
|
2023-01-19 16:30:05 -07:00
|
|
|
.sidebar a {
|
2022-09-24 15:49:10 +02:00
|
|
|
color: var(--sidebar-link-color);
|
|
|
|
}
|
|
|
|
.sidebar .current,
|
2023-01-04 13:04:30 -07:00
|
|
|
.sidebar a:hover:not(.logo-container) {
|
2022-09-24 15:49:10 +02:00
|
|
|
background-color: var(--sidebar-current-link-background-color);
|
|
|
|
}
|
|
|
|
|
2022-02-08 17:04:53 +01:00
|
|
|
.sidebar-elems .block {
|
Simplify and unify rustdoc sidebar styles
This switches to just use size, weight, and spacing to distinguish
headings in the sidebar. We no longer use boxes, horizontal bars, or
centering to distinguish headings. This makes it much easier to
understand the hierarchy of headings, and reduces visual noise.
I also refactored how the mobile topbar works. Previously, we tried to
shift around elements from the sidebar to make the topbar. Now, the
topbar gets its own elements, which can be styled on their own. This
makes styling and reasoning about those elements simpler.
Because the heading font sizes are bigger, increase the sidebar width
slightly.
As a very minor change, removed version from the "All types" page. It's
now only on the crate page.
2022-01-06 19:48:24 -05:00
|
|
|
margin-bottom: 2em;
|
2017-10-10 23:39:10 +02:00
|
|
|
}
|
|
|
|
|
2022-02-08 17:04:53 +01:00
|
|
|
.sidebar-elems .block li a {
|
|
|
|
white-space: nowrap;
|
2022-11-30 07:51:18 -07:00
|
|
|
text-overflow: ellipsis;
|
|
|
|
overflow: hidden;
|
2022-02-08 17:04:53 +01:00
|
|
|
}
|
|
|
|
|
Simplify and unify rustdoc sidebar styles
This switches to just use size, weight, and spacing to distinguish
headings in the sidebar. We no longer use boxes, horizontal bars, or
centering to distinguish headings. This makes it much easier to
understand the hierarchy of headings, and reduces visual noise.
I also refactored how the mobile topbar works. Previously, we tried to
shift around elements from the sidebar to make the topbar. Now, the
topbar gets its own elements, which can be styled on their own. This
makes styling and reasoning about those elements simpler.
Because the heading font sizes are bigger, increase the sidebar width
slightly.
As a very minor change, removed version from the "All types" page. It's
now only on the crate page.
2022-01-06 19:48:24 -05:00
|
|
|
.mobile-topbar {
|
2017-12-06 00:42:33 +01:00
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
2021-05-10 11:39:53 +02:00
|
|
|
.rustdoc .example-wrap {
|
2022-09-21 15:26:15 -07:00
|
|
|
display: flex;
|
2021-03-10 16:40:27 +01:00
|
|
|
position: relative;
|
2022-09-27 09:21:24 -07:00
|
|
|
margin-bottom: 10px;
|
|
|
|
}
|
|
|
|
/* For the last child of a div, the margin will be taken care of
|
|
|
|
by the margin-top of the next item. */
|
|
|
|
.rustdoc .example-wrap:last-child {
|
|
|
|
margin-bottom: 0px;
|
|
|
|
}
|
2018-10-08 22:51:37 +02:00
|
|
|
|
2021-05-10 11:39:53 +02:00
|
|
|
.rustdoc .example-wrap > pre {
|
2018-11-10 21:58:47 +01:00
|
|
|
margin: 0;
|
2022-10-25 10:43:08 -07:00
|
|
|
flex-grow: 1;
|
2023-01-24 16:46:45 +01:00
|
|
|
overflow: auto hidden;
|
2018-11-10 21:58:47 +01:00
|
|
|
}
|
|
|
|
|
2022-10-25 10:43:08 -07:00
|
|
|
.rustdoc .example-wrap > pre.example-line-numbers,
|
|
|
|
.rustdoc .example-wrap > pre.src-line-numbers {
|
|
|
|
flex-grow: 0;
|
2022-12-20 10:32:35 -07:00
|
|
|
min-width: fit-content; /* prevent collapsing into nothing in truncated scraped examples */
|
2022-10-25 10:43:08 -07:00
|
|
|
overflow: initial;
|
|
|
|
text-align: right;
|
2016-11-06 21:03:08 +01:00
|
|
|
-webkit-user-select: none;
|
|
|
|
user-select: none;
|
2022-12-23 22:55:04 -07:00
|
|
|
padding: 14px 8px;
|
|
|
|
color: var(--src-line-numbers-span-color);
|
2014-12-20 03:56:47 +09:00
|
|
|
}
|
2022-10-25 10:43:08 -07:00
|
|
|
|
2022-12-23 22:55:04 -07:00
|
|
|
.rustdoc .example-wrap > pre.src-line-numbers {
|
|
|
|
padding: 14px 0;
|
2022-10-25 10:43:08 -07:00
|
|
|
}
|
2022-11-12 08:53:12 -07:00
|
|
|
.src-line-numbers a, .src-line-numbers span {
|
2022-10-27 13:07:07 +02:00
|
|
|
color: var(--src-line-numbers-span-color);
|
2022-12-23 22:55:04 -07:00
|
|
|
padding: 0 8px;
|
2022-10-27 13:07:07 +02:00
|
|
|
}
|
|
|
|
.src-line-numbers :target {
|
|
|
|
background-color: transparent;
|
2022-10-28 09:51:57 -07:00
|
|
|
border-right: none;
|
2022-12-23 22:55:04 -07:00
|
|
|
padding: 0 8px;
|
2022-10-28 09:51:57 -07:00
|
|
|
}
|
|
|
|
.src-line-numbers .line-highlighted {
|
|
|
|
background-color: var(--src-line-number-highlighted-background-color);
|
2018-02-01 23:40:23 +01:00
|
|
|
}
|
2013-09-18 22:18:38 -07:00
|
|
|
|
2022-10-25 10:43:08 -07:00
|
|
|
.search-loading {
|
|
|
|
text-align: center;
|
|
|
|
}
|
|
|
|
|
2020-10-08 13:25:36 +02:00
|
|
|
.docblock-short {
|
2022-01-11 17:36:52 -08:00
|
|
|
overflow-wrap: break-word;
|
2020-10-08 13:25:36 +02:00
|
|
|
overflow-wrap: anywhere;
|
2013-09-18 22:18:38 -07:00
|
|
|
}
|
2021-03-29 21:49:58 +08:00
|
|
|
/* Wrap non-pre code blocks (`text`) but not (```text```). */
|
2022-12-13 10:46:27 -07:00
|
|
|
.docblock :not(pre) > code,
|
|
|
|
.docblock-short code {
|
2021-01-31 01:27:21 +08:00
|
|
|
white-space: pre-wrap;
|
|
|
|
}
|
2013-09-18 22:18:38 -07:00
|
|
|
|
2022-02-05 05:05:05 -08:00
|
|
|
.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 {
|
2022-02-05 05:05:05 -08:00
|
|
|
font-size: 1.125rem;
|
2021-10-18 21:04:38 -07:00
|
|
|
}
|
2021-10-01 06:17:15 -04:00
|
|
|
.top-doc .docblock h6 {
|
Set font size proportional to user's font size
According to MDN
(https://developer.mozilla.org/en-US/docs/Web/CSS/font-size),
> To maximize accessibility, it is generally best to use values that
> are relative to the user's default font size.
> Defining font sizes in px is not accessible, because the user cannot
> change the font size in some browsers.
Note that changing font size (in browser or OS settings) is distinct
from the zoom functionality triggered with Ctrl/Cmd-+. Zoom
functionality increases the size of everything on the page, effectively
applying a multiplier to all pixel sizes. Font size changes apply to
just text.
For relative font sizes, we could use `em`, as we do in several places
already. However that has a problem of "compounding" (see MDN article
for details). The compounding problem is nicely solved by `rem`, which
make font sizes relative to the root element, not the parent element.
Since we were using a hodge-podge of pixel sizes, em, rem, and
percentage sizes before, this change switching everything to rem, while
keeping the same size relative to our old default of 16px.
16px is still the default on most browsers, for users that haven't set a
larger or smaller font size.
2021-12-30 16:42:06 -05:00
|
|
|
font-size: 1rem;
|
2021-05-16 20:47:03 -07:00
|
|
|
}
|
2017-08-01 17:08:33 -05:00
|
|
|
|
Set font size proportional to user's font size
According to MDN
(https://developer.mozilla.org/en-US/docs/Web/CSS/font-size),
> To maximize accessibility, it is generally best to use values that
> are relative to the user's default font size.
> Defining font sizes in px is not accessible, because the user cannot
> change the font size in some browsers.
Note that changing font size (in browser or OS settings) is distinct
from the zoom functionality triggered with Ctrl/Cmd-+. Zoom
functionality increases the size of everything on the page, effectively
applying a multiplier to all pixel sizes. Font size changes apply to
just text.
For relative font sizes, we could use `em`, as we do in several places
already. However that has a problem of "compounding" (see MDN article
for details). The compounding problem is nicely solved by `rem`, which
make font sizes relative to the root element, not the parent element.
Since we were using a hodge-podge of pixel sizes, em, rem, and
percentage sizes before, this change switching everything to rem, while
keeping the same size relative to our old default of 16px.
16px is still the default on most browsers, for users that haven't set a
larger or smaller font size.
2021-12-30 16:42:06 -05:00
|
|
|
.docblock h5 { font-size: 1rem; }
|
2022-02-05 05:05:05 -08:00
|
|
|
.docblock h6 { font-size: 0.875rem; }
|
2013-09-18 22:18:38 -07:00
|
|
|
|
2016-05-27 12:04:56 +02:00
|
|
|
.docblock {
|
2016-11-06 21:03:08 +01:00
|
|
|
margin-left: 24px;
|
2017-09-17 22:11:37 +02:00
|
|
|
position: relative;
|
2016-05-27 12:04:56 +02:00
|
|
|
}
|
|
|
|
|
2022-09-08 17:46:57 -07:00
|
|
|
.docblock > :not(.more-examples-toggle):not(.example-wrap) {
|
2021-09-08 15:08:11 +02:00
|
|
|
max-width: 100%;
|
|
|
|
overflow-x: auto;
|
|
|
|
}
|
|
|
|
|
2022-09-25 13:09:22 -07:00
|
|
|
.out-of-band {
|
2021-04-22 22:33:54 +02:00
|
|
|
flex-grow: 0;
|
2022-02-05 05:05:05 -08:00
|
|
|
font-size: 1.125rem;
|
2016-05-05 04:46:45 +02:00
|
|
|
}
|
|
|
|
|
2022-07-11 14:51:39 +02:00
|
|
|
.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;
|
|
|
|
}
|
2016-05-06 18:47:12 +02:00
|
|
|
|
2015-02-15 15:58:45 +02:00
|
|
|
.docblock table {
|
2016-11-06 21:03:08 +01:00
|
|
|
margin: .5em 0;
|
2022-09-26 09:54:44 -07:00
|
|
|
border-collapse: collapse;
|
2015-02-15 15:58:45 +02:00
|
|
|
}
|
|
|
|
|
2022-12-07 21:59:54 -07:00
|
|
|
.docblock table td, .docblock table th {
|
2016-11-06 21:03:08 +01:00
|
|
|
padding: .5em;
|
2022-12-07 21:59:54 -07:00
|
|
|
border: 1px solid var(--border-color);
|
2015-02-15 15:58:45 +02:00
|
|
|
}
|
|
|
|
|
2022-12-08 09:38:27 -07:00
|
|
|
.docblock table tbody tr:nth-child(2n) {
|
2022-12-07 21:59:54 -07:00
|
|
|
background: var(--table-alt-row-background-color);
|
2015-02-15 15:58:45 +02:00
|
|
|
}
|
|
|
|
|
2015-05-31 22:46:19 +02:00
|
|
|
/* Shift "where ..." part of method or fn definition down a line */
|
2022-10-11 09:22:40 -07:00
|
|
|
.method .where,
|
|
|
|
.fn .where,
|
|
|
|
.where.fmt-newline {
|
2017-03-09 19:02:59 +01:00
|
|
|
display: block;
|
2023-02-02 15:10:41 -07:00
|
|
|
white-space: pre-wrap;
|
2022-02-05 05:05:05 -08:00
|
|
|
font-size: 0.875rem;
|
2016-10-15 10:29:47 -05:00
|
|
|
}
|
2014-12-27 22:45:13 -05:00
|
|
|
|
2022-04-06 20:41:44 +02:00
|
|
|
.item-info {
|
|
|
|
display: block;
|
2022-10-12 11:24:23 -07:00
|
|
|
margin-left: 24px;
|
2022-04-06 20:41:44 +02:00
|
|
|
}
|
|
|
|
|
2022-10-12 11:24:23 -07:00
|
|
|
.item-info code {
|
2022-02-05 05:05:05 -08:00
|
|
|
font-size: 0.875rem;
|
2015-08-17 20:23:47 +02:00
|
|
|
}
|
|
|
|
|
2021-11-29 17:14:05 +01:00
|
|
|
#main-content > .item-info {
|
2022-01-07 12:39:56 -05:00
|
|
|
margin-left: 0;
|
2018-08-27 21:52:10 +02:00
|
|
|
}
|
|
|
|
|
Simplify and unify rustdoc sidebar styles
This switches to just use size, weight, and spacing to distinguish
headings in the sidebar. We no longer use boxes, horizontal bars, or
centering to distinguish headings. This makes it much easier to
understand the hierarchy of headings, and reduces visual noise.
I also refactored how the mobile topbar works. Previously, we tried to
shift around elements from the sidebar to make the topbar. Now, the
topbar gets its own elements, which can be styled on their own. This
makes styling and reasoning about those elements simpler.
Because the heading font sizes are bigger, increase the sidebar width
slightly.
As a very minor change, removed version from the "All types" page. It's
now only on the crate page.
2022-01-06 19:48:24 -05:00
|
|
|
nav.sub {
|
2021-10-24 22:41:48 +02:00
|
|
|
flex-grow: 1;
|
2022-10-20 13:22:36 -07:00
|
|
|
flex-flow: row nowrap;
|
|
|
|
margin: 4px 0 25px 0;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
}
|
2022-10-27 13:36:27 -07:00
|
|
|
.search-form {
|
|
|
|
position: relative;
|
|
|
|
display: flex;
|
|
|
|
height: 34px;
|
2022-10-20 13:22:36 -07:00
|
|
|
flex-grow: 1;
|
2013-09-18 22:18:38 -07:00
|
|
|
}
|
Simplify and unify rustdoc sidebar styles
This switches to just use size, weight, and spacing to distinguish
headings in the sidebar. We no longer use boxes, horizontal bars, or
centering to distinguish headings. This makes it much easier to
understand the hierarchy of headings, and reduces visual noise.
I also refactored how the mobile topbar works. Previously, we tried to
shift around elements from the sidebar to make the topbar. Now, the
topbar gets its own elements, which can be styled on their own. This
makes styling and reasoning about those elements simpler.
Because the heading font sizes are bigger, increase the sidebar width
slightly.
As a very minor change, removed version from the "All types" page. It's
now only on the crate page.
2022-01-06 19:48:24 -05:00
|
|
|
.source nav.sub {
|
2022-10-20 13:22:36 -07:00
|
|
|
margin: 0 0 15px 0;
|
|
|
|
}
|
2013-09-18 22:18:38 -07:00
|
|
|
|
2021-06-17 09:57:48 +02:00
|
|
|
.small-section-header {
|
2022-11-22 14:48:58 -07:00
|
|
|
/* fields use <span> tags, but should get their own lines */
|
|
|
|
display: block;
|
2021-06-17 09:57:48 +02:00
|
|
|
position: relative;
|
|
|
|
}
|
|
|
|
|
2022-12-20 12:44:22 -07:00
|
|
|
.small-section-header:hover > .anchor, .impl:hover > .anchor,
|
|
|
|
.trait-impl:hover > .anchor, .variant:hover > .anchor {
|
2017-08-08 22:16:08 +02:00
|
|
|
display: initial;
|
|
|
|
}
|
|
|
|
.anchor {
|
|
|
|
display: none;
|
2017-09-17 22:11:37 +02:00
|
|
|
position: absolute;
|
2021-10-21 18:46:47 -07:00
|
|
|
left: -0.5em;
|
2021-08-06 16:47:35 +02:00
|
|
|
background: none !important;
|
2017-08-08 22:16:08 +02:00
|
|
|
}
|
2017-09-17 22:11:37 +02:00
|
|
|
.anchor.field {
|
2018-02-17 20:46:06 +03:00
|
|
|
left: -5px;
|
2017-09-17 22:11:37 +02:00
|
|
|
}
|
2018-03-06 22:05:41 +01:00
|
|
|
.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;
|
2018-03-06 22:05:41 +01:00
|
|
|
}
|
2017-08-08 22:16:08 +02:00
|
|
|
|
2022-10-07 17:05:30 -07:00
|
|
|
.main-heading a:hover,
|
|
|
|
.example-wrap > pre.rust a:hover,
|
2022-09-16 13:40:21 -07:00
|
|
|
.all-items a:hover,
|
2022-10-06 11:20:37 -07:00
|
|
|
.docblock a:not(.test-arrow):not(.scrape-help):hover,
|
|
|
|
.docblock-short a:not(.test-arrow):not(.scrape-help):hover,
|
|
|
|
.item-info a {
|
2016-11-06 21:03:08 +01:00
|
|
|
text-decoration: underline;
|
2015-02-20 13:54:11 +02:00
|
|
|
}
|
2013-09-18 22:18:38 -07:00
|
|
|
|
2022-10-10 11:37:19 -07:00
|
|
|
.crate.block a.current { font-weight: 500; }
|
2013-09-18 22:18:38 -07:00
|
|
|
|
2022-01-20 14:47:26 -08:00
|
|
|
/* In most contexts we use `overflow-wrap: anywhere` to ensure that we can wrap
|
|
|
|
as much as needed on mobile (see
|
2023-01-05 09:45:44 +01:00
|
|
|
tests/rustdoc-gui/type-declaration-overflow.goml for an example of why
|
2022-01-20 14:47:26 -08:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2021-06-18 00:33:42 +02:00
|
|
|
.item-table {
|
2021-10-11 00:38:56 +02:00
|
|
|
display: table;
|
2021-05-25 00:36:36 +02:00
|
|
|
}
|
2021-09-12 01:18:39 +02:00
|
|
|
.item-row {
|
|
|
|
display: table-row;
|
|
|
|
}
|
2021-06-18 00:33:42 +02:00
|
|
|
.item-left, .item-right {
|
2021-09-12 01:18:39 +02:00
|
|
|
display: table-cell;
|
2021-05-25 00:36:36 +02:00
|
|
|
}
|
2021-06-18 00:33:42 +02:00
|
|
|
.item-left {
|
2022-02-05 05:05:05 -08:00
|
|
|
padding-right: 1.25rem;
|
2021-05-25 00:36:36 +02:00
|
|
|
}
|
|
|
|
|
2022-01-01 23:48:34 -05:00
|
|
|
.search-results-title {
|
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 */
|
2022-11-23 13:28:06 -07:00
|
|
|
display: flex;
|
2022-07-03 20:10:19 +02:00
|
|
|
/* 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;
|
2022-01-01 23:48:34 -05:00
|
|
|
}
|
2022-07-03 20:10:19 +02:00
|
|
|
#crate-search-div {
|
|
|
|
/* 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;
|
2022-01-01 23:48:34 -05:00
|
|
|
}
|
2018-10-01 00:47:54 +02:00
|
|
|
#crate-search {
|
2021-02-19 17:54:41 -08:00
|
|
|
min-width: 115px;
|
2022-07-03 20:10:19 +02:00
|
|
|
/* keep these two in sync with "@-moz-document url-prefix()" below */
|
2022-10-29 09:04:31 -07:00
|
|
|
padding: 0 23px 0 4px;
|
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;
|
2022-08-13 14:00:23 +02:00
|
|
|
border: 1px solid var(--border-color);
|
2022-01-01 23:48:34 -05:00
|
|
|
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 */
|
2022-07-03 20:10:19 +02:00
|
|
|
text-indent: 0.01px;
|
|
|
|
background-color: var(--main-background-color);
|
2022-09-28 13:52:13 -07:00
|
|
|
color: inherit;
|
|
|
|
line-height: 1.5;
|
|
|
|
font-weight: 500;
|
2022-07-03 20:10:19 +02:00
|
|
|
}
|
2022-11-07 18:08:14 +01:00
|
|
|
#crate-search:hover, #crate-search:focus {
|
|
|
|
border-color: var(--crate-search-hover-border);
|
|
|
|
}
|
2022-07-11 21:52:26 +02:00
|
|
|
/* cancel stylistic differences in padding in firefox
|
|
|
|
for "appearance: none"-style (or equivalent) <select>s */
|
2022-07-03 20:10:19 +02:00
|
|
|
@-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;
|
2022-07-03 20:10:19 +02:00
|
|
|
background-position: calc(100% - 2px) 56%;
|
2023-01-31 21:23:23 +01:00
|
|
|
/* down arrow (image is black color) */
|
|
|
|
background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" \
|
|
|
|
width="128" height="128" viewBox="-30 -20 176 176"><path d="M111,40.5L64,87.499L17,40.5" \
|
|
|
|
fill="none" stroke="black" strike-linecap="square" stroke-miterlimit="10" stroke-width="12"/> \
|
|
|
|
</svg>');
|
2022-11-07 18:08:14 +01:00
|
|
|
/* changes the arrow image color */
|
|
|
|
filter: var(--crate-search-div-filter);
|
|
|
|
}
|
|
|
|
#crate-search-div:hover::after, #crate-search-div:focus-within::after {
|
|
|
|
filter: var(--crate-search-div-hover-filter);
|
2022-07-03 20:10:19 +02:00
|
|
|
}
|
|
|
|
#crate-search > option {
|
|
|
|
font-size: 1rem;
|
2018-10-01 00:47:54 +02:00
|
|
|
}
|
2013-09-18 22:18:38 -07:00
|
|
|
.search-input {
|
2021-12-08 23:39:42 -08:00
|
|
|
/* 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;
|
2016-11-06 21:03:08 +01:00
|
|
|
outline: none;
|
2022-08-13 14:00:23 +02:00
|
|
|
border: 1px solid var(--border-color);
|
2022-01-20 14:18:59 +01:00
|
|
|
border-radius: 2px;
|
2022-01-27 17:55:39 +01:00
|
|
|
padding: 8px;
|
2022-02-05 05:05:05 -08:00
|
|
|
font-size: 1rem;
|
2022-10-27 13:36:27 -07:00
|
|
|
flex-grow: 1;
|
2022-08-13 14:00:23 +02:00
|
|
|
background-color: var(--button-background-color);
|
2022-10-06 13:01:07 +02:00
|
|
|
color: var(--search-color);
|
2014-03-18 01:44:55 -06:00
|
|
|
}
|
2022-09-02 15:08:23 +02:00
|
|
|
.search-input:focus {
|
|
|
|
border-color: var(--search-input-focused-border-color);
|
|
|
|
}
|
2014-03-18 01:44:55 -06:00
|
|
|
|
2021-05-09 12:56:21 -07:00
|
|
|
.search-results {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.search-results.active {
|
|
|
|
display: block;
|
|
|
|
}
|
|
|
|
|
2021-05-21 16:39:03 +02:00
|
|
|
.search-results > a {
|
2022-11-04 12:34:24 -07:00
|
|
|
display: flex;
|
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;
|
2022-11-04 22:36:04 +01:00
|
|
|
border-bottom: 1px solid var(--search-result-border-color);
|
2022-11-04 12:34:24 -07:00
|
|
|
gap: 1em;
|
2014-08-31 17:11:42 -04:00
|
|
|
}
|
|
|
|
|
2021-05-21 16:39:03 +02:00
|
|
|
.search-results > a > div {
|
2022-11-04 12:34:24 -07:00
|
|
|
flex: 1;
|
2022-11-04 13:19:33 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
.search-results > a > div.desc {
|
|
|
|
white-space: nowrap;
|
|
|
|
text-overflow: ellipsis;
|
2022-11-04 12:34:24 -07:00
|
|
|
overflow: hidden;
|
2021-05-21 16:39:03 +02:00
|
|
|
}
|
|
|
|
|
2022-10-01 15:50:47 +02:00
|
|
|
.search-results a:hover,
|
|
|
|
.search-results a:focus {
|
|
|
|
background-color: var(--search-result-link-focus-background-color);
|
|
|
|
}
|
|
|
|
|
2022-11-21 11:15:41 +01:00
|
|
|
.search-results .result-name span.alias {
|
|
|
|
color: var(--search-results-alias-color);
|
|
|
|
}
|
|
|
|
.search-results .result-name span.grey {
|
|
|
|
color: var(--search-results-grey-color);
|
|
|
|
}
|
|
|
|
|
2022-06-20 16:28:52 +02:00
|
|
|
.popover {
|
|
|
|
position: absolute;
|
2022-12-01 14:24:33 -07:00
|
|
|
top: 100%;
|
2022-06-20 16:28:52 +02:00
|
|
|
right: 0;
|
|
|
|
z-index: 2;
|
|
|
|
margin-top: 7px;
|
|
|
|
border-radius: 3px;
|
2022-08-13 14:00:23 +02:00
|
|
|
border: 1px solid var(--border-color);
|
2022-12-13 11:00:34 -07:00
|
|
|
background-color: var(--main-background-color);
|
|
|
|
color: var(--main-color);
|
2022-11-08 18:00:22 -07:00
|
|
|
--popover-arrow-offset: 11px;
|
2015-07-08 14:52:58 +01:00
|
|
|
}
|
|
|
|
|
2022-06-20 16:28:52 +02:00
|
|
|
/* This rule is to draw the little arrow connecting the settings menu to the gear icon. */
|
|
|
|
.popover::before {
|
|
|
|
content: '';
|
|
|
|
position: absolute;
|
2022-11-08 18:00:22 -07:00
|
|
|
right: var(--popover-arrow-offset);
|
2022-08-13 14:00:23 +02:00
|
|
|
border: solid var(--border-color);
|
2022-06-20 16:28:52 +02:00
|
|
|
border-width: 1px 1px 0 0;
|
2022-12-13 11:00:34 -07:00
|
|
|
background-color: var(--main-background-color);
|
2022-06-20 16:28:52 +02:00
|
|
|
padding: 4px;
|
|
|
|
transform: rotate(-45deg);
|
|
|
|
top: -5px;
|
2015-07-08 14:52:58 +01:00
|
|
|
}
|
2022-06-20 16:28:52 +02:00
|
|
|
|
2022-10-14 09:48:19 -07:00
|
|
|
/* use larger max-width for help popover, but not for help.html */
|
|
|
|
#help.popover {
|
2022-06-20 16:28:52 +02:00
|
|
|
max-width: 600px;
|
2022-11-08 18:00:22 -07:00
|
|
|
--popover-arrow-offset: 48px;
|
2022-06-20 16:28:52 +02:00
|
|
|
}
|
|
|
|
|
2022-10-14 09:48:19 -07:00
|
|
|
#help dt {
|
2016-11-06 21:03:08 +01:00
|
|
|
float: left;
|
|
|
|
clear: left;
|
2021-02-02 16:15:57 -05:00
|
|
|
margin-right: 0.5rem;
|
2013-09-18 22:18:38 -07:00
|
|
|
}
|
2022-10-14 09:48:19 -07:00
|
|
|
#help span.top, #help span.bottom {
|
2020-10-19 13:44:27 +02:00
|
|
|
text-align: center;
|
|
|
|
display: block;
|
Set font size proportional to user's font size
According to MDN
(https://developer.mozilla.org/en-US/docs/Web/CSS/font-size),
> To maximize accessibility, it is generally best to use values that
> are relative to the user's default font size.
> Defining font sizes in px is not accessible, because the user cannot
> change the font size in some browsers.
Note that changing font size (in browser or OS settings) is distinct
from the zoom functionality triggered with Ctrl/Cmd-+. Zoom
functionality increases the size of everything on the page, effectively
applying a multiplier to all pixel sizes. Font size changes apply to
just text.
For relative font sizes, we could use `em`, as we do in several places
already. However that has a problem of "compounding" (see MDN article
for details). The compounding problem is nicely solved by `rem`, which
make font sizes relative to the root element, not the parent element.
Since we were using a hodge-podge of pixel sizes, em, rem, and
percentage sizes before, this change switching everything to rem, while
keeping the same size relative to our old default of 16px.
16px is still the default on most browsers, for users that haven't set a
larger or smaller font size.
2021-12-30 16:42:06 -05:00
|
|
|
font-size: 1.125rem;
|
2021-09-15 13:37:29 +02:00
|
|
|
}
|
2022-10-14 09:48:19 -07:00
|
|
|
#help span.top {
|
2021-09-15 13:37:29 +02:00
|
|
|
margin: 10px 0;
|
2022-08-13 14:00:23 +02:00
|
|
|
border-bottom: 1px solid var(--border-color);
|
2020-10-19 13:44:27 +02:00
|
|
|
padding-bottom: 4px;
|
|
|
|
margin-bottom: 6px;
|
|
|
|
}
|
2022-10-14 09:48:19 -07:00
|
|
|
#help span.bottom {
|
2021-09-15 13:37:29 +02:00
|
|
|
clear: both;
|
2022-08-13 14:00:23 +02:00
|
|
|
border-top: 1px solid var(--border-color);
|
2021-09-15 13:37:29 +02:00
|
|
|
}
|
2022-06-20 16:28:52 +02:00
|
|
|
.side-by-side > div {
|
2016-11-06 21:03:08 +01:00
|
|
|
width: 50%;
|
|
|
|
float: left;
|
2022-06-20 16:28:52 +02:00
|
|
|
padding: 0 20px 20px 17px;
|
2013-09-18 22:18:38 -07:00
|
|
|
}
|
2013-09-26 12:53:06 -07:00
|
|
|
|
2021-07-18 12:25:49 +02:00
|
|
|
.item-info .stab {
|
2022-07-26 21:34:56 +02:00
|
|
|
/* This min-height is needed to unify the height of the stab elements because some of them
|
|
|
|
have emojis.
|
|
|
|
*/
|
|
|
|
min-height: 36px;
|
|
|
|
display: flex;
|
2016-11-06 21:03:08 +01:00
|
|
|
padding: 3px;
|
|
|
|
margin-bottom: 5px;
|
2022-12-09 10:40:49 -07:00
|
|
|
}
|
|
|
|
.item-left .stab {
|
|
|
|
margin-left: 0.3125em;
|
|
|
|
}
|
|
|
|
.stab {
|
|
|
|
padding: 0 2px;
|
2022-02-05 05:05:05 -08:00
|
|
|
font-size: 0.875rem;
|
2021-06-08 11:04:53 -07:00
|
|
|
font-weight: normal;
|
2022-10-03 15:31:59 +02:00
|
|
|
color: var(--main-color);
|
|
|
|
background-color: var(--stab-background-color);
|
2022-12-09 10:40:49 -07:00
|
|
|
width: fit-content;
|
|
|
|
align-items: center;
|
|
|
|
white-space: pre-wrap;
|
|
|
|
border-radius: 3px;
|
|
|
|
display: inline-flex;
|
|
|
|
vertical-align: text-bottom;
|
2022-10-03 15:31:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
.stab.portability > code {
|
|
|
|
background: none;
|
|
|
|
color: var(--stab-code-color);
|
2014-06-26 11:37:39 -07:00
|
|
|
}
|
|
|
|
|
2018-12-12 22:51:04 -05:00
|
|
|
.stab .emoji {
|
2022-02-05 05:05:05 -08:00
|
|
|
font-size: 1.25rem;
|
2022-08-18 15:47:39 +02:00
|
|
|
margin-right: 0.3rem;
|
2017-01-04 22:09:54 -08:00
|
|
|
}
|
|
|
|
|
2021-03-23 12:23:45 +01:00
|
|
|
/* 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;
|
|
|
|
}
|
|
|
|
|
2016-05-06 18:47:12 +02:00
|
|
|
.since {
|
2016-11-06 21:03:08 +01:00
|
|
|
font-weight: normal;
|
|
|
|
font-size: initial;
|
2016-02-09 21:15:29 -05:00
|
|
|
}
|
|
|
|
|
2021-12-03 17:09:04 -08:00
|
|
|
.rightside {
|
2018-12-26 21:23:05 -08:00
|
|
|
padding-left: 12px;
|
2022-08-27 00:37:04 +02:00
|
|
|
float: right;
|
2018-12-26 21:23:05 -08:00
|
|
|
}
|
|
|
|
|
2022-09-02 15:08:23 +02:00
|
|
|
.rightside:not(a),
|
|
|
|
.out-of-band {
|
|
|
|
color: var(--right-side-color);
|
|
|
|
}
|
|
|
|
|
2022-10-04 16:56:56 +02:00
|
|
|
pre.rust {
|
|
|
|
tab-size: 4;
|
|
|
|
-moz-tab-size: 4;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Code highlighting */
|
|
|
|
pre.rust .kw {
|
|
|
|
color: var(--code-highlight-kw-color);
|
|
|
|
}
|
|
|
|
pre.rust .kw-2 {
|
|
|
|
color: var(--code-highlight-kw-2-color);
|
|
|
|
}
|
|
|
|
pre.rust .lifetime {
|
|
|
|
color: var(--code-highlight-lifetime-color);
|
|
|
|
}
|
|
|
|
pre.rust .prelude-ty {
|
|
|
|
color: var(--code-highlight-prelude-color);
|
|
|
|
}
|
|
|
|
pre.rust .prelude-val {
|
|
|
|
color: var(--code-highlight-prelude-val-color);
|
|
|
|
}
|
|
|
|
pre.rust .string {
|
|
|
|
color: var(--code-highlight-string-color);
|
|
|
|
}
|
|
|
|
pre.rust .number {
|
|
|
|
color: var(--code-highlight-number-color);
|
|
|
|
}
|
|
|
|
pre.rust .bool-val {
|
|
|
|
color: var(--code-highlight-literal-color);
|
|
|
|
}
|
|
|
|
pre.rust .self {
|
|
|
|
color: var(--code-highlight-self-color);
|
|
|
|
}
|
2022-10-31 13:12:51 -07:00
|
|
|
pre.rust .attr {
|
2022-10-04 16:56:56 +02:00
|
|
|
color: var(--code-highlight-attribute-color);
|
|
|
|
}
|
|
|
|
pre.rust .macro,
|
|
|
|
pre.rust .macro-nonterminal {
|
|
|
|
color: var(--code-highlight-macro-color);
|
|
|
|
}
|
2016-10-12 05:23:37 +02:00
|
|
|
pre.rust .question-mark {
|
2016-11-06 21:03:08 +01:00
|
|
|
font-weight: bold;
|
2022-10-04 16:56:56 +02:00
|
|
|
color: var(--code-highlight-question-mark-color);
|
|
|
|
}
|
|
|
|
pre.rust .comment {
|
|
|
|
color: var(--code-highlight-comment-color);
|
|
|
|
}
|
|
|
|
pre.rust .doccomment {
|
|
|
|
color: var(--code-highlight-doc-comment-color);
|
2016-10-12 05:23:37 +02:00
|
|
|
}
|
2014-03-04 11:24:20 -08:00
|
|
|
|
2022-12-15 08:55:23 +01:00
|
|
|
.rustdoc.source .example-wrap pre.rust a {
|
|
|
|
background: var(--codeblock-link-background);
|
|
|
|
}
|
|
|
|
|
2022-09-09 16:18:14 +02:00
|
|
|
.example-wrap.compile_fail,
|
|
|
|
.example-wrap.should_panic {
|
2022-09-08 23:40:13 +02:00
|
|
|
border-left: 2px solid var(--codeblock-error-color);
|
|
|
|
}
|
|
|
|
|
2022-09-09 16:18:14 +02:00
|
|
|
.ignore.example-wrap {
|
2022-09-08 23:40:13 +02:00
|
|
|
border-left: 2px solid var(--codeblock-ignore-color);
|
|
|
|
}
|
|
|
|
|
2022-09-09 16:18:14 +02:00
|
|
|
.example-wrap.compile_fail:hover,
|
|
|
|
.example-wrap.should_panic:hover {
|
2022-09-08 23:40:13 +02:00
|
|
|
border-left: 2px solid var(--codeblock-error-hover-color);
|
|
|
|
}
|
|
|
|
|
2022-09-09 16:18:14 +02:00
|
|
|
.example-wrap.ignore:hover {
|
2022-09-08 23:40:13 +02:00
|
|
|
border-left: 2px solid var(--codeblock-ignore-hover-color);
|
|
|
|
}
|
|
|
|
|
2022-09-09 16:18:14 +02:00
|
|
|
.example-wrap.compile_fail .tooltip,
|
|
|
|
.example-wrap.should_panic .tooltip {
|
2022-09-08 23:40:13 +02:00
|
|
|
color: var(--codeblock-error-color);
|
|
|
|
}
|
|
|
|
|
2022-09-09 16:18:14 +02:00
|
|
|
.example-wrap.ignore .tooltip {
|
2022-09-08 23:40:13 +02:00
|
|
|
color: var(--codeblock-ignore-color);
|
|
|
|
}
|
|
|
|
|
2022-09-09 16:18:14 +02:00
|
|
|
.example-wrap.compile_fail:hover .tooltip,
|
|
|
|
.example-wrap.should_panic:hover .tooltip {
|
2022-09-08 23:40:13 +02:00
|
|
|
color: var(--codeblock-error-hover-color);
|
|
|
|
}
|
|
|
|
|
2022-09-09 16:18:14 +02:00
|
|
|
.example-wrap.ignore:hover .tooltip {
|
2022-09-08 23:40:13 +02:00
|
|
|
color: var(--codeblock-ignore-hover-color);
|
|
|
|
}
|
|
|
|
|
2022-09-09 16:18:14 +02:00
|
|
|
.example-wrap .tooltip {
|
|
|
|
position: absolute;
|
|
|
|
display: block;
|
|
|
|
left: -25px;
|
|
|
|
top: 5px;
|
|
|
|
}
|
|
|
|
|
2022-12-15 12:05:27 -07:00
|
|
|
.example-wrap .tooltip:hover::after {
|
2022-09-09 16:18:14 +02:00
|
|
|
padding: 5px 3px 3px 3px;
|
|
|
|
border-radius: 6px;
|
|
|
|
margin-left: 5px;
|
|
|
|
font-size: 1rem;
|
|
|
|
border: 1px solid var(--border-color);
|
|
|
|
position: absolute;
|
|
|
|
width: max-content;
|
|
|
|
top: -2px;
|
|
|
|
z-index: 1;
|
2022-11-17 14:31:34 +01:00
|
|
|
background-color: var(--tooltip-background-color);
|
|
|
|
color: var(--tooltip-color);
|
2022-09-09 16:18:14 +02:00
|
|
|
}
|
|
|
|
|
2022-12-15 12:05:27 -07:00
|
|
|
.example-wrap .tooltip:hover::before {
|
2022-09-09 16:18:14 +02:00
|
|
|
content: " ";
|
|
|
|
position: absolute;
|
|
|
|
top: 50%;
|
|
|
|
left: 16px;
|
|
|
|
margin-top: -5px;
|
|
|
|
z-index: 1;
|
2022-11-17 14:31:34 +01:00
|
|
|
border: 5px solid transparent;
|
|
|
|
border-right-color: var(--tooltip-background-color);
|
2022-09-09 16:18:14 +02:00
|
|
|
}
|
|
|
|
|
2022-12-15 12:05:27 -07:00
|
|
|
.example-wrap.ignore .tooltip:hover::after {
|
2022-09-09 16:18:14 +02:00
|
|
|
content: "This example is not tested";
|
|
|
|
}
|
2022-12-15 12:05:27 -07:00
|
|
|
.example-wrap.compile_fail .tooltip:hover::after {
|
2022-09-09 16:18:14 +02:00
|
|
|
content: "This example deliberately fails to compile";
|
|
|
|
}
|
2022-12-15 12:05:27 -07:00
|
|
|
.example-wrap.should_panic .tooltip:hover::after {
|
2022-09-09 16:18:14 +02:00
|
|
|
content: "This example panics";
|
|
|
|
}
|
2022-12-15 12:05:27 -07:00
|
|
|
.example-wrap.edition .tooltip:hover::after {
|
2022-09-09 16:18:14 +02:00
|
|
|
content: "This code runs with edition " attr(data-edition);
|
|
|
|
}
|
|
|
|
|
|
|
|
.example-wrap.compile_fail .tooltip,
|
|
|
|
.example-wrap.should_panic .tooltip,
|
|
|
|
.example-wrap.ignore .tooltip {
|
|
|
|
font-weight: bold;
|
|
|
|
font-size: 1.25rem;
|
|
|
|
}
|
|
|
|
|
2015-10-14 15:05:21 -04:00
|
|
|
a.test-arrow {
|
2021-12-17 22:38:18 -08:00
|
|
|
visibility: hidden;
|
2016-11-06 21:03:08 +01:00
|
|
|
position: absolute;
|
|
|
|
padding: 5px 10px 5px 10px;
|
|
|
|
border-radius: 5px;
|
2022-02-05 05:05:05 -08:00
|
|
|
font-size: 1.375rem;
|
2016-11-06 21:03:08 +01:00
|
|
|
top: 5px;
|
|
|
|
right: 5px;
|
2020-01-26 17:24:40 +01:00
|
|
|
z-index: 1;
|
2022-11-05 17:22:25 +01:00
|
|
|
color: var(--test-arrow-color);
|
|
|
|
background-color: var(--test-arrow-background-color);
|
|
|
|
}
|
|
|
|
a.test-arrow:hover {
|
|
|
|
color: var(--test-arrow-hover-color);
|
|
|
|
background-color: var(--test-arrow-hover-background-color);
|
2014-06-06 09:12:18 -07:00
|
|
|
}
|
2021-12-17 22:38:18 -08:00
|
|
|
.example-wrap:hover .test-arrow {
|
|
|
|
visibility: visible;
|
|
|
|
}
|
2015-02-20 13:54:11 +02:00
|
|
|
|
2021-04-17 18:08:50 -07:00
|
|
|
.code-attribute {
|
|
|
|
font-weight: 300;
|
2022-09-02 15:08:23 +02:00
|
|
|
color: var(--code-attribute-color);
|
2021-04-17 18:08:50 -07:00
|
|
|
}
|
|
|
|
|
2017-07-09 00:40:29 +02:00
|
|
|
.item-spacer {
|
|
|
|
width: 100%;
|
|
|
|
height: 12px;
|
2022-11-26 01:51:50 +01:00
|
|
|
display: block;
|
2017-07-09 00:40:29 +02:00
|
|
|
}
|
|
|
|
|
2019-05-03 12:55:31 -04:00
|
|
|
.out-of-band > span.since {
|
Set font size proportional to user's font size
According to MDN
(https://developer.mozilla.org/en-US/docs/Web/CSS/font-size),
> To maximize accessibility, it is generally best to use values that
> are relative to the user's default font size.
> Defining font sizes in px is not accessible, because the user cannot
> change the font size in some browsers.
Note that changing font size (in browser or OS settings) is distinct
from the zoom functionality triggered with Ctrl/Cmd-+. Zoom
functionality increases the size of everything on the page, effectively
applying a multiplier to all pixel sizes. Font size changes apply to
just text.
For relative font sizes, we could use `em`, as we do in several places
already. However that has a problem of "compounding" (see MDN article
for details). The compounding problem is nicely solved by `rem`, which
make font sizes relative to the root element, not the parent element.
Since we were using a hodge-podge of pixel sizes, em, rem, and
percentage sizes before, this change switching everything to rem, while
keeping the same size relative to our old default of 16px.
16px is still the default on most browsers, for users that haven't set a
larger or smaller font size.
2021-12-30 16:42:06 -05:00
|
|
|
font-size: 1.25rem;
|
2016-05-10 21:01:10 +02:00
|
|
|
}
|
|
|
|
|
2021-10-19 22:48:53 -07:00
|
|
|
.sub-variant h4 {
|
Set font size proportional to user's font size
According to MDN
(https://developer.mozilla.org/en-US/docs/Web/CSS/font-size),
> To maximize accessibility, it is generally best to use values that
> are relative to the user's default font size.
> Defining font sizes in px is not accessible, because the user cannot
> change the font size in some browsers.
Note that changing font size (in browser or OS settings) is distinct
from the zoom functionality triggered with Ctrl/Cmd-+. Zoom
functionality increases the size of everything on the page, effectively
applying a multiplier to all pixel sizes. Font size changes apply to
just text.
For relative font sizes, we could use `em`, as we do in several places
already. However that has a problem of "compounding" (see MDN article
for details). The compounding problem is nicely solved by `rem`, which
make font sizes relative to the root element, not the parent element.
Since we were using a hodge-podge of pixel sizes, em, rem, and
percentage sizes before, this change switching everything to rem, while
keeping the same size relative to our old default of 16px.
16px is still the default on most browsers, for users that haven't set a
larger or smaller font size.
2021-12-30 16:42:06 -05:00
|
|
|
font-size: 1rem;
|
2021-10-19 22:48:53 -07:00
|
|
|
font-weight: 400;
|
|
|
|
margin-top: 0;
|
|
|
|
margin-bottom: 0;
|
2018-10-19 01:34:46 +02:00
|
|
|
}
|
|
|
|
|
2021-10-19 22:48:53 -07:00
|
|
|
.sub-variant {
|
|
|
|
margin-left: 24px;
|
|
|
|
margin-bottom: 40px;
|
2018-10-19 01:34:46 +02:00
|
|
|
}
|
|
|
|
|
2021-10-19 22:48:53 -07:00
|
|
|
.sub-variant > .sub-variant-field {
|
|
|
|
margin-left: 24px;
|
2016-11-11 16:41:00 -06:00
|
|
|
}
|
|
|
|
|
2021-06-16 22:48:23 -07:00
|
|
|
:target {
|
|
|
|
padding-right: 3px;
|
2022-11-08 21:12:17 +01:00
|
|
|
background-color: var(--target-background-color);
|
|
|
|
border-right: 3px solid var(--target-border-color);
|
2021-06-16 22:48:23 -07:00
|
|
|
}
|
|
|
|
|
2022-11-08 18:00:22 -07:00
|
|
|
.notable-traits {
|
|
|
|
color: inherit;
|
|
|
|
margin-right: 15px;
|
|
|
|
position: relative;
|
2020-07-06 17:18:04 -07:00
|
|
|
}
|
|
|
|
|
2022-11-08 18:00:22 -07:00
|
|
|
/* placeholder thunk so that the mouse can easily travel from "(i)" to popover
|
|
|
|
the resulting "hover tunnel" is a stepped triangle, approximating
|
|
|
|
https://bjk5.com/post/44698559168/breaking-down-amazons-mega-dropdown */
|
|
|
|
.notable-traits:hover::after {
|
2020-07-06 17:18:04 -07:00
|
|
|
position: absolute;
|
2022-11-08 18:00:22 -07:00
|
|
|
top: calc(100% - 10px);
|
|
|
|
left: -15px;
|
|
|
|
right: -15px;
|
|
|
|
height: 20px;
|
|
|
|
content: "\00a0";
|
2020-07-06 17:18:04 -07:00
|
|
|
}
|
|
|
|
|
2023-01-13 15:42:29 -07:00
|
|
|
.notable .content {
|
2022-11-08 18:00:22 -07:00
|
|
|
margin: 0.25em 0.5em;
|
2021-06-02 21:16:33 +02:00
|
|
|
}
|
|
|
|
|
2023-01-13 15:42:29 -07:00
|
|
|
.notable .content pre, .notable .content code {
|
2022-11-07 15:53:30 -07:00
|
|
|
background: transparent;
|
2020-07-15 17:20:46 +02:00
|
|
|
margin: 0;
|
|
|
|
padding: 0;
|
Set font size proportional to user's font size
According to MDN
(https://developer.mozilla.org/en-US/docs/Web/CSS/font-size),
> To maximize accessibility, it is generally best to use values that
> are relative to the user's default font size.
> Defining font sizes in px is not accessible, because the user cannot
> change the font size in some browsers.
Note that changing font size (in browser or OS settings) is distinct
from the zoom functionality triggered with Ctrl/Cmd-+. Zoom
functionality increases the size of everything on the page, effectively
applying a multiplier to all pixel sizes. Font size changes apply to
just text.
For relative font sizes, we could use `em`, as we do in several places
already. However that has a problem of "compounding" (see MDN article
for details). The compounding problem is nicely solved by `rem`, which
make font sizes relative to the root element, not the parent element.
Since we were using a hodge-podge of pixel sizes, em, rem, and
percentage sizes before, this change switching everything to rem, while
keeping the same size relative to our old default of 16px.
16px is still the default on most browsers, for users that haven't set a
larger or smaller font size.
2021-12-30 16:42:06 -05:00
|
|
|
font-size: 1.25rem;
|
2022-11-07 15:53:30 -07:00
|
|
|
white-space: pre-wrap;
|
2017-11-29 19:23:41 +01:00
|
|
|
}
|
|
|
|
|
2023-01-13 15:42:29 -07:00
|
|
|
.notable .content > h3:first-child {
|
|
|
|
margin: 0 0 5px 0;
|
|
|
|
}
|
|
|
|
|
2017-10-04 00:06:07 +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;
|
2017-10-04 00:06:07 +02:00
|
|
|
}
|
|
|
|
|
2018-11-01 02:20:49 +01:00
|
|
|
.search-failed > ul {
|
|
|
|
text-align: left;
|
|
|
|
max-width: 570px;
|
|
|
|
margin-left: auto;
|
|
|
|
margin-right: auto;
|
|
|
|
}
|
|
|
|
|
2022-12-22 15:52:34 -07:00
|
|
|
#search-tabs {
|
2022-09-14 09:45:05 -07:00
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
gap: 1px;
|
|
|
|
margin-bottom: 4px;
|
2017-10-04 00:06:07 +02:00
|
|
|
}
|
|
|
|
|
2022-12-22 15:52:34 -07:00
|
|
|
#search-tabs button {
|
2017-10-04 00:06:07 +02:00
|
|
|
text-align: center;
|
Set font size proportional to user's font size
According to MDN
(https://developer.mozilla.org/en-US/docs/Web/CSS/font-size),
> To maximize accessibility, it is generally best to use values that
> are relative to the user's default font size.
> Defining font sizes in px is not accessible, because the user cannot
> change the font size in some browsers.
Note that changing font size (in browser or OS settings) is distinct
from the zoom functionality triggered with Ctrl/Cmd-+. Zoom
functionality increases the size of everything on the page, effectively
applying a multiplier to all pixel sizes. Font size changes apply to
just text.
For relative font sizes, we could use `em`, as we do in several places
already. However that has a problem of "compounding" (see MDN article
for details). The compounding problem is nicely solved by `rem`, which
make font sizes relative to the root element, not the parent element.
Since we were using a hodge-podge of pixel sizes, em, rem, and
percentage sizes before, this change switching everything to rem, while
keeping the same size relative to our old default of 16px.
16px is still the default on most browsers, for users that haven't set a
larger or smaller font size.
2021-12-30 16:42:06 -05:00
|
|
|
font-size: 1.125rem;
|
2020-12-10 11:38:12 +01:00
|
|
|
border: 0;
|
2018-10-16 19:07:41 +02:00
|
|
|
border-top: 2px solid;
|
2022-09-14 09:45:05 -07:00
|
|
|
flex: 1;
|
2022-09-28 13:52:13 -07:00
|
|
|
line-height: 1.5;
|
|
|
|
color: inherit;
|
2017-10-04 00:06:07 +02:00
|
|
|
}
|
2023-01-30 19:28:47 +01:00
|
|
|
#search-tabs button:not(.selected) {
|
|
|
|
background-color: var(--search-tab-button-not-selected-background);
|
|
|
|
border-top-color: var(--search-tab-button-not-selected-border-top-color);
|
|
|
|
}
|
|
|
|
#search-tabs button:hover, #search-tabs button.selected {
|
|
|
|
background-color: var(--search-tab-button-selected-background);
|
|
|
|
border-top-color: var(--search-tab-button-selected-border-top-color);
|
|
|
|
}
|
2017-11-02 01:01:51 +01:00
|
|
|
|
2022-12-22 15:52:34 -07:00
|
|
|
#search-tabs .count {
|
Set font size proportional to user's font size
According to MDN
(https://developer.mozilla.org/en-US/docs/Web/CSS/font-size),
> To maximize accessibility, it is generally best to use values that
> are relative to the user's default font size.
> Defining font sizes in px is not accessible, because the user cannot
> change the font size in some browsers.
Note that changing font size (in browser or OS settings) is distinct
from the zoom functionality triggered with Ctrl/Cmd-+. Zoom
functionality increases the size of everything on the page, effectively
applying a multiplier to all pixel sizes. Font size changes apply to
just text.
For relative font sizes, we could use `em`, as we do in several places
already. However that has a problem of "compounding" (see MDN article
for details). The compounding problem is nicely solved by `rem`, which
make font sizes relative to the root element, not the parent element.
Since we were using a hodge-podge of pixel sizes, em, rem, and
percentage sizes before, this change switching everything to rem, while
keeping the same size relative to our old default of 16px.
16px is still the default on most browsers, for users that haven't set a
larger or smaller font size.
2021-12-30 16:42:06 -05:00
|
|
|
font-size: 1rem;
|
2022-12-22 11:38:39 +01:00
|
|
|
color: var(--search-tab-title-count-color);
|
2017-11-02 01:01:51 +01:00
|
|
|
}
|
2017-11-15 20:04:02 +01:00
|
|
|
|
2022-12-15 16:29:52 -07:00
|
|
|
#src-sidebar-toggle {
|
2021-10-24 21:59:53 +02:00
|
|
|
position: sticky;
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
2022-02-05 05:05:05 -08:00
|
|
|
font-size: 1.25rem;
|
2021-10-24 21:59:53 +02:00
|
|
|
border-bottom: 1px solid;
|
|
|
|
display: flex;
|
|
|
|
height: 40px;
|
2022-11-25 22:06:22 -07:00
|
|
|
justify-content: stretch;
|
|
|
|
align-items: stretch;
|
2021-10-24 21:59:53 +02:00
|
|
|
z-index: 10;
|
2019-04-29 23:24:09 +02:00
|
|
|
}
|
|
|
|
#source-sidebar {
|
2021-12-14 11:48:30 +01:00
|
|
|
width: 100%;
|
2019-04-29 23:24:09 +02:00
|
|
|
overflow: auto;
|
|
|
|
}
|
|
|
|
#source-sidebar > .title {
|
Set font size proportional to user's font size
According to MDN
(https://developer.mozilla.org/en-US/docs/Web/CSS/font-size),
> To maximize accessibility, it is generally best to use values that
> are relative to the user's default font size.
> Defining font sizes in px is not accessible, because the user cannot
> change the font size in some browsers.
Note that changing font size (in browser or OS settings) is distinct
from the zoom functionality triggered with Ctrl/Cmd-+. Zoom
functionality increases the size of everything on the page, effectively
applying a multiplier to all pixel sizes. Font size changes apply to
just text.
For relative font sizes, we could use `em`, as we do in several places
already. However that has a problem of "compounding" (see MDN article
for details). The compounding problem is nicely solved by `rem`, which
make font sizes relative to the root element, not the parent element.
Since we were using a hodge-podge of pixel sizes, em, rem, and
percentage sizes before, this change switching everything to rem, while
keeping the same size relative to our old default of 16px.
16px is still the default on most browsers, for users that haven't set a
larger or smaller font size.
2021-12-30 16:42:06 -05:00
|
|
|
font-size: 1.5rem;
|
2019-04-29 23:24:09 +02:00
|
|
|
text-align: center;
|
2022-08-13 14:00:23 +02:00
|
|
|
border-bottom: 1px solid var(--border-color);
|
2019-04-29 23:24:09 +02:00
|
|
|
margin-bottom: 6px;
|
|
|
|
}
|
2022-11-24 23:36:26 +01:00
|
|
|
#source-sidebar div.files > a:hover, details.dir-entry summary:hover,
|
|
|
|
#source-sidebar div.files > a:focus, details.dir-entry summary:focus {
|
|
|
|
background-color: var(--source-sidebar-background-hover);
|
|
|
|
}
|
|
|
|
#source-sidebar div.files > a.selected {
|
|
|
|
background-color: var(--source-sidebar-background-selected);
|
|
|
|
}
|
2022-12-15 16:29:52 -07:00
|
|
|
#src-sidebar-toggle > button {
|
2022-09-28 13:52:13 -07:00
|
|
|
font-size: inherit;
|
|
|
|
font-weight: bold;
|
2022-07-01 11:05:38 -07:00
|
|
|
background: none;
|
|
|
|
color: inherit;
|
|
|
|
text-align: center;
|
|
|
|
border: none;
|
|
|
|
outline: none;
|
2022-11-25 22:06:22 -07:00
|
|
|
flex: 1 1;
|
2022-07-01 11:05:38 -07:00
|
|
|
/* iOS button gradient: https://stackoverflow.com/q/5438567 */
|
|
|
|
-webkit-appearance: none;
|
|
|
|
opacity: 1;
|
|
|
|
}
|
2022-12-28 16:04:57 -07:00
|
|
|
|
2021-05-09 11:21:38 -07:00
|
|
|
#settings-menu, #help-button {
|
2022-01-20 14:18:59 +01:00
|
|
|
margin-left: 4px;
|
2022-12-01 14:24:33 -07:00
|
|
|
display: flex;
|
2019-04-29 23:43:39 +02:00
|
|
|
}
|
2022-10-14 09:48:19 -07:00
|
|
|
#settings-menu > a, #help-button > a {
|
2022-12-01 14:24:33 -07:00
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
2022-08-13 14:00:23 +02:00
|
|
|
background-color: var(--button-background-color);
|
2022-10-17 11:53:42 -07:00
|
|
|
border: 1px solid var(--border-color);
|
|
|
|
border-radius: 2px;
|
2022-11-19 11:07:13 +01:00
|
|
|
color: var(--settings-button-color);
|
2022-12-01 14:24:33 -07:00
|
|
|
/* 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;
|
2022-12-28 16:04:57 -07:00
|
|
|
width: 33px;
|
2022-11-19 11:07:13 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
#settings-menu > a:hover, #settings-menu > a:focus,
|
|
|
|
#help-button > a:hover, #help-button > a:focus {
|
|
|
|
border-color: var(--settings-button-border-focus);
|
2022-05-10 16:09:41 +02:00
|
|
|
}
|
2021-03-31 22:13:47 +02:00
|
|
|
|
2022-09-02 15:08:23 +02:00
|
|
|
#copy-path {
|
|
|
|
color: var(--copy-path-button-color);
|
2022-10-17 11:53:42 -07:00
|
|
|
background: var(--main-background-color);
|
|
|
|
height: 34px;
|
|
|
|
margin-left: 10px;
|
|
|
|
padding: 0;
|
|
|
|
padding-left: 2px;
|
|
|
|
border: 0;
|
2022-12-28 16:04:57 -07:00
|
|
|
width: 33px;
|
2022-09-02 15:08:23 +02:00
|
|
|
}
|
|
|
|
#copy-path > img {
|
|
|
|
filter: var(--copy-path-img-filter);
|
|
|
|
}
|
|
|
|
#copy-path:hover > img {
|
|
|
|
filter: var(--copy-path-img-hover-filter);
|
|
|
|
}
|
|
|
|
|
2022-05-04 15:39:18 +02:00
|
|
|
@keyframes rotating {
|
|
|
|
from {
|
|
|
|
transform: rotate(0deg);
|
|
|
|
}
|
|
|
|
to {
|
|
|
|
transform: rotate(360deg);
|
|
|
|
}
|
|
|
|
}
|
2022-05-11 23:11:18 +02:00
|
|
|
#settings-menu.rotate > a img {
|
2022-05-04 15:39:18 +02:00
|
|
|
animation: rotating 2s linear infinite;
|
|
|
|
}
|
|
|
|
|
2021-05-14 19:43:08 +02:00
|
|
|
kbd {
|
|
|
|
display: inline-block;
|
|
|
|
padding: 3px 5px;
|
|
|
|
font: 15px monospace;
|
|
|
|
line-height: 10px;
|
|
|
|
vertical-align: middle;
|
2022-08-13 14:00:23 +02:00
|
|
|
border: solid 1px var(--border-color);
|
2021-05-14 19:43:08 +02:00
|
|
|
border-radius: 3px;
|
2023-01-05 11:03:35 +01:00
|
|
|
color: var(--kbd-color);
|
2022-11-20 14:32:27 +01:00
|
|
|
background-color: var(--kbd-background);
|
|
|
|
box-shadow: inset 0 -1px 0 var(--kbd-box-shadow-color);
|
2021-05-14 19:43:08 +02:00
|
|
|
}
|
|
|
|
|
2022-09-16 13:40:21 -07:00
|
|
|
ul.all-items > li {
|
2021-05-14 19:43:08 +02:00
|
|
|
list-style: none;
|
|
|
|
}
|
|
|
|
|
2022-07-01 15:29:47 -07:00
|
|
|
details.dir-entry {
|
|
|
|
padding-left: 4px;
|
2021-05-14 19:43:08 +02:00
|
|
|
}
|
2022-07-01 15:29:47 -07:00
|
|
|
|
2022-07-01 10:33:06 -07:00
|
|
|
details.dir-entry > summary {
|
2022-12-30 11:58:58 -07:00
|
|
|
margin: 0 0 0 -4px;
|
|
|
|
padding: 0 0 0 4px;
|
2021-05-14 19:43:08 +02:00
|
|
|
cursor: pointer;
|
|
|
|
}
|
2022-07-01 10:33:06 -07:00
|
|
|
|
|
|
|
details.dir-entry div.folders, details.dir-entry div.files {
|
2022-07-01 15:29:47 -07:00
|
|
|
padding-left: 23px;
|
2021-05-14 19:43:08 +02:00
|
|
|
}
|
2022-07-01 10:33:06 -07:00
|
|
|
|
|
|
|
details.dir-entry a {
|
2021-05-14 19:43:08 +02:00
|
|
|
display: block;
|
|
|
|
}
|
|
|
|
|
2022-09-27 09:21:24 -07:00
|
|
|
/* We use CSS containment on the details elements because most sizeable elements
|
|
|
|
of the page are contained in one of these. This also makes re-rendering
|
|
|
|
faster on document changes (like closing and opening toggles).
|
|
|
|
Unfortunately we can't yet specify contain: content or contain: strict
|
|
|
|
because the [-]/[+] toggles extend past the boundaries of the <details>
|
|
|
|
https://developer.mozilla.org/en-US/docs/Web/CSS/contain */
|
2023-01-10 11:35:37 -07:00
|
|
|
details.toggle {
|
2022-09-27 09:21:24 -07:00
|
|
|
contain: layout;
|
2022-10-21 10:31:33 -07:00
|
|
|
position: relative;
|
2022-09-27 09:21:24 -07:00
|
|
|
}
|
|
|
|
|
2021-05-14 19:43:08 +02:00
|
|
|
/* 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". */
|
2023-01-10 11:35:37 -07:00
|
|
|
details.toggle > summary.hideme {
|
2021-05-14 19:43:08 +02:00
|
|
|
cursor: pointer;
|
2022-12-05 11:15:09 -07:00
|
|
|
font-size: 1rem;
|
2021-05-14 19:43:08 +02:00
|
|
|
}
|
|
|
|
|
2023-01-10 11:35:37 -07:00
|
|
|
details.toggle > summary {
|
2021-05-14 19:43:08 +02:00
|
|
|
list-style: none;
|
2022-10-27 09:48:06 -07:00
|
|
|
/* focus outline is shown on `::before` instead of this */
|
|
|
|
outline: none;
|
2021-05-14 19:43:08 +02:00
|
|
|
}
|
2023-01-10 11:35:37 -07:00
|
|
|
details.toggle > summary::-webkit-details-marker,
|
|
|
|
details.toggle > summary::marker {
|
2021-05-14 19:43:08 +02:00
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
2023-01-10 11:35:37 -07:00
|
|
|
details.toggle > summary.hideme > span {
|
2021-05-14 19:43:08 +02:00
|
|
|
margin-left: 9px;
|
|
|
|
}
|
|
|
|
|
2023-01-10 11:35:37 -07:00
|
|
|
details.toggle > summary::before {
|
2023-01-31 21:23:23 +01:00
|
|
|
/* toggle plus */
|
|
|
|
background: url('data:image/svg+xml,<svg width="17" height="17" \
|
|
|
|
shape-rendering="crispEdges" stroke="black" fill="none" xmlns="http://www.w3.org/2000/svg"><path \
|
|
|
|
d="M5 2.5H2.5v12H5m7-12h2.5v12H12M5 8.5h7M8.5 12V8.625v0V5"/></svg>') no-repeat top left;
|
2021-07-17 11:28:26 -07:00
|
|
|
content: "";
|
2021-05-14 19:43:08 +02:00
|
|
|
cursor: pointer;
|
2022-02-05 05:05:05 -08:00
|
|
|
width: 16px;
|
|
|
|
height: 16px;
|
2021-07-16 17:24:35 -07:00
|
|
|
display: inline-block;
|
|
|
|
vertical-align: middle;
|
|
|
|
opacity: .5;
|
2022-12-01 15:55:09 +01:00
|
|
|
filter: var(--toggle-filter);
|
2021-07-17 10:55:33 -07:00
|
|
|
}
|
|
|
|
|
2023-01-10 11:35:37 -07:00
|
|
|
details.toggle > summary.hideme > span,
|
2022-09-02 15:08:23 +02:00
|
|
|
.more-examples-toggle summary, .more-examples-toggle .hide-more {
|
|
|
|
color: var(--toggles-color);
|
|
|
|
}
|
|
|
|
|
2021-07-17 10:55:33 -07:00
|
|
|
/* 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. */
|
2023-01-10 11:35:37 -07:00
|
|
|
details.toggle > summary::after {
|
2021-07-17 10:55:33 -07:00
|
|
|
content: "Expand";
|
2021-07-16 17:24:35 -07:00
|
|
|
overflow: hidden;
|
2021-07-17 10:55:33 -07:00
|
|
|
width: 0;
|
|
|
|
height: 0;
|
|
|
|
position: absolute;
|
2021-07-16 17:24:35 -07:00
|
|
|
}
|
|
|
|
|
2023-01-10 11:35:37 -07:00
|
|
|
details.toggle > summary.hideme::after {
|
2021-07-16 17:24:35 -07:00
|
|
|
/* "hideme" toggles already have a description when they're contracted */
|
2021-07-17 10:55:33 -07:00
|
|
|
content: "";
|
2021-07-16 17:24:35 -07:00
|
|
|
}
|
|
|
|
|
2023-01-10 11:35:37 -07:00
|
|
|
details.toggle > summary:focus::before,
|
|
|
|
details.toggle > summary:hover::before {
|
2021-07-16 17:24:35 -07:00
|
|
|
opacity: 1;
|
2021-05-14 19:43:08 +02:00
|
|
|
}
|
|
|
|
|
2023-01-10 11:35:37 -07:00
|
|
|
details.toggle > summary:focus-visible::before {
|
2022-10-26 02:41:34 -07:00
|
|
|
/* The SVG is black, and gets turned white using a filter in the dark themes.
|
2022-10-25 16:52:50 -07:00
|
|
|
Do the same with the outline.
|
2022-10-26 02:41:34 -07:00
|
|
|
The dotted 1px style is copied from Firefox's focus ring style.
|
2022-10-25 16:52:50 -07:00
|
|
|
*/
|
|
|
|
outline: 1px dotted #000;
|
|
|
|
outline-offset: 1px;
|
|
|
|
}
|
|
|
|
|
2021-05-14 19:43:08 +02:00
|
|
|
details.non-exhaustive {
|
|
|
|
margin-bottom: 8px;
|
|
|
|
}
|
|
|
|
|
2023-01-10 11:35:37 -07:00
|
|
|
details.toggle > summary.hideme::before {
|
2021-05-14 19:43:08 +02:00
|
|
|
position: relative;
|
|
|
|
}
|
|
|
|
|
2023-01-10 11:35:37 -07:00
|
|
|
details.toggle > summary:not(.hideme)::before {
|
2021-05-14 19:43:08 +02:00
|
|
|
position: absolute;
|
2021-10-21 18:46:47 -07:00
|
|
|
left: -24px;
|
2022-02-05 05:05:05 -08:00
|
|
|
top: 4px;
|
2021-05-14 19:43:08 +02:00
|
|
|
}
|
|
|
|
|
2023-01-10 11:35:37 -07:00
|
|
|
.impl-items > details.toggle > summary:not(.hideme)::before {
|
2021-05-14 19:43:08 +02:00
|
|
|
position: absolute;
|
2021-10-21 18:46:47 -07:00
|
|
|
left: -24px;
|
2021-05-14 19:43:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* 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. */
|
2023-01-10 11:35:37 -07:00
|
|
|
details.toggle[open] > summary.hideme {
|
2021-05-14 19:43:08 +02:00
|
|
|
position: absolute;
|
|
|
|
}
|
|
|
|
|
2023-01-10 11:35:37 -07:00
|
|
|
details.toggle[open] > summary.hideme > span {
|
2021-05-14 19:43:08 +02:00
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
2023-01-10 11:35:37 -07:00
|
|
|
details.toggle[open] > summary::before {
|
2023-01-31 21:23:23 +01:00
|
|
|
/* toggle minus */
|
|
|
|
background: url('data:image/svg+xml,<svg width="17" height="17" \
|
|
|
|
shape-rendering="crispEdges" stroke="black" fill="none" xmlns="http://www.w3.org/2000/svg"><path \
|
|
|
|
d="M5 2.5H2.5v12H5m7-12h2.5v12H12M5 8.5h7"/></svg>') no-repeat top left;
|
2021-07-17 10:55:33 -07:00
|
|
|
}
|
|
|
|
|
2023-01-10 11:35:37 -07:00
|
|
|
details.toggle[open] > summary::after {
|
2021-07-16 17:24:35 -07:00
|
|
|
content: "Collapse";
|
2021-05-14 19:43:08 +02:00
|
|
|
}
|
|
|
|
|
2022-05-21 15:05:19 +02:00
|
|
|
/* This is needed in docblocks to have the "▶" element to be on the same line. */
|
|
|
|
.docblock summary > * {
|
|
|
|
display: inline-block;
|
2022-05-21 13:57:52 +02:00
|
|
|
}
|
|
|
|
|
2022-10-17 13:54:42 -07:00
|
|
|
/* 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 > .example-wrap:first-child .tooltip {
|
|
|
|
margin-top: 16px;
|
2020-07-22 16:28:47 +02:00
|
|
|
}
|
|
|
|
|
2022-10-17 13:54:42 -07:00
|
|
|
/* Media Queries */
|
|
|
|
|
2022-07-01 12:13:46 -07:00
|
|
|
/*
|
|
|
|
WARNING: RUSTDOC_MOBILE_BREAKPOINT MEDIA QUERY
|
|
|
|
If you update this line, then you also need to update the line with the same warning
|
2022-10-17 13:54:42 -07:00
|
|
|
in storage.js
|
2022-07-01 12:13:46 -07:00
|
|
|
*/
|
2014-08-02 20:58:41 -04:00
|
|
|
@media (max-width: 700px) {
|
2022-01-18 22:05:17 -08:00
|
|
|
/* 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;
|
|
|
|
}
|
|
|
|
|
Simplify and unify rustdoc sidebar styles
This switches to just use size, weight, and spacing to distinguish
headings in the sidebar. We no longer use boxes, horizontal bars, or
centering to distinguish headings. This makes it much easier to
understand the hierarchy of headings, and reduces visual noise.
I also refactored how the mobile topbar works. Previously, we tried to
shift around elements from the sidebar to make the topbar. Now, the
topbar gets its own elements, which can be styled on their own. This
makes styling and reasoning about those elements simpler.
Because the heading font sizes are bigger, increase the sidebar width
slightly.
As a very minor change, removed version from the "All types" page. It's
now only on the crate page.
2022-01-06 19:48:24 -05:00
|
|
|
.rustdoc {
|
|
|
|
/* Sidebar should overlay main content, rather than pushing main content to the right.
|
|
|
|
Turn off `display: flex` on the body element. */
|
|
|
|
display: block;
|
2016-11-06 21:03:08 +01:00
|
|
|
}
|
|
|
|
|
2021-09-30 04:23:02 +02:00
|
|
|
main {
|
|
|
|
padding-left: 15px;
|
|
|
|
padding-top: 0px;
|
|
|
|
}
|
|
|
|
|
2022-01-13 09:54:44 -08:00
|
|
|
.main-heading {
|
2021-09-30 04:23:02 +02:00
|
|
|
flex-direction: column;
|
|
|
|
}
|
|
|
|
|
2022-09-25 13:09:22 -07:00
|
|
|
.out-of-band {
|
2022-01-13 09:54:44 -08:00
|
|
|
text-align: left;
|
|
|
|
margin-left: initial;
|
|
|
|
padding: initial;
|
|
|
|
}
|
|
|
|
|
2022-09-25 13:09:22 -07:00
|
|
|
.out-of-band .since::before {
|
2022-01-13 09:54:44 -08:00
|
|
|
content: "Since ";
|
|
|
|
}
|
|
|
|
|
Simplify and unify rustdoc sidebar styles
This switches to just use size, weight, and spacing to distinguish
headings in the sidebar. We no longer use boxes, horizontal bars, or
centering to distinguish headings. This makes it much easier to
understand the hierarchy of headings, and reduces visual noise.
I also refactored how the mobile topbar works. Previously, we tried to
shift around elements from the sidebar to make the topbar. Now, the
topbar gets its own elements, which can be styled on their own. This
makes styling and reasoning about those elements simpler.
Because the heading font sizes are bigger, increase the sidebar width
slightly.
As a very minor change, removed version from the "All types" page. It's
now only on the crate page.
2022-01-06 19:48:24 -05:00
|
|
|
/* Hide the logo and item name from the sidebar. Those are displayed
|
|
|
|
in the mobile-topbar instead. */
|
2023-01-04 13:04:30 -07:00
|
|
|
.sidebar .logo-container,
|
Simplify and unify rustdoc sidebar styles
This switches to just use size, weight, and spacing to distinguish
headings in the sidebar. We no longer use boxes, horizontal bars, or
centering to distinguish headings. This makes it much easier to
understand the hierarchy of headings, and reduces visual noise.
I also refactored how the mobile topbar works. Previously, we tried to
shift around elements from the sidebar to make the topbar. Now, the
topbar gets its own elements, which can be styled on their own. This
makes styling and reasoning about those elements simpler.
Because the heading font sizes are bigger, increase the sidebar width
slightly.
As a very minor change, removed version from the "All types" page. It's
now only on the crate page.
2022-01-06 19:48:24 -05:00
|
|
|
.sidebar .location {
|
|
|
|
display: none;
|
2016-11-06 21:03:08 +01:00
|
|
|
}
|
|
|
|
|
Simplify and unify rustdoc sidebar styles
This switches to just use size, weight, and spacing to distinguish
headings in the sidebar. We no longer use boxes, horizontal bars, or
centering to distinguish headings. This makes it much easier to
understand the hierarchy of headings, and reduces visual noise.
I also refactored how the mobile topbar works. Previously, we tried to
shift around elements from the sidebar to make the topbar. Now, the
topbar gets its own elements, which can be styled on their own. This
makes styling and reasoning about those elements simpler.
Because the heading font sizes are bigger, increase the sidebar width
slightly.
As a very minor change, removed version from the "All types" page. It's
now only on the crate page.
2022-01-06 19:48:24 -05:00
|
|
|
.sidebar {
|
2021-10-10 19:08:08 +02:00
|
|
|
position: fixed;
|
Simplify and unify rustdoc sidebar styles
This switches to just use size, weight, and spacing to distinguish
headings in the sidebar. We no longer use boxes, horizontal bars, or
centering to distinguish headings. This makes it much easier to
understand the hierarchy of headings, and reduces visual noise.
I also refactored how the mobile topbar works. Previously, we tried to
shift around elements from the sidebar to make the topbar. Now, the
topbar gets its own elements, which can be styled on their own. This
makes styling and reasoning about those elements simpler.
Because the heading font sizes are bigger, increase the sidebar width
slightly.
As a very minor change, removed version from the "All types" page. It's
now only on the crate page.
2022-01-06 19:48:24 -05:00
|
|
|
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;
|
2021-10-10 19:08:08 +02:00
|
|
|
z-index: 11;
|
2022-01-21 17:44:54 -08:00
|
|
|
/* Reduce height slightly to account for mobile topbar. */
|
|
|
|
height: calc(100vh - 45px);
|
2022-11-16 22:52:30 -07:00
|
|
|
width: 200px;
|
2021-10-10 19:08:08 +02:00
|
|
|
}
|
|
|
|
|
Simplify and unify rustdoc sidebar styles
This switches to just use size, weight, and spacing to distinguish
headings in the sidebar. We no longer use boxes, horizontal bars, or
centering to distinguish headings. This makes it much easier to
understand the hierarchy of headings, and reduces visual noise.
I also refactored how the mobile topbar works. Previously, we tried to
shift around elements from the sidebar to make the topbar. Now, the
topbar gets its own elements, which can be styled on their own. This
makes styling and reasoning about those elements simpler.
Because the heading font sizes are bigger, increase the sidebar width
slightly.
As a very minor change, removed version from the "All types" page. It's
now only on the crate page.
2022-01-06 19:48:24 -05:00
|
|
|
/* 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,
|
2022-06-29 15:15:40 +02:00
|
|
|
.rustdoc.source .sidebar {
|
2021-10-24 20:03:13 +02:00
|
|
|
top: 0;
|
Simplify and unify rustdoc sidebar styles
This switches to just use size, weight, and spacing to distinguish
headings in the sidebar. We no longer use boxes, horizontal bars, or
centering to distinguish headings. This makes it much easier to
understand the hierarchy of headings, and reduces visual noise.
I also refactored how the mobile topbar works. Previously, we tried to
shift around elements from the sidebar to make the topbar. Now, the
topbar gets its own elements, which can be styled on their own. This
makes styling and reasoning about those elements simpler.
Because the heading font sizes are bigger, increase the sidebar width
slightly.
As a very minor change, removed version from the "All types" page. It's
now only on the crate page.
2022-01-06 19:48:24 -05:00
|
|
|
padding: 0;
|
2022-06-29 15:15:40 +02:00
|
|
|
height: 100vh;
|
|
|
|
border: 0;
|
Simplify and unify rustdoc sidebar styles
This switches to just use size, weight, and spacing to distinguish
headings in the sidebar. We no longer use boxes, horizontal bars, or
centering to distinguish headings. This makes it much easier to
understand the hierarchy of headings, and reduces visual noise.
I also refactored how the mobile topbar works. Previously, we tried to
shift around elements from the sidebar to make the topbar. Now, the
topbar gets its own elements, which can be styled on their own. This
makes styling and reasoning about those elements simpler.
Because the heading font sizes are bigger, increase the sidebar width
slightly.
As a very minor change, removed version from the "All types" page. It's
now only on the crate page.
2022-01-06 19:48:24 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
.sidebar.shown,
|
2022-06-20 12:41:11 -07:00
|
|
|
.source-sidebar-expanded .source .sidebar,
|
2023-01-06 12:20:03 -07:00
|
|
|
.rustdoc:not(.source) .sidebar:focus-within {
|
2021-10-24 20:03:13 +02:00
|
|
|
left: 0;
|
|
|
|
}
|
|
|
|
|
2022-10-18 11:14:01 -07:00
|
|
|
.mobile-topbar h2 {
|
|
|
|
padding-bottom: 0;
|
2022-01-31 05:53:43 -08:00
|
|
|
margin: auto 0.5em auto auto;
|
2022-01-21 17:44:54 -08:00
|
|
|
overflow: hidden;
|
|
|
|
/* 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. */
|
2022-02-05 05:05:05 -08:00
|
|
|
font-size: 24px;
|
2016-11-06 21:03:08 +01:00
|
|
|
}
|
|
|
|
|
2022-10-18 11:14:01 -07:00
|
|
|
.mobile-topbar h2 a {
|
|
|
|
display: block;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
overflow: hidden;
|
|
|
|
white-space: nowrap;
|
|
|
|
}
|
|
|
|
|
Simplify and unify rustdoc sidebar styles
This switches to just use size, weight, and spacing to distinguish
headings in the sidebar. We no longer use boxes, horizontal bars, or
centering to distinguish headings. This makes it much easier to
understand the hierarchy of headings, and reduces visual noise.
I also refactored how the mobile topbar works. Previously, we tried to
shift around elements from the sidebar to make the topbar. Now, the
topbar gets its own elements, which can be styled on their own. This
makes styling and reasoning about those elements simpler.
Because the heading font sizes are bigger, increase the sidebar width
slightly.
As a very minor change, removed version from the "All types" page. It's
now only on the crate page.
2022-01-06 19:48:24 -05:00
|
|
|
.mobile-topbar .logo-container > img {
|
2019-04-29 11:45:06 +02:00
|
|
|
max-width: 35px;
|
|
|
|
max-height: 35px;
|
2022-10-29 09:04:31 -07:00
|
|
|
margin: 5px 0 5px 20px;
|
2019-04-29 11:45:06 +02:00
|
|
|
}
|
|
|
|
|
Simplify and unify rustdoc sidebar styles
This switches to just use size, weight, and spacing to distinguish
headings in the sidebar. We no longer use boxes, horizontal bars, or
centering to distinguish headings. This makes it much easier to
understand the hierarchy of headings, and reduces visual noise.
I also refactored how the mobile topbar works. Previously, we tried to
shift around elements from the sidebar to make the topbar. Now, the
topbar gets its own elements, which can be styled on their own. This
makes styling and reasoning about those elements simpler.
Because the heading font sizes are bigger, increase the sidebar width
slightly.
As a very minor change, removed version from the "All types" page. It's
now only on the crate page.
2022-01-06 19:48:24 -05:00
|
|
|
.mobile-topbar {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
position: sticky;
|
2017-12-11 22:30:04 +01:00
|
|
|
z-index: 10;
|
2017-12-06 00:42:33 +01:00
|
|
|
font-size: 2rem;
|
Simplify and unify rustdoc sidebar styles
This switches to just use size, weight, and spacing to distinguish
headings in the sidebar. We no longer use boxes, horizontal bars, or
centering to distinguish headings. This makes it much easier to
understand the hierarchy of headings, and reduces visual noise.
I also refactored how the mobile topbar works. Previously, we tried to
shift around elements from the sidebar to make the topbar. Now, the
topbar gets its own elements, which can be styled on their own. This
makes styling and reasoning about those elements simpler.
Because the heading font sizes are bigger, increase the sidebar width
slightly.
As a very minor change, removed version from the "All types" page. It's
now only on the crate page.
2022-01-06 19:48:24 -05:00
|
|
|
height: 45px;
|
|
|
|
width: 100%;
|
2017-12-11 22:30:04 +01:00
|
|
|
left: 0;
|
2021-11-29 15:55:05 +01:00
|
|
|
top: 0;
|
2016-11-06 21:03:08 +01:00
|
|
|
}
|
|
|
|
|
Simplify and unify rustdoc sidebar styles
This switches to just use size, weight, and spacing to distinguish
headings in the sidebar. We no longer use boxes, horizontal bars, or
centering to distinguish headings. This makes it much easier to
understand the hierarchy of headings, and reduces visual noise.
I also refactored how the mobile topbar works. Previously, we tried to
shift around elements from the sidebar to make the topbar. Now, the
topbar gets its own elements, which can be styled on their own. This
makes styling and reasoning about those elements simpler.
Because the heading font sizes are bigger, increase the sidebar width
slightly.
As a very minor change, removed version from the "All types" page. It's
now only on the crate page.
2022-01-06 19:48:24 -05:00
|
|
|
.sidebar-menu-toggle {
|
|
|
|
width: 45px;
|
2022-01-21 17:44:54 -08:00
|
|
|
/* 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;
|
Simplify and unify rustdoc sidebar styles
This switches to just use size, weight, and spacing to distinguish
headings in the sidebar. We no longer use boxes, horizontal bars, or
centering to distinguish headings. This makes it much easier to
understand the hierarchy of headings, and reduces visual noise.
I also refactored how the mobile topbar works. Previously, we tried to
shift around elements from the sidebar to make the topbar. Now, the
topbar gets its own elements, which can be styled on their own. This
makes styling and reasoning about those elements simpler.
Because the heading font sizes are bigger, increase the sidebar width
slightly.
As a very minor change, removed version from the "All types" page. It's
now only on the crate page.
2022-01-06 19:48:24 -05:00
|
|
|
border: none;
|
2022-10-05 11:19:53 +02:00
|
|
|
color: var(--main-color);
|
2017-12-11 22:30:04 +01:00
|
|
|
}
|
|
|
|
|
2022-07-11 14:51:39 +02:00
|
|
|
.sidebar-elems {
|
2022-08-27 00:37:04 +02:00
|
|
|
margin-top: 1em;
|
2022-07-11 14:51:39 +02:00
|
|
|
}
|
|
|
|
|
2018-02-19 23:22:08 +03:00
|
|
|
.anchor {
|
2018-02-20 22:46:24 +03:00
|
|
|
display: none !important;
|
2018-02-19 23:22:08 +03:00
|
|
|
}
|
2018-10-06 18:51:56 +02:00
|
|
|
|
2022-12-22 15:52:34 -07:00
|
|
|
#search-tabs .count {
|
2022-09-14 09:45:05 -07:00
|
|
|
display: block;
|
2017-12-18 21:27:19 +01:00
|
|
|
}
|
2017-12-20 00:44:44 +01:00
|
|
|
|
2023-01-10 11:35:37 -07:00
|
|
|
#main-content > details.toggle > summary::before,
|
|
|
|
#main-content > div > details.toggle > summary::before {
|
2021-05-14 19:58:21 +02:00
|
|
|
left: -11px;
|
2021-04-17 23:43:20 -07:00
|
|
|
}
|
|
|
|
|
2022-12-15 16:29:52 -07:00
|
|
|
#src-sidebar-toggle {
|
2021-10-24 21:59:53 +02:00
|
|
|
position: fixed;
|
|
|
|
left: 1px;
|
2019-04-29 23:24:09 +02:00
|
|
|
top: 100px;
|
|
|
|
width: 30px;
|
|
|
|
font-size: 1.5rem;
|
|
|
|
padding: 0;
|
2021-10-24 21:59:53 +02:00
|
|
|
z-index: 10;
|
|
|
|
border-top-right-radius: 3px;
|
|
|
|
border-bottom-right-radius: 3px;
|
|
|
|
border: 1px solid;
|
|
|
|
border-left: 0;
|
2019-04-29 23:24:09 +02:00
|
|
|
}
|
|
|
|
|
2022-12-15 16:29:52 -07:00
|
|
|
.source-sidebar-expanded #src-sidebar-toggle {
|
2022-06-20 12:41:11 -07:00
|
|
|
left: unset;
|
|
|
|
top: unset;
|
|
|
|
width: unset;
|
|
|
|
border-top-right-radius: unset;
|
|
|
|
border-bottom-right-radius: unset;
|
2022-06-29 15:28:16 +02:00
|
|
|
position: sticky;
|
|
|
|
border: 0;
|
|
|
|
border-bottom: 1px solid;
|
2022-06-20 12:41:11 -07:00
|
|
|
}
|
|
|
|
|
2022-12-01 13:44:28 -07:00
|
|
|
/* We don't display these buttons on mobile devices. */
|
|
|
|
#copy-path, #help-button {
|
2020-10-15 17:28:42 +02:00
|
|
|
display: none;
|
|
|
|
}
|
2021-05-25 00:36:36 +02:00
|
|
|
|
|
|
|
/* Display an alternating layout on tablets and phones */
|
2022-11-04 12:34:24 -07:00
|
|
|
.item-table, .item-row, .item-left, .item-right,
|
|
|
|
.search-results > a, .search-results > a > div {
|
2021-09-12 01:18:39 +02:00
|
|
|
display: block;
|
|
|
|
}
|
2021-05-25 00:36:36 +02:00
|
|
|
|
2021-05-21 23:11:06 +02:00
|
|
|
/* Display an alternating layout on tablets and phones */
|
|
|
|
.search-results > a {
|
2021-05-22 09:01:33 +00:00
|
|
|
padding: 5px 0px;
|
2021-05-21 23:11:06 +02:00
|
|
|
}
|
2022-11-04 13:19:33 -07:00
|
|
|
.search-results > a > div.desc, .item-right {
|
2021-05-21 23:11:06 +02:00
|
|
|
padding-left: 2em;
|
|
|
|
}
|
2021-12-14 11:48:30 +01:00
|
|
|
|
2022-06-20 12:41:11 -07: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. */
|
2023-01-10 11:35:37 -07:00
|
|
|
details.toggle:not(.top-doc) > summary {
|
2021-12-29 18:54:33 +01:00
|
|
|
margin-left: 10px;
|
|
|
|
}
|
2023-01-10 11:35:37 -07:00
|
|
|
.impl-items > details.toggle > summary:not(.hideme)::before,
|
|
|
|
#main-content > details.toggle:not(.top-doc) > summary::before,
|
|
|
|
#main-content > div > details.toggle > summary::before {
|
2021-12-29 18:54:33 +01:00
|
|
|
left: -11px;
|
|
|
|
}
|
2022-09-02 12:15:06 -07:00
|
|
|
|
|
|
|
/* Align summary-nested and unnested item-info gizmos. */
|
2022-10-12 11:24:23 -07:00
|
|
|
.impl-items > .item-info {
|
2022-09-02 12:15:06 -07:00
|
|
|
margin-left: 34px;
|
|
|
|
}
|
2022-10-20 13:22:36 -07:00
|
|
|
|
|
|
|
.source nav.sub {
|
|
|
|
margin: 0;
|
|
|
|
padding: 8px;
|
|
|
|
}
|
2017-12-18 21:27:19 +01:00
|
|
|
}
|
|
|
|
|
2022-12-05 23:48:07 -08:00
|
|
|
/* Should have min-width: (N + 1)px where N is the mobile breakpoint above. */
|
|
|
|
@media (min-width: 701px) {
|
2022-12-06 09:34:37 -08:00
|
|
|
/* Places file-link for a scraped example on top of the example to save space.
|
|
|
|
We only do this on large screens so the file-link doesn't overlap too much
|
|
|
|
with the example's content. */
|
2022-12-05 23:48:07 -08:00
|
|
|
.scraped-example-title {
|
|
|
|
position: absolute;
|
2022-12-06 09:34:37 -08:00
|
|
|
z-index: 10;
|
2022-12-05 23:48:07 -08:00
|
|
|
background: var(--main-background-color);
|
|
|
|
bottom: 8px;
|
|
|
|
right: 5px;
|
|
|
|
padding: 2px 4px;
|
|
|
|
box-shadow: 0 0 4px var(--main-background-color);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-04-29 23:43:39 +02:00
|
|
|
@media print {
|
2022-09-25 13:09:22 -07:00
|
|
|
nav.sidebar, nav.sub, .out-of-band, a.srclink, #copy-path,
|
2023-01-10 11:35:37 -07:00
|
|
|
details.toggle[open] > summary::before, details.toggle > summary::before,
|
|
|
|
details.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 {
|
2022-07-08 12:44:16 -04:00
|
|
|
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) {
|
2021-01-31 01:19:29 +08:00
|
|
|
.docblock {
|
|
|
|
margin-left: 12px;
|
|
|
|
}
|
2021-10-07 17:25:58 +02:00
|
|
|
|
|
|
|
.docblock code {
|
2022-01-11 17:36:52 -08:00
|
|
|
overflow-wrap: break-word;
|
2021-10-07 17:25:58 +02:00
|
|
|
overflow-wrap: anywhere;
|
|
|
|
}
|
2021-10-24 22:41:48 +02:00
|
|
|
|
2022-10-20 13:22:36 -07:00
|
|
|
nav.sub {
|
2021-10-24 22:41:48 +02:00
|
|
|
flex-direction: column;
|
|
|
|
}
|
|
|
|
|
2022-10-27 13:36:27 -07:00
|
|
|
.search-form {
|
2022-10-20 13:22:36 -07:00
|
|
|
align-self: stretch;
|
2021-10-24 22:41:48 +02:00
|
|
|
}
|
|
|
|
|
2022-10-16 16:59:21 -07:00
|
|
|
.sub-logo-container > img {
|
2021-10-24 22:41:48 +02:00
|
|
|
height: 35px;
|
|
|
|
width: 35px;
|
|
|
|
}
|
2017-12-08 16:36:08 +01:00
|
|
|
}
|
2021-05-09 16:22:22 -07:00
|
|
|
|
2022-11-17 15:24:39 -07:00
|
|
|
.variant,
|
2022-10-21 10:48:41 -07:00
|
|
|
.implementors-toggle > summary,
|
2022-09-28 17:38:25 -07:00
|
|
|
.impl,
|
2022-09-30 09:42:07 -07:00
|
|
|
#implementors-list > .docblock,
|
|
|
|
.impl-items > section,
|
2023-01-10 11:35:37 -07:00
|
|
|
.impl-items > .toggle > summary,
|
2022-10-30 23:10:59 -07:00
|
|
|
.methods > section,
|
2023-01-10 11:35:37 -07:00
|
|
|
.methods > .toggle > summary
|
2022-09-30 10:15:59 -07:00
|
|
|
{
|
2022-01-07 12:39:56 -05:00
|
|
|
margin-bottom: 0.75em;
|
|
|
|
}
|
|
|
|
|
2022-11-17 15:24:39 -07:00
|
|
|
.variants > .docblock,
|
2022-12-13 16:55:45 -07:00
|
|
|
.implementors-toggle > .docblock,
|
2023-01-10 11:35:37 -07:00
|
|
|
.impl-items > .toggle[open]:not(:last-child),
|
|
|
|
.methods > .toggle[open]:not(:last-child),
|
2022-09-27 09:21:24 -07:00
|
|
|
.implementors-toggle[open]:not(:last-child) {
|
2022-01-07 12:39:56 -05:00
|
|
|
margin-bottom: 2em;
|
|
|
|
}
|
|
|
|
|
2023-01-10 11:35:37 -07:00
|
|
|
#trait-implementations-list .impl-items > .toggle:not(:last-child),
|
|
|
|
#synthetic-implementations-list .impl-items > .toggle:not(:last-child),
|
|
|
|
#blanket-implementations-list .impl-items > .toggle:not(:last-child) {
|
2022-01-07 12:39:56 -05:00
|
|
|
margin-bottom: 1em;
|
|
|
|
}
|
2021-08-26 14:43:12 -07:00
|
|
|
|
|
|
|
/* Begin: styles for --scrape-examples feature */
|
2021-05-09 16:22:22 -07:00
|
|
|
|
2022-02-14 19:49:39 -08:00
|
|
|
.scraped-example-list .scrape-help {
|
2022-01-27 17:00:31 -08:00
|
|
|
margin-left: 10px;
|
|
|
|
padding: 0 4px;
|
|
|
|
font-weight: normal;
|
|
|
|
font-size: 12px;
|
|
|
|
position: relative;
|
|
|
|
bottom: 1px;
|
2022-12-30 10:43:06 -07:00
|
|
|
border: 1px solid var(--scrape-example-help-border-color);
|
2022-01-27 18:51:34 -08:00
|
|
|
border-radius: 50px;
|
2022-12-30 10:43:06 -07:00
|
|
|
color: var(--scrape-example-help-color);
|
|
|
|
}
|
|
|
|
.scraped-example-list .scrape-help:hover {
|
|
|
|
border-color: var(--scrape-example-help-hover-border-color);
|
|
|
|
color: var(--scrape-example-help-hover-color);
|
2022-01-27 17:00:31 -08:00
|
|
|
}
|
|
|
|
|
2022-11-27 13:11:21 -06:00
|
|
|
.scraped-example {
|
2022-12-06 09:34:37 -08:00
|
|
|
/* So .scraped-example-title can be positioned absolutely */
|
2022-11-27 13:11:21 -06:00
|
|
|
position: relative;
|
|
|
|
}
|
|
|
|
|
2022-01-27 17:00:31 -08:00
|
|
|
.scraped-example .code-wrapper {
|
|
|
|
position: relative;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
flex-wrap: wrap;
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
|
|
|
|
.scraped-example:not(.expanded) .code-wrapper {
|
2022-12-07 10:24:16 -08:00
|
|
|
/* scrape-examples.js has a constant DEFAULT_MAX_LINES (call it N) for the number
|
|
|
|
* of lines shown in the un-expanded example code viewer. This pre needs to have
|
|
|
|
* a max-height equal to line-height * N. The line-height is currently 1.5em,
|
|
|
|
* and we include additional 10px for padding. */
|
|
|
|
max-height: calc(1.5em * 5 + 10px);
|
2021-05-09 16:22:22 -07:00
|
|
|
}
|
|
|
|
|
2022-01-22 15:32:19 -08:00
|
|
|
.scraped-example:not(.expanded) .code-wrapper pre {
|
2021-10-07 09:46:18 -07:00
|
|
|
overflow-y: hidden;
|
2021-10-07 10:27:09 -07:00
|
|
|
padding-bottom: 0;
|
2022-12-07 10:24:16 -08:00
|
|
|
/* See above comment, should be the same max-height. */
|
|
|
|
max-height: calc(1.5em * 5 + 10px);
|
2021-10-07 09:46:18 -07:00
|
|
|
}
|
|
|
|
|
2022-11-27 13:11:21 -06:00
|
|
|
.more-scraped-examples .scraped-example:not(.expanded) .code-wrapper,
|
|
|
|
.more-scraped-examples .scraped-example:not(.expanded) .code-wrapper pre {
|
2022-12-07 10:24:16 -08:00
|
|
|
/* See above comment, except this height is based on HIDDEN_MAX_LINES. */
|
|
|
|
max-height: calc(1.5em * 10 + 10px);
|
2021-10-07 09:46:18 -07:00
|
|
|
}
|
|
|
|
|
2022-10-29 12:23:10 +02:00
|
|
|
.scraped-example .code-wrapper .next,
|
|
|
|
.scraped-example .code-wrapper .prev,
|
|
|
|
.scraped-example .code-wrapper .expand {
|
2022-12-06 11:24:26 -08:00
|
|
|
color: var(--main-color);
|
2021-05-09 16:22:22 -07:00
|
|
|
position: absolute;
|
|
|
|
top: 0.25em;
|
2022-10-29 12:23:10 +02:00
|
|
|
z-index: 1;
|
2022-11-19 12:27:40 -07:00
|
|
|
padding: 0;
|
|
|
|
background: none;
|
|
|
|
border: none;
|
|
|
|
/* iOS button gradient: https://stackoverflow.com/q/5438567 */
|
|
|
|
-webkit-appearance: none;
|
|
|
|
opacity: 1;
|
2021-05-09 16:22:22 -07:00
|
|
|
}
|
2022-10-29 12:23:10 +02:00
|
|
|
.scraped-example .code-wrapper .prev {
|
|
|
|
right: 2.25em;
|
|
|
|
}
|
2021-05-09 16:22:22 -07:00
|
|
|
.scraped-example .code-wrapper .next {
|
|
|
|
right: 1.25em;
|
|
|
|
}
|
|
|
|
.scraped-example .code-wrapper .expand {
|
|
|
|
right: 0.25em;
|
|
|
|
}
|
|
|
|
|
2023-01-22 11:11:29 +01:00
|
|
|
.scraped-example:not(.expanded) .code-wrapper::before,
|
|
|
|
.scraped-example:not(.expanded) .code-wrapper::after {
|
2021-05-09 16:22:22 -07:00
|
|
|
content: " ";
|
|
|
|
width: 100%;
|
2021-10-07 09:46:18 -07:00
|
|
|
height: 5px;
|
2021-05-09 16:22:22 -07:00
|
|
|
position: absolute;
|
2022-10-29 12:23:10 +02:00
|
|
|
z-index: 1;
|
|
|
|
}
|
2023-01-22 11:11:29 +01:00
|
|
|
.scraped-example:not(.expanded) .code-wrapper::before {
|
2021-05-09 16:22:22 -07:00
|
|
|
top: 0;
|
2023-01-21 12:15:42 +01:00
|
|
|
background: linear-gradient(to bottom,
|
|
|
|
var(--scrape-example-code-wrapper-background-start),
|
|
|
|
var(--scrape-example-code-wrapper-background-end));
|
2021-05-09 16:22:22 -07:00
|
|
|
}
|
2023-01-22 11:11:29 +01:00
|
|
|
.scraped-example:not(.expanded) .code-wrapper::after {
|
2021-05-09 16:22:22 -07:00
|
|
|
bottom: 0;
|
2023-01-21 12:15:42 +01:00
|
|
|
background: linear-gradient(to top,
|
|
|
|
var(--scrape-example-code-wrapper-background-start),
|
|
|
|
var(--scrape-example-code-wrapper-background-end));
|
2021-05-09 16:22:22 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
.scraped-example .code-wrapper .example-wrap {
|
2022-11-26 21:39:39 -06:00
|
|
|
width: 100%;
|
2021-05-09 16:22:22 -07:00
|
|
|
overflow-y: hidden;
|
|
|
|
margin-bottom: 0;
|
|
|
|
}
|
|
|
|
|
2022-01-27 17:00:31 -08:00
|
|
|
.scraped-example:not(.expanded) .code-wrapper .example-wrap {
|
|
|
|
overflow-x: hidden;
|
|
|
|
}
|
|
|
|
|
2022-12-28 17:14:17 +01:00
|
|
|
.scraped-example .example-wrap .rust span.highlight {
|
|
|
|
background: var(--scrape-example-code-line-highlight);
|
|
|
|
}
|
|
|
|
.scraped-example .example-wrap .rust span.highlight.focus {
|
|
|
|
background: var(--scrape-example-code-line-highlight-focus);
|
|
|
|
}
|
|
|
|
|
2021-10-06 21:43:40 -07:00
|
|
|
.more-examples-toggle {
|
2022-01-27 17:00:31 -08:00
|
|
|
max-width: calc(100% + 25px);
|
2021-10-06 21:43:40 -07:00
|
|
|
margin-top: 10px;
|
2022-01-27 17:00:31 -08:00
|
|
|
margin-left: -25px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.more-examples-toggle .hide-more {
|
|
|
|
margin-left: 25px;
|
|
|
|
cursor: pointer;
|
2021-10-06 21:43:40 -07:00
|
|
|
}
|
|
|
|
|
2021-05-09 16:22:22 -07:00
|
|
|
.more-scraped-examples {
|
2022-12-21 18:03:31 -07:00
|
|
|
margin-left: 25px;
|
|
|
|
position: relative;
|
2021-08-25 20:15:46 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
.toggle-line {
|
2022-12-21 18:03:31 -07:00
|
|
|
position: absolute;
|
|
|
|
top: 5px;
|
|
|
|
bottom: 0;
|
|
|
|
right: calc(100% + 10px);
|
2021-08-25 20:15:46 -07:00
|
|
|
padding: 0 4px;
|
|
|
|
cursor: pointer;
|
|
|
|
}
|
|
|
|
|
|
|
|
.toggle-line-inner {
|
|
|
|
min-width: 2px;
|
|
|
|
height: 100%;
|
2022-12-24 08:28:59 +01:00
|
|
|
background: var(--scrape-example-toggle-line-background);
|
|
|
|
}
|
|
|
|
|
|
|
|
.toggle-line:hover .toggle-line-inner {
|
|
|
|
background: var(--scrape-example-toggle-line-hover-background);
|
2021-08-25 20:15:46 -07:00
|
|
|
}
|
|
|
|
|
2022-12-16 10:11:37 -07:00
|
|
|
.more-scraped-examples .scraped-example, .example-links {
|
|
|
|
margin-top: 20px;
|
2021-09-14 09:50:47 -07:00
|
|
|
}
|
|
|
|
|
2022-12-16 10:11:37 -07:00
|
|
|
.more-scraped-examples .scraped-example:first-child {
|
|
|
|
margin-top: 5px;
|
2021-08-25 20:15:46 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
.example-links ul {
|
|
|
|
margin-bottom: 0;
|
2021-05-09 16:22:22 -07:00
|
|
|
}
|
2021-08-26 14:43:12 -07:00
|
|
|
|
|
|
|
/* End: styles for --scrape-examples feature */
|