Skip to content

Commit 8eaefc9

Browse files
demo: don't tuck step pickers under the top nav bar
Both the Appearances StepPicker and the States picker were sticky/ fixed with a low z-index, so they slid under the z-100 nav bar on scroll. Park them with --demo-nav-height offset instead. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 6cf58d1 commit 8eaefc9

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

‎packages/demo/src/Appearances.tsx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -815,7 +815,8 @@ function StepPicker({
815815
<div
816816
style={{
817817
position: "sticky",
818-
top: 0,
818+
// Park just under the demo's top nav bar so we don't slide under it.
819+
top: "var(--demo-nav-height)",
819820
zIndex: 10,
820821
background: "var(--background)",
821822
borderBottom: "1px solid var(--border)",

‎packages/demo/src/States.tsx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,9 @@ export function States() {
222222
const pickerStyles: Record<string, React.CSSProperties> = {
223223
wrapper: {
224224
position: "fixed",
225-
top: 16,
225+
// Sits just below the demo's top nav bar (which is sticky with z-index
226+
// 100). 16px gap keeps it from butting against the nav border.
227+
top: "calc(var(--demo-nav-height) + 16px)",
226228
right: 16,
227229
zIndex: 50,
228230
background: "var(--card)",

‎packages/demo/src/globals.css‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
--muted-foreground: #6b7280;
1414
--border: #e5e7eb;
1515
--accent: #6366f1;
16+
/* Pinned in JSX too — used by sticky elements (e.g. Appearances StepPicker)
17+
so they don't slide under the top tab bar. */
18+
--demo-nav-height: 49px;
1619
}
1720

1821
@media (prefers-color-scheme: dark) {

0 commit comments

Comments
 (0)