Skip to content

Commit

Permalink
Rollup merge of rust-lang#99713 - GuillaumeGomez:fix-sidebar-backgrou…
Browse files Browse the repository at this point in the history
…nd, r=notriddle

Fix sidebar background

Fixes rust-lang#99691.

cc `@jsha`
r? `@notriddle`
  • Loading branch information
JohnTitor authored Jul 25, 2022
2 parents b37b39d + 8db7249 commit e58bfac
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/librustdoc/html/static/css/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -1855,7 +1855,6 @@ in storage.js plus the media query with (min-width: 701px)
the sidebar stays visible for screen readers, which is useful for navigation. */
left: -1000px;
margin-left: 0;
background-color: rgba(0,0,0,0);
margin: 0;
padding: 0;
z-index: 11;
Expand Down
22 changes: 22 additions & 0 deletions src/test/rustdoc-gui/sidebar-mobile.goml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,25 @@ assert-position: ("#method\.must_use", {"y": 45})
click: ".sidebar-menu-toggle"
scroll-to: ".block.keyword li:nth-child(1)"
compare-elements-position-near: (".block.keyword li:nth-child(1)", ".mobile-topbar", {"y": 543})

// Now checking the background color of the sidebar.
local-storage: {"rustdoc-use-system-theme": "false", "rustdoc-theme": "dark"}
reload:

// Open the sidebar menu.
click: ".sidebar-menu-toggle"
assert-css: (".sidebar", {"background-color": "rgb(80, 80, 80)"})

local-storage: {"rustdoc-use-system-theme": "false", "rustdoc-theme": "ayu"}
reload:

// Open the sidebar menu.
click: ".sidebar-menu-toggle"
assert-css: (".sidebar", {"background-color": "rgb(20, 25, 31)"})

local-storage: {"rustdoc-use-system-theme": "false", "rustdoc-theme": "light"}
reload:

// Open the sidebar menu.
click: ".sidebar-menu-toggle"
assert-css: (".sidebar", {"background-color": "rgb(245, 245, 245)"})

0 comments on commit e58bfac

Please sign in to comment.