Skip to content

Commit

Permalink
Rollup merge of #103493 - notriddle:notriddle/source-sidebar-logo, r=…
Browse files Browse the repository at this point in the history
…GuillaumeGomez

rustdoc: remove unused `.sidebar-logo` DOM on source pages
  • Loading branch information
Yuki Okushi authored Oct 24, 2022
2 parents d77e239 + 4e1abcd commit 9ecba38
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
4 changes: 4 additions & 0 deletions src/librustdoc/html/static/css/noscript.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@ nav.sub {
/* The search bar and related controls don't work without JS */
display: none;
}

.source .sidebar {
display: none;
}
4 changes: 0 additions & 4 deletions src/librustdoc/html/static/css/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -402,10 +402,6 @@ img {
overflow-y: hidden;
}

.rustdoc.source .sidebar .sidebar-logo {
display: none;
}

.source .sidebar, #sidebar-toggle, #source-sidebar {
background-color: var(--sidebar-background-color);
}
Expand Down
2 changes: 2 additions & 0 deletions src/librustdoc/html/templates/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ <h2></h2> {#- -#}
</nav> {#- -#}
{%- endif -%}
<nav class="sidebar"> {#- -#}
{%- if page.css_class != "source" -%}
<a class="sidebar-logo" href="{{page.root_path|safe}}{{krate_with_trailing_slash|safe}}index.html"> {#- -#}
<div class="logo-container"> {#- -#}
{%- if !layout.logo.is_empty() %}
Expand All @@ -98,6 +99,7 @@ <h2></h2> {#- -#}
{%- endif -%}
</div> {#- -#}
</a> {#- -#}
{%- endif -%}
{{- sidebar|safe -}}
</nav> {#- -#}
<main> {#- -#}
Expand Down
2 changes: 1 addition & 1 deletion src/test/rustdoc-gui/sidebar-source-code-display.goml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ javascript: false
goto: "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html"
// Since the javascript is disabled, there shouldn't be a toggle.
assert-false: "#sidebar-toggle"
wait-for-css: (".sidebar > *", {"visibility": "hidden"})
wait-for-css: (".sidebar", {"display": "none"})

// Let's retry with javascript enabled.
javascript: true
Expand Down

0 comments on commit 9ecba38

Please sign in to comment.