Skip to content

Commit 0c3da08

Browse files
abelpzcursoragent
andcommitted
fix(tc-study): use dynamic viewport height so bottom nav is visible on mobile
- Add .h-dynamic-screen and .min-h-dynamic-screen (100dvh with 100vh fallback) - Layout root uses h-dynamic-screen so app height accounts for address bar - Fixes having to scroll to see navigation bar on phone Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 057249c commit 0c3da08

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

apps/tc-study/src/components/Layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export default function Layout() {
2727
const isReadPage = location.pathname.startsWith('/read')
2828

2929
return (
30-
<div className="flex h-screen flex-col bg-gray-50 overflow-hidden">
30+
<div className="flex h-dynamic-screen flex-col bg-gray-50 overflow-hidden">
3131
{!isReadPage && (
3232
<header className="flex-shrink-0 border-b border-gray-100 bg-white/80 backdrop-blur-sm relative z-[110]">
3333
<nav className="flex items-center justify-between px-3 py-1.5">

apps/tc-study/src/index.css

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,21 @@
3939
}
4040

4141
@layer utilities {
42+
/*
43+
* Dynamic viewport height: accounts for mobile browser UI (address bar, nav bar).
44+
* 100dvh = visible viewport; avoids needing to scroll to see bottom nav on phones.
45+
* Fallback to 100vh for older browsers.
46+
*/
47+
.h-dynamic-screen {
48+
height: 100vh;
49+
height: 100dvh;
50+
}
51+
52+
.min-h-dynamic-screen {
53+
min-height: 100vh;
54+
min-height: 100dvh;
55+
}
56+
4257
/* Line clamp utilities */
4358
.line-clamp-1 {
4459
display: -webkit-box;

0 commit comments

Comments
 (0)