about summary refs log tree commit diff
path: root/src/librustdoc/html/static/js/source-script.js
diff options
context:
space:
mode:
authorJacob Hoffman-Andrews <github@hoffman-andrews.com>2022-01-06 19:48:24 -0500
committerJacob Hoffman-Andrews <github@hoffman-andrews.com>2022-01-18 10:43:14 -0800
commit6a5f8b1aef1417d7dc85b5d0a229d2db1930eb7c (patch)
treeb6dd1a95f8f47373a9b919dbc64dc368324631b1 /src/librustdoc/html/static/js/source-script.js
parent7bc7be860f99f4a40d45b0f74e2d01b02e072357 (diff)
downloadrust-6a5f8b1aef1417d7dc85b5d0a229d2db1930eb7c.tar.gz
rust-6a5f8b1aef1417d7dc85b5d0a229d2db1930eb7c.zip
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.
Diffstat (limited to 'src/librustdoc/html/static/js/source-script.js')
-rw-r--r--src/librustdoc/html/static/js/source-script.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librustdoc/html/static/js/source-script.js b/src/librustdoc/html/static/js/source-script.js
index 81dc0b2fb1e..498f60e9f25 100644
--- a/src/librustdoc/html/static/js/source-script.js
+++ b/src/librustdoc/html/static/js/source-script.js
@@ -139,7 +139,7 @@ function createSourceSidebar() {
                                       currentFile, hasFoundFile);
     });
 
-    container.insertBefore(sidebar, document.querySelector(".sidebar-logo").nextSibling);
+    container.appendChild(sidebar);
     // Focus on the current file in the source files sidebar.
     var selected_elem = sidebar.getElementsByClassName("selected")[0];
     if (typeof selected_elem !== "undefined") {