Fix safe area insets for iPhone using CSS custom properties
This commit is contained in:
1 parent
61ecd7679a
commit
d6f4576105
3 files changed
+3
-2
No files matched your search
@@ -3,6 +3,7 @@
|
||||
:root {
|
||||
--background: #ffffff;
|
||||
--foreground: #171717;
|
||||
--safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);
|
||||
}
|
||||
|
||||
@theme inline {
|
||||
|
||||
+1
-1
@@ -219,7 +219,7 @@ export default function Home() {
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="min-h-screen bg-gradient-to-b from-slate-50 to-slate-100 dark:from-slate-900 dark:to-slate-800 pb-24 md:pb-0" style={{ paddingBottom: 'calc(6rem + env(safe-area-inset-bottom))' }}>
|
||||
<div className="min-h-screen bg-gradient-to-b from-slate-50 to-slate-100 dark:from-slate-900 dark:to-slate-800 md:pb-0" style={{ paddingBottom: 'calc(6rem + var(--safe-area-inset-bottom))' }}>
|
||||
<ReminderBanner userEmail={user.email || undefined} />
|
||||
<BottomNav activeTab={activeTab} onTabChange={setActiveTab} />
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ export default function BottomNav({ activeTab, onTabChange }: BottomNavProps) {
|
||||
return (
|
||||
<>
|
||||
{/* Mobile Bottom Navigation */}
|
||||
<nav className="fixed bottom-0 left-0 right-0 bg-white dark:bg-slate-800 border-t border-slate-200 dark:border-slate-700 md:hidden z-50" style={{ paddingBottom: 'env(safe-area-inset-bottom)' }}>
|
||||
<nav className="fixed bottom-0 left-0 right-0 bg-white dark:bg-slate-800 border-t border-slate-200 dark:border-slate-700 md:hidden z-50" style={{ paddingBottom: 'var(--safe-area-inset-bottom)' }}>
|
||||
<div className="flex justify-around">
|
||||
{navItems.map(item => (
|
||||
<button
|
||||
|
||||
Reference in new issue
Block a user