diff --git a/res/css/global.css b/res/css/global.css index 80e3ccb15d..8ac01e02d1 100644 --- a/res/css/global.css +++ b/res/css/global.css @@ -3,6 +3,37 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ :root { + /* ===================== + * Z-index scale + * ===================== */ + --z-tab-selected: 1; + --z-warning: 4; + --z-root: 0; + --z-bottom-box: 1; + --z-serviceworker-notice: 4; + --z-arrow-panel: 5; + --z-copy-table-warning: 4; + --z-tree-view: 0; + --z-tree-view-inner: 2; + --z-overflow-edge-indicator: 3; + --z-chart-viewport-expanded: 1; + --z-timeline-selection: 1; + --z-timeline-selection-overlay: 2; + --z-timeline-selection-overlay-time: 1; + --z-timeline-selection-grippy: 3; + --z-timeline-track-local: 3; + --z-timeline-track-thread: 1; + --z-timeline-track-screenshot: 4; /* should be higher than any other timeline element */ + --z-keyboard-shortcuts: 11; /* should be highest possible value */ + --z-context-menu: 5; /* should be higher than --z-overflow-edge-indicator and --z-timeline-track-screenshot */ + --z-panel-search: 1; + --z-panel-search-introduction: -1; + --z-timeline-header: 1; + --z-tracks-container: 0; /* should be below --z-timeline-header */ + + /* ===================== + * Colors & theming + * ===================== */ --base-foreground-color: #000; --base-background-color: #fff; --base-border-color: var(--grey-30); diff --git a/src/components/app/BottomBox.css b/src/components/app/BottomBox.css index d337882d52..dc80d0345b 100644 --- a/src/components/app/BottomBox.css +++ b/src/components/app/BottomBox.css @@ -33,7 +33,7 @@ /* Provide 3px extra grabbable surface on each side of the splitter */ .bottom-box .layout-splitter::before { position: absolute; - z-index: 1; + z-index: var(--z-bottom-box); display: block; content: ''; inset: 0 -3px; diff --git a/src/components/app/KeyboardShortcut.css b/src/components/app/KeyboardShortcut.css index 3898f85c5a..8b9ba8fab2 100644 --- a/src/components/app/KeyboardShortcut.css +++ b/src/components/app/KeyboardShortcut.css @@ -8,6 +8,7 @@ --internal-shadow-color: rgb(0 0 0 / 0.4); position: absolute; + z-index: var(--z-keyboard-shortcuts); top: 0; left: 0; display: none; diff --git a/src/components/app/ProfileViewer.css b/src/components/app/ProfileViewer.css index 36b349703b..1fdf52b78f 100644 --- a/src/components/app/ProfileViewer.css +++ b/src/components/app/ProfileViewer.css @@ -110,11 +110,11 @@ } .profileViewerSplitter { - /* Create a stacking context, so that the KeyboardShortcut can overlay the profile - viewer. In addition, the built-in class uses position: absolute, which is not - appropriate here. */ + /* Position relative for layout. Don't set z-index here to avoid creating a + stacking context that would trap the context menu below the screenshot hover. + This allows both the screenshot hover and context menu to be compared + at the .profileViewer level, ensuring the context menu appears on top. */ position: relative; - z-index: 0; } .profileViewerSplitter > .layout-pane:not(.layout-pane-primary) { diff --git a/src/components/app/ProfileViewer.tsx b/src/components/app/ProfileViewer.tsx index dcfeafcb9c..e00a87117d 100644 --- a/src/components/app/ProfileViewer.tsx +++ b/src/components/app/ProfileViewer.tsx @@ -103,7 +103,6 @@ class ProfileViewerImpl extends PureComponent { } as React.CSSProperties) } > -
{hasZipFile ? (