From 82f7e5659a50531ff7030e69c87fea754ce5b2f1 Mon Sep 17 00:00:00 2001 From: Padreug Date: Wed, 9 Sep 2026 13:16:53 +0200 Subject: [PATCH 1/2] feat(layout): publish the bottom nav's rendered height as --bottom-nav-height BottomNav measures itself (ResizeObserver) and writes `--bottom-nav-height` on ; index.css declares the 0px default. Any element that must sit flush above the nav pins with `bottom: var(--bottom-nav-height)` instead of re-deriving `3.5rem + env(safe-area-inset-bottom)` and drifting when the device's inset, border or font scaling differs from that guess. The restaurant item page's add-to-cart bar is migrated to it. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01ByAwHU4pRnyE58YocQvAas --- src/assets/index.css | 4 ++++ src/components/layout/BottomNav.vue | 19 +++++++++++++++++++ src/modules/restaurant/views/ItemPage.vue | 9 ++++----- 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/src/assets/index.css b/src/assets/index.css index d4da37b..990e6ee 100644 --- a/src/assets/index.css +++ b/src/assets/index.css @@ -96,6 +96,10 @@ /* Default palette: Catppuccin (Latte for light, Mocha for dark). Other palettes are scoped via :root[data-theme=""] in themes/*.css. */ :root { + /* Rendered height of the fixed BottomNav (h-14 + safe-area + border), kept + current by BottomNav.vue. Pin anything that must sit flush above the nav + with `bottom: var(--bottom-nav-height)`; 0 when no nav is mounted. */ + --bottom-nav-height: 0px; --background: oklch(0.9578 0.0058 264.5321); --foreground: oklch(0.4355 0.0430 279.3250); --card: oklch(1.0000 0 0); diff --git a/src/components/layout/BottomNav.vue b/src/components/layout/BottomNav.vue index e23fd98..465437c 100644 --- a/src/components/layout/BottomNav.vue +++ b/src/components/layout/BottomNav.vue @@ -1,6 +1,8 @@