Skip to content

Commit 86b31ec

Browse files
committed
fix(view-browser): actually elevate header above main for dropdown overlay
PR #105 added `header { z-index: 100; }` intending to put the Recent-runs dropdown above `<main>`. It didn't work because there's an earlier rule: body > * { position: relative; z-index: 1; } That selector has specificity (0,0,0,2) vs `header`'s (0,0,0,1), so it overrode the bump. Both `<header>` and `<main>` ended up at z-index 1 and source order made `<main>` paint on top — so the dropdown was still being clipped by the highlighted scan-path `<code>` and the dashboard cards. Fixes by raising the header's z-index via a selector that matches or beats `body > *`: body > header { z-index: 100; } The `.recent-scans-list` z-index 1000 inside header's stacking context already wins against the dashboard cards, so this single rule is enough. The earlier (now ineffective) `position: relative; z-index: 100;` block on the bare `header` selector is dropped — a comment near the original location points readers at the new specificity-aware rule so the cause-of-the-fix is discoverable. All 178 browser-viewer tests still pass.
1 parent c68a1c9 commit 86b31ec

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

argus/viewers/browser/static/argus.css

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,12 @@ body::before {
159159
z-index: 0;
160160
}
161161
body > * { position: relative; z-index: 1; }
162+
/* The Recent-runs dropdown lives inside <header>; without bumping the
163+
* header's stacking context above main/footer, source order makes
164+
* <main> paint on top and the dropdown gets clipped by anything in
165+
* the body. The selector specificity has to beat the rule above
166+
* (`body > *`) — a plain `header { z-index: 100 }` does not. */
167+
body > header { z-index: 100; }
162168

163169
header, main, footer { padding: 1rem 1.5rem; max-width: var(--max-width); margin: 0 auto; }
164170

@@ -168,12 +174,9 @@ header {
168174
margin-bottom: 1.5rem;
169175
flex-wrap: wrap; gap: 0.5rem 1rem;
170176
padding-top: 1.25rem; padding-bottom: 1.25rem;
171-
/* Promote the header into its own stacking context above <main> so
172-
* absolutely-positioned descendants (the Recent-runs dropdown) can
173-
* overlay the highlighted scan-path block and any other downstream
174-
* content. Without this, source order makes <main> paint on top. */
175-
position: relative;
176-
z-index: 100;
177+
/* Stacking-context promotion lives in `body > header` above so it
178+
* beats the `body > *` specificity. A plain `header { z-index: ... }`
179+
* is overridden by that rule and the dropdown gets clipped by main. */
177180
}
178181
header .brand {
179182
display: flex; align-items: center; gap: 0.6rem;

0 commit comments

Comments
 (0)