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:
1 parent
9fad1d43aa
commit
d71ede3d00
4 files changed
+35
-5
No files matched your search
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user