Skip to content

iOS custom classes like env(safe-area-inset-bottom) only applied on first load/404 page #1695

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
AndreasDamen opened this issue Apr 30, 2025 · 0 comments

Comments

@AndreasDamen
Copy link

custom padding/height for IOS based on env(), for example: env(safe-area-inset-bottom), only applies on first load in Nextjs 15 with TailwindUI.

Tailwind.config.ts:
...snip... extend: { padding: { safe: "env(safe-area-inset-bottom)", "safe-body": "calc(4rem + env(safe-area-inset-bottom))", }, height: { "nav-safe": "calc(4rem + env(safe-area-inset-bottom))", }, ...snip...

BottomNavbar.tsx:
`
...snip...

NAV OBJECTS ...snip... `

layout.tsx:
...snip... <body className="bg-gray-100 flex flex-col min-h-screen"> {children} <BottomNavbar /> </body> ...snip...

Describe the bug
The added custom padding in Tailwind.config.ts for iOS is only applied when the app first loads, and on the default 404 page. when navigating to another page using the nav, the padding dissapreas and only reapperas if the app is reloaded. an exclusion is the standard 404 page, that always shows the padding to be correct.

To Reproduce
Steps to reproduce the behavior:

  1. Create a nextjs15 pwa withj tailwindplus.
  2. add custom env(safe-area-inset-bottom) classes to the tailwind.config.ts
  3. create a bottomnavbar that uses the classes
  4. observe the padding is not applied like expected

Expected behavior
The padding to be applied not only on page load/404 page, but also after navigating to other pages

Screenshots
If applicable, add screenshots to help explain your problem.

Opening the pwa on iOS (padding applied):
Image

opening a 404 page (padding applied):
Image

Navigating back to the existing start page (padding no longer applied):
Image

Browser/Device (if applicable)

  • OS: iOS
  • Browser Safari
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant