fix(promo-banner): restore scroll-hide animation + keep banner visible under open menu#505
Conversation
The pure-CSS scroll-driven hide (--promo-cur collapse via @Keyframes promo-collapse / promo-vanish under @supports (animation-timeline: scroll())) was silently dropped from _starlight-overrides.scss during the PR thingsboard#465 merge (7e75f81), so the docs banner no longer collapsed on scroll. The merge also trimmed the --promo-anim:none banner-less-page fallback from PromoBanner.astro, leaving the degenerate 0 0px range / stale band the comment warns about. Restore both verbatim from the last good commit (58897de) and drop the now-false comment claiming the animation lives in PromoBanner.astro. main still has this animation (it never went through the bad merge), so landing this on develop first keeps develop->main from silently deleting it on main.
The shared-header refactor (thingsboard#465) moved #promo-banner inside Starlight's header.header wrapper on marketing too (it used to be a sibling), so the `header.header.opened-burger #promo-banner { display: none }` rule — added in thingsboard#449 for the old docs-only layout — now fired on marketing as well. Opening the burger at the top of the page hid the banner but left the drawer at its --promo-cur offset, leaving an empty ~40px band above the menu (and a jump). Drop the display:none rule. The drawer already anchors at top:--promo-cur, below the banner, so the banner just stays visible above the open menu (no jump, no band). When scrolled on docs the banner has already collapsed off-screen via --promo-cur, so the drawer reaches top:0 with nothing over it. The thingsboard#449 "covers the close button" concern is obsolete: the drawer and its X now sit below the banner, not under it.
vvlladd28
left a comment
There was a problem hiding this comment.
Review summary
Reviewed 3 changed files in fix(promo-banner): restore scroll-hide animation + keep banner visible under open menu. No issues found.
This is a clean, faithful restore. The reinstated @keyframes promo-collapse/promo-vanish + @supports (animation-timeline: scroll()) block in _starlight-overrides.scss is byte-identical to the last-good commit (58897deb4). The --promo-anim:none fallback correctly neutralizes the degenerate animation-range: 0 0px on banner-less pages, and the --promo-cur/--promo-h/--promo-anim custom-property contract is used consistently across all three files. Removing the header.header.opened-burger #promo-banner { display: none } rule leaves no dangling references — the drawer anchors at top: --promo-cur (z-index 10000) below the banner (z-index 8889), so the banner stays visible above the open menu with no overlap or empty band.
This review was auto-generated. Findings may contain errors — please verify before applying changes.
Two banner fixes on docs/marketing pages.
1. Restore docs scroll-hide animation lost in a merge
The docs promo banner stopped hiding on scroll. The pure-CSS scroll-driven hide —
--promo-curcollapsing via@keyframes promo-collapse/promo-vanishunder@supports (animation-timeline: scroll())— was silently dropped from_starlight-overrides.scssduring the PR #465 merge (7e75f818e). Both parents of that merge contained the block; the conflict resolution deleted it and even added a comment claiming "the animation lives in PromoBanner.astro" to rationalize the gap (it doesn't).The same merge also trimmed the
--promo-anim:nonebanner-less-page fallback fromPromoBanner.astro, leaving the degenerate0 0pxanimation-range / stale band the surrounding comment warns about.Fix — pure restore, byte-identical to the last good commit (
58897deb4); no new logic:_starlight-overrides.scss— restore thepromo-collapse/promo-vanishkeyframes +@supports (animation-timeline: scroll())block; drop the now-false comment.PromoBanner.astro— restore--promo-anim:nonein the no-banner inline-style fallback.Why this must land on develop first
mainstill has this animation (it never went through the bad merge). Because the develop↔main merge-base has the animation, merging develop → main without this fix would silently delete the working animation from main (verified viagit merge-tree: count 2 → 0, clean no-conflict merge — no warning). Landing this on develop first keeps develop and main consistent.2. Keep the banner visible under the open burger menu
On smaller screens, opening the burger menu at the top of the page hid the banner but left an empty ~40px band above the menu (and a jump).
The shared-header refactor (#465) moved
#promo-bannerinside Starlight'sheader.headerwrapper on marketing too (it used to be a sibling), so theheader.header.opened-burger #promo-banner { display: none }rule — added in #449 for the old docs-only layout — now fired on marketing as well. The banner was hidden, but the drawer stayed at its--promo-curoffset → empty band.Fix — drop the
display: nonerule. The drawer already anchors attop: --promo-cur, below the banner, so the banner stays visible above the open menu (no jump, no band). When scrolled on docs the banner has already collapsed off-screen via--promo-cur, so the drawer reachestop:0with nothing over it. The #449 "covers the close button" concern is obsolete — the drawer and its X now sit below the banner.Unsupported browsers (Firefox/Safari) gracefully keep the banner pinned, as before.