mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-06-21 22:31:46 +00:00
fix: offline banner no longer covers the top of the app (#813)
OfflineBanner was fixed at top:0 but the rest of the page had no idea it was visible, so on mobile (and the desktop nav on wider screens) the banner sat on top of the header content. When the banner is visible it now sets --offline-banner-h on <html>; body reserves that space via padding-top, and the desktop fixed Navbar shifts its top by the same amount. When back online the var is removed and everything snaps back.
This commit is contained in:
@@ -431,6 +431,8 @@ input[type="number"], input[type="time"], input[type="date"], input[type="dateti
|
||||
--safe-top: env(safe-area-inset-top, 0px);
|
||||
--nav-h: 0px;
|
||||
--bottom-nav-h: 0px;
|
||||
/* Set by OfflineBanner when it's visible so body can reserve space. */
|
||||
--offline-banner-h: 0px;
|
||||
--font-system: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', system-ui, sans-serif;
|
||||
--sp-1: 4px;
|
||||
--sp-2: 8px;
|
||||
@@ -536,7 +538,9 @@ body {
|
||||
font-family: var(--font-system);
|
||||
background-color: var(--bg-primary);
|
||||
color: var(--text-primary);
|
||||
transition: background-color 0.2s, color 0.2s;
|
||||
transition: background-color 0.2s, color 0.2s, padding-top 0.15s ease;
|
||||
/* Reserve space when OfflineBanner is visible; 0 when online. */
|
||||
padding-top: var(--offline-banner-h, 0px);
|
||||
}
|
||||
|
||||
/* ── Marker cluster custom styling ────────────── */
|
||||
|
||||
Reference in New Issue
Block a user