mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-18 08:02:12 +00:00
Keep the phone shell on a phone held sideways
A phone in landscape is 844 to 932 px wide, past md, so it got the desktop rail and top bar: a sliver of content and no thumb-reachable navigation. Two variants now decide the shell: shell-desktop from md up except on a touch screen at most 520 px tall, shell-mobile otherwise. The sidebar, top bar, bottom nav, the main column's bottom clearance, the Coach button, the selection bar and the two full-height Coach pages all key on them instead of a bare md.
This commit is contained in:
1 parent
a0c5ab6591
commit
b53782810f
10 files changed
+42
-13
No files matched your search
@@ -331,7 +331,7 @@ export default function CoachConversationsPage() {
|
||||
// ~50px on notched devices; restored to match exactly. v1.42 — the
|
||||
// shell now takes that inset above the top bar at every width, so
|
||||
// the desktop height subtracts it too, and `/coach/plans` matches.
|
||||
className="bg-background -mx-4 -mt-6 -mb-20 flex h-[calc(100dvh-8rem-env(safe-area-inset-top,0px)-env(safe-area-inset-bottom,0px))] min-h-[32rem] flex-col overflow-hidden md:-mx-6 md:h-[calc(100dvh-4rem-env(safe-area-inset-top,0px))]"
|
||||
className="bg-background shell-desktop:h-[calc(100dvh-4rem-env(safe-area-inset-top,0px))] -mx-4 -mt-6 -mb-20 flex h-[calc(100dvh-8rem-env(safe-area-inset-top,0px)-env(safe-area-inset-bottom,0px))] min-h-[32rem] flex-col overflow-hidden md:-mx-6"
|
||||
>
|
||||
<CoachConversationsBody readOnly={!coach.available} />
|
||||
</div>
|
||||
|
||||
@@ -296,7 +296,7 @@ export default function CoachPlansPage() {
|
||||
// mobile-only BottomNav band). The status-bar inset of an installed
|
||||
// app comes off as well, at every width: the shell takes it above
|
||||
// the top bar (`shell-safe-area`).
|
||||
className="bg-background -mx-4 -mt-6 -mb-20 flex h-[calc(100dvh-8rem-env(safe-area-inset-top,0px)-env(safe-area-inset-bottom,0px))] min-h-[32rem] flex-col overflow-hidden md:-mx-6 md:h-[calc(100dvh-4rem-env(safe-area-inset-top,0px))]"
|
||||
className="bg-background shell-desktop:h-[calc(100dvh-4rem-env(safe-area-inset-top,0px))] -mx-4 -mt-6 -mb-20 flex h-[calc(100dvh-8rem-env(safe-area-inset-top,0px)-env(safe-area-inset-bottom,0px))] min-h-[32rem] flex-col overflow-hidden md:-mx-6"
|
||||
>
|
||||
<CoachPlansBody readOnly={!coach.available} />
|
||||
</div>
|
||||
|
||||
@@ -58,6 +58,30 @@
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* `shell-desktop:` / `shell-mobile:` — which app shell the viewport gets.
|
||||
* The desktop rail (sidebar, no bottom nav) from `md` up, EXCEPT a touch
|
||||
* screen at most 520 px tall: a phone held sideways is 844–932 px wide but
|
||||
* only 390–430 px tall, and the rail plus the top bar left it a sliver of
|
||||
* content and no thumb-reachable navigation. It keeps the phone shell (top
|
||||
* bar, bottom nav, capture button) instead. Everything that switches
|
||||
* between the two shells keys on these, never on a bare `md:`, so the bars
|
||||
* cannot disagree about which shell is showing.
|
||||
*/
|
||||
@custom-variant shell-desktop {
|
||||
@media (min-width: 48rem) and (pointer: fine),
|
||||
(min-width: 48rem) and (pointer: none),
|
||||
(min-width: 48rem) and (min-height: 521px) {
|
||||
@slot;
|
||||
}
|
||||
}
|
||||
|
||||
@custom-variant shell-mobile {
|
||||
@media (max-width: 47.98rem), (pointer: coarse) and (max-height: 520px) {
|
||||
@slot;
|
||||
}
|
||||
}
|
||||
|
||||
@theme inline {
|
||||
/* Extra-small breakpoint (30rem / 480px) for the narrowest phones — the
|
||||
default scale starts at sm (640px), which leaves a gap between an iPhone SE
|
||||
|
||||
Reference in new issue
Block a user