Skip to content

Commit

Permalink
use css variable for z-index of the sidebar
Browse files Browse the repository at this point in the history
and calculate the z-indices of things that go over the sidebar
  • Loading branch information
Lukas Markeffsky committed Dec 31, 2023
1 parent e306044 commit 0c6d43d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/librustdoc/html/static/css/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
and on the RUSTDOC_MOBILE_BREAKPOINT */
--desktop-sidebar-width: 200px;
--src-sidebar-width: 300px;
--desktop-sidebar-z-index: 100;
}

/* See FiraSans-LICENSE.txt for the Fira Sans license. */
Expand Down Expand Up @@ -386,7 +387,7 @@ img {
height: 100vh;
top: 0;
left: 0;
z-index: 100;
z-index: var(--desktop-sidebar-z-index);
}

.rustdoc.src .sidebar {
Expand All @@ -407,7 +408,7 @@ img {
touch-action: none;
width: 9px;
cursor: col-resize;
z-index: 200;
z-index: calc(var(--desktop-sidebar-z-index) + 1);
position: fixed;
height: 100%;
/* make sure there's a 1px gap between the scrollbar and resize handle */
Expand Down Expand Up @@ -1045,7 +1046,7 @@ so that we can apply CSS-filters to change the arrow color in themes */
position: absolute;
top: 100%;
right: 0;
z-index: 101;
z-index: calc(var(--desktop-sidebar-z-index) + 1);
margin-top: 7px;
border-radius: 3px;
border: 1px solid var(--border-color);
Expand Down Expand Up @@ -1556,7 +1557,7 @@ a.tooltip:hover::after {
height: 34px;
width: 34px;
background-color: var(--main-background-color);
z-index: 101;
z-index: calc(var(--desktop-sidebar-z-index) + 1);
}
.hide-sidebar .src #sidebar-button {
position: static;
Expand Down

0 comments on commit 0c6d43d

Please sign in to comment.