Fix safe area insets for iPhone using CSS custom properties

This commit is contained in:
nmemmert committed 2026-01-16 11:14:29 -05:00
1 parent 61ecd7679a
commit d6f4576105
3 files changed
+3 -2

No files matched your search

+1
View File
@@ -3,6 +3,7 @@
:root {
--background: #ffffff;
--foreground: #171717;
--safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);
}
@theme inline {
+1 -1
View File
@@ -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} />
+1 -1
View File
@@ -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