]> git.lizzy.rs Git - rust.git/commitdiff
rustdoc: show logo in source sub nav
authorcynecx <me@cynecx.net>
Sun, 24 Oct 2021 20:41:48 +0000 (22:41 +0200)
committerGuillaume Gomez <guillaume.gomez@huawei.com>
Mon, 29 Nov 2021 10:13:40 +0000 (11:13 +0100)
src/librustdoc/html/static/css/rustdoc.css
src/librustdoc/html/static/css/themes/ayu.css
src/librustdoc/html/static/css/themes/dark.css
src/librustdoc/html/static/css/themes/light.css
src/librustdoc/html/templates/page.html

index c71d9fc6adf3e8cfd670df943e516e8b09140aa6..59ac80ec0af82a06b8d6f4756abad5cf46cb9f89 100644 (file)
@@ -321,6 +321,27 @@ nav.sub {
        text-transform: uppercase;
 }
 
+.sub-container {
+       display: flex;
+       flex-direction: row;
+       flex-wrap: nowrap;
+}
+
+.sub-logo-container {
+       display: none;
+       margin-right: 20px;
+}
+
+.source .sub-logo-container {
+       display: block;
+}
+
+.source .sub-logo-container > img {
+       height: 60px;
+       width: 60px;
+       object-fit: contain;
+}
+
 .sidebar {
        width: 200px;
        overflow-y: scroll;
@@ -742,6 +763,7 @@ nav.sub {
 }
 
 nav:not(.sidebar) {
+       flex-grow: 1;
        border-bottom: 1px solid;
        padding-bottom: 10px;
        margin-bottom: 25px;
@@ -2017,6 +2039,19 @@ details.rustdoc-toggle[open] > summary.hideme::after {
        .docblock code {
                overflow-wrap: anywhere;
        }
+
+       .sub-container {
+               flex-direction: column;
+       }
+
+       .sub-logo-container {
+               align-self: center;
+       }
+
+       .source .sub-logo-container > img {
+               height: 35px;
+               width: 35px;
+       }
 }
 
 
index 2655ea3ccd1f84645a2aad4d286c4fe5b4357baa..f4f654f4745268ddb78dc9a270e359898e7846b0 100644 (file)
@@ -61,7 +61,7 @@ pre, .rustdoc.source .example-wrap {
        background-color: #14191f;
 }
 
-.logo-container.rust-logo > img {
+.rust-logo > img {
        filter: drop-shadow(1px 0 0px #fff)
                drop-shadow(0 1px 0 #fff)
                drop-shadow(-1px 0 0 #fff)
index b125207c3906a3da7598ddf7bf8d6871c2c9d3ff..b10b80203802938682ff7fe8c56c698b3a86b200 100644 (file)
@@ -32,7 +32,7 @@ pre, .rustdoc.source .example-wrap {
        background-color: #505050;
 }
 
-.logo-container.rust-logo > img {
+.rust-logo > img {
        filter: drop-shadow(1px 0 0px #fff)
                drop-shadow(0 1px 0 #fff)
                drop-shadow(-1px 0 0 #fff)
index 898ae98ddd0211d375bea31d2a42420a0c7f555c..97f32ac1f7de37b47368fc65c091b7d5a0e8437b 100644 (file)
@@ -43,7 +43,7 @@ pre, .rustdoc.source .example-wrap {
        scrollbar-color: rgba(36, 37, 39, 0.6) #d9d9d9;
 }
 
-.logo-container.rust-logo > img {
+.rust-logo > img {
        /* No need for a border in here! */
 }
 
index 14bf35b6a2e4a6949c8c30b0633bd6b93a49424c..b94a632f109ff36428b7b2d435f0fe4f2421e238 100644 (file)
         <div class="sidebar-menu" role="button">&#9776;</div> {#- -#}
         <a class="sidebar-logo" 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'> {#- -#}
+                <img src='
+                    {%- if layout.logo -%}
+                    {{layout.logo}}
+                    {%- else -%}
+                    {{static_root_path | safe}}rust-logo{{page.resource_suffix}}.png
+                    {%- endif -%}
+                    ' alt='logo'> {#- -#}
             </div> {#- -#}
         </a> {#- -#}
         {{- sidebar | safe -}}
     </nav> {#- -#}
     <main> {#- -#}
         <div class="main-inner"> {#- -#}
-            <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 -%}
-                            <select id="crate-search"> {#- -#}
-                                <option value="All crates">All crates</option> {#- -#}
-                            </select> {#- -#}
-                            {%- endif -%}
-                            <input {# -#}
-                                class="search-input" {# -#}
-                                name="search" {# -#}
-                                autocomplete="off" {# -#}
-                                spellcheck="false" {# -#}
-                                placeholder="Click or press ‘S’ to search, ‘?’ for more options…" {# -#}
-                                type="search"> {#- -#}
-                        </div> {#- -#}
-                        <button type="button" id="help-button" title="help">?</button> {#- -#}
-                        <a id="settings-menu" href="{{page.root_path | safe}}settings.html" title="settings"> {#- -#}
-                            <img width="18" height="18" alt="Change settings" {# -#}
-                                 src="{{static_root_path | safe}}wheel{{page.resource_suffix}}.svg"> {#- -#}
-                        </a> {#- -#}
+            <div class="sub-container"> {#- -#}
+                <a class="sub-logo-container rust-logo" href='{{page.root_path | safe}}{{krate_with_trailing_slash | safe}}index.html'> {#- -#}
+                    <img src='
+                        {%- if layout.logo -%}
+                        {{layout.logo}}
+                        {%- else -%}
+                        {{static_root_path | safe}}rust-logo{{page.resource_suffix}}.png
+                        {%- endif -%}
+                        ' alt='logo'> {#- -#}
+                </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> {#- -#}
-            </nav> {#- -#}
+                    <form class="search-form"> {#- -#}
+                        <div class="search-container"> {#- -#}
+                            <div>{%- if layout.generate_search_filter -%}
+                                <select id="crate-search"> {#- -#}
+                                    <option value="All crates">All crates</option> {#- -#}
+                                </select> {#- -#}
+                                {%- endif -%}
+                                <input {# -#}
+                                    class="search-input" {# -#}
+                                    name="search" {# -#}
+                                    disabled {# -#}
+                                    autocomplete="off" {# -#}
+                                    spellcheck="false" {# -#}
+                                    placeholder="Click or press ‘S’ to search, ‘?’ for more options…" {# -#}
+                                    type="search"> {#- -#}
+                            </div> {#- -#}
+                            <button type="button" id="help-button" title="help">?</button> {#- -#}
+                            <a id="settings-menu" href="{{page.root_path | safe}}settings.html" title="settings"> {#- -#}
+                                <img width="18" height="18" alt="Change settings" {# -#}
+                                     src="{{static_root_path | safe}}wheel{{page.resource_suffix}}.svg"> {#- -#}
+                            </a> {#- -#}
+                        </div> {#- -#}
+                    </form> {#- -#}
+                </nav> {#- -#}
+            </div> {#- -#}
             <section id="main" class="content">{{- content | safe -}}</section> {#- -#}
             <section id="search" class="content hidden"></section> {#- -#}
         </div> {#- -#}