Edge-to-edge mobile layout with safe-area insets

The public menu (and editor) left a non-matching rectangular gap around the
iPhone notch / dynamic island. Make the glassmorphism background go edge-to-edge
while keeping interactive content clear of the unsafe regions.

- viewport-fit=cover so the layout uses the full screen incl. behind the island
- Safe-area utility classes (globals.css) built on env(safe-area-inset-*); they
  resolve to 0 on devices without insets, preserving previous spacing
- Public menu: header padding-top, sticky section tabs offset, and floating
  action buttons (Ask AI / +) respect top/bottom insets
- Editor: header padding-top and bottom tab bar respect top/bottom insets

Verified: build passes; all safe-area classes survive Tailwind purge; rendered
meta tag emits viewport-fit=cover.
This commit is contained in:
Jorem Juárez committed 2026-06-15 13:46:27 -06:00
1 parent 9fad1d43aa
commit d71ede3d00
4 files changed
+35 -5

No files matched your search

+27
View File
@@ -92,3 +92,30 @@ body {
-ms-overflow-style: none;
scrollbar-width: none;
}
/* Safe-area helpers for edge-to-edge layout (viewport-fit=cover).
The background covers behind the notch / dynamic island and gesture bar, while
interactive content is padded so it isn't covered. On devices without insets
env() resolves to 0, so spacing matches the previous values. */
@layer utilities {
/* public menu header */
.safe-pt-header {
padding-top: calc(env(safe-area-inset-top, 0px) + 1.25rem);
}
/* editor header */
.safe-pt-editor {
padding-top: calc(env(safe-area-inset-top, 0px) + 1rem);
}
/* sticky section tabs keep clear of the island when scrolled */
.safe-top-sticky {
top: calc(env(safe-area-inset-top, 0px) + 0.5rem);
}
/* public floating action buttons clear the gesture bar */
.safe-bottom-fab {
bottom: calc(env(safe-area-inset-bottom, 0px) + 1.25rem);
}
/* editor bottom tab bar clears the gesture bar */
.safe-pb-tabbar {
padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 0.5rem);
}
}
+3
View File
@@ -25,6 +25,9 @@ export const viewport: Viewport = {
initialScale: 1,
maximumScale: 1,
themeColor: '#f4f1ec',
// Use the full screen incl. the area behind the notch / dynamic island so the
// glassmorphism background goes edge-to-edge; content respects safe areas via CSS.
viewportFit: 'cover',
};
export default async function RootLayout({