Skip to content
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

Fix/100vh #134

Merged
merged 14 commits into from
May 29, 2024
Merged

Fix/100vh #134

merged 14 commits into from
May 29, 2024

Conversation

nickvisut
Copy link
Collaborator

@nickvisut nickvisut commented May 28, 2024

Fixes the issue with the bottom of the page being covered by browser UI in eg mobile Safari.

The bug is that 100vh doesn't play well with dynamic browser UI popping. This is especially apparent on mobile Safari, when the controls appear at the bottom and obscure parts of the page.

The fix is to use 100dvh instead and fall back to 100vh*, which can be seen in the array value of each custom class named [min]-h-*svh. These ustom classes are introduced via plugin() in the Tailwind config (instead of directly in the theme.extend, which throws build-time errors when we attempt to use an array of values).

This PR also:

  • uses a third party lib to print out LAN URL on npm run dev in development mode (for easier debugging on actual devices if on same network)
  • adds RootLayout.tsx folder to tailwind config for proper processing (and fixes minor issue with text not appearing for desktop breakpoint)
  • loads .css files as Tailwind CSS in VSCode for this project for proper language support

Before:

After:

(see Preview for live version, linked below as "Visit Preview", to check for fixes/regressions)

Closes #128


*after discussing w/@francisli, it sounds like svh was broken in mobile Safari up until the iOS 17.4 release on March 7, 2024; this means that this fix will reach most users, but we should be aware of whom it won't reach:

  1. those who have not opted in to upgrade to 17.4+
  2. iOS devices that are stuck on older versions (eg iOS 15), such as iPhone 8, iPhone 8 Plus, and iPhone X and older.

If we need to also support older the users above, we can refer to the JS library mentioned in #128; its usage is demonstrated in another SF Civic Tech project here: sfbrigade/bats-server@2983c10 (we can investigate how to use it as a JS polyfill)

Copy link

vercel bot commented May 28, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
support-sfusd ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 28, 2024 10:48pm

@nickvisut
Copy link
Collaborator Author

cc @trushmi @Gome510 @truham @mvyenielo in case you are actively reviewing FE nowadays

Copy link
Collaborator

@BeeSeeWhy BeeSeeWhy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

@BeeSeeWhy BeeSeeWhy merged commit 16f756b into main May 29, 2024
2 checks passed
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

Successfully merging this pull request may close these issues.

Mobile cut off on map page
2 participants