Commit 5c6d2cf
docs: keep --vp-layout-top-height in sync via ResizeObserver
The height CSS variable was set once in a single rAF and never updated
afterward. On window resize, orientation change, or text reflow the
banner height could change, leaving the VitePress nav offset stale and
causing overlap or a visible gap. Observe the banner element and
resync the variable whenever its size changes; disconnect the observer
when the banner is dismissed.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>1 parent 519d421 commit 5c6d2cf
1 file changed
Lines changed: 15 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
46 | 58 | | |
47 | 59 | | |
48 | 60 | | |
49 | 61 | | |
50 | 62 | | |
51 | 63 | | |
| 64 | + | |
52 | 65 | | |
53 | 66 | | |
54 | 67 | | |
55 | 68 | | |
56 | 69 | | |
57 | 70 | | |
58 | 71 | | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
| 72 | + | |
| 73 | + | |
65 | 74 | | |
0 commit comments