rustdoc: fix source view

This commit is contained in:
cynecx 2021-10-10 00:52:14 +02:00 committed by Guillaume Gomez
parent 135281ed15
commit 1e98fb1027
2 changed files with 61 additions and 11 deletions

View File

@ -261,11 +261,19 @@ main {
overflow-y: auto;
}
.source main {
padding: 15px;
}
.main-inner {
max-width: 960px;
margin-right: auto;
}
.source .main-inner {
max-width: unset;
}
details:not(.rustdoc-toggle) summary {
margin-bottom: .6em;
}
@ -310,6 +318,7 @@ li {
}
nav.sub {
position: relative;
font-size: 16px;
text-transform: uppercase;
}
@ -325,6 +334,10 @@ nav.sub {
height: 100vh;
}
.source .sidebar {
display: none;
}
/* Improve the scrollbar display on firefox */
* {
scrollbar-width: initial;
@ -354,6 +367,18 @@ nav.sub {
display: none !important;
}
.logo-source {
display: none;
}
.source .logo-source {
display: block;
position: absolute;
top: 0;
left: 0;
width: 200px;
}
.logo-container {
height: 100px;
width: 100px;
@ -716,6 +741,9 @@ nav:not(.sidebar) {
padding-bottom: 10px;
margin-bottom: 25px;
}
.source nav:not(.sidebar).sub {
margin-left: 230px;
}
nav.main {
padding: 20px 0;
text-align: center;
@ -805,6 +833,7 @@ h2.small-section-header > .anchor {
.search-container {
position: relative;
max-width: 960px;
}
.search-container > div {
display: inline-flex;
@ -1357,8 +1386,8 @@ pre.rust {
.theme-picker {
position: absolute;
left: 11px;
top: 19px;
left: -34px;
top: 9px;
}
.theme-picker button {
@ -1767,10 +1796,18 @@ details.rustdoc-toggle[open] > summary.hideme::after {
margin-bottom: 10px;
}
.source nav:not(.sidebar).sub {
margin-left: 32px;
}
.content {
margin-left: 0px;
}
.source .content {
margin-top: 10px;
}
#search {
margin-left: 0;
padding: 0;
@ -1781,8 +1818,6 @@ details.rustdoc-toggle[open] > summary.hideme::after {
}
.theme-picker {
left: 10px;
top: 9px;
z-index: 1;
}
@ -1909,6 +1944,10 @@ details.rustdoc-toggle[open] > summary.hideme::after {
.search-results div.desc, .search-results .result-description, .item-right {
padding-left: 2em;
}
.source .logo-source {
display: none;
}
}
@media print {

View File

@ -83,14 +83,25 @@
</nav> {#- -#}
<main> {#- -#}
<div class="main-inner"> {#- -#}
<div class="theme-picker"> {#- -#}
<button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"> {#- -#}
<img width="18" height="18" alt="Pick another theme!" {# -#}
src="{{static_root_path | safe}}brush{{page.resource_suffix}}.svg"> {#- -#}
</button> {#- -#}
<div id="theme-choices" role="menu"></div> {#- -#}
</div> {#- -#}
<a class="logo-source" href='{{page.root_path | safe}}{{krate_with_trailing_slash | safe}}index.html'> {#- -#}
<div class='logo-container rust-logo'> {#- -#}
<img src='
{%- if layout.logo -%}
{{layout.logo}}
{%- else -%}
{{static_root_path | safe}}rust-logo{{page.resource_suffix}}.png
{%- endif -%}
' alt='logo'> {#- -#}
</div> {#- -#}
</a> {#- -#}
<nav class="sub"> {#- -#}
<div class="theme-picker"> {#- -#}
<button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"> {#- -#}
<img width="18" height="18" alt="Pick another theme!" {# -#}
src="{{static_root_path | safe}}brush{{page.resource_suffix}}.svg"> {#- -#}
</button> {#- -#}
<div id="theme-choices" role="menu"></div> {#- -#}
</div> {#- -#}
<form class="search-form"> {#- -#}
<div class="search-container"> {#- -#}
<div>{%- if layout.generate_search_filter -%}