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 { :root {
--background: #ffffff; --background: #ffffff;
--foreground: #171717; --foreground: #171717;
--safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);
} }
@theme inline { @theme inline {
+1 -1
View File
@@ -219,7 +219,7 @@ export default function Home() {
} }
return ( 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} /> <ReminderBanner userEmail={user.email || undefined} />
<BottomNav activeTab={activeTab} onTabChange={setActiveTab} /> <BottomNav activeTab={activeTab} onTabChange={setActiveTab} />
+1 -1
View File
@@ -24,7 +24,7 @@ export default function BottomNav({ activeTab, onTabChange }: BottomNavProps) {
return ( return (
<> <>
{/* Mobile Bottom Navigation */} {/* 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"> <div className="flex justify-around">
{navItems.map(item => ( {navItems.map(item => (
<button <button