From c4c4ff67fae06d17f85a84c1b2fb81863d5296aa Mon Sep 17 00:00:00 2001 From: Lukas Markeffsky <@> Date: Sun, 31 Dec 2023 22:25:46 +0100 Subject: [PATCH] use css variable for z-index of the sidebar and calculate the z-indices of things that go over the sidebar --- src/librustdoc/html/static/css/rustdoc.css | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css index 76e9f534581c1..c4e97ded1a058 100644 --- a/src/librustdoc/html/static/css/rustdoc.css +++ b/src/librustdoc/html/static/css/rustdoc.css @@ -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. */ @@ -396,7 +397,7 @@ img { height: 100vh; top: 0; left: 0; - z-index: 100; + z-index: var(--desktop-sidebar-z-index); } .rustdoc.src .sidebar { @@ -416,7 +417,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 */ @@ -448,7 +449,6 @@ img { .sidebar-resizing .sidebar { position: fixed; - z-index: 100; } .sidebar-resizing > body { padding-left: var(--resizing-sidebar-width); @@ -1059,7 +1059,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);