Skip to content

Commit

Permalink
rustdoc: remove unused .sidebar-logo DOM on source pages
Browse files Browse the repository at this point in the history
  • Loading branch information
notriddle committed Oct 24, 2022
1 parent c07a6a9 commit 4e1abcd
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 4e1abcd

Please sign in to comment.