From 6a5f8b1aef1417d7dc85b5d0a229d2db1930eb7c Mon Sep 17 00:00:00 2001 From: Jacob Hoffman-Andrews Date: Thu, 6 Jan 2022 19:48:24 -0500 Subject: 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. --- src/test/rustdoc-gui/sidebar-source-code.goml | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/test/rustdoc-gui/sidebar-source-code.goml') diff --git a/src/test/rustdoc-gui/sidebar-source-code.goml b/src/test/rustdoc-gui/sidebar-source-code.goml index 98f4fdf4233..1c5eb9239ba 100644 --- a/src/test/rustdoc-gui/sidebar-source-code.goml +++ b/src/test/rustdoc-gui/sidebar-source-code.goml @@ -10,6 +10,7 @@ click: (10, 10) // We wait for the sidebar to be expanded (there is a 0.5s animation). wait-for: 600 assert-css: ("nav.sidebar.expanded", {"width": "300px"}) +assert-css: ("nav.sidebar.expanded a", {"font-size": "14.4px"}) // We collapse the sidebar. click: (10, 10) // We wait for the sidebar to be collapsed (there is a 0.5s animation). @@ -30,3 +31,6 @@ click: (10, 10) // We ensure that the class has been removed. assert-false: "nav.sidebar.expanded" assert: "nav.sidebar" + +// Check that the topbar is not visible +assert-property: (".mobile-topbar", {"offsetParent": "null"}) -- cgit 1.4.1-3-g733a5