Stop phones zooming when a field is focused
- Viewport: maximum-scale=1 and user-scalable=no (app-like, no pinch or double-tap zoom on phones). - Mobile-only rule keeps every input/textarea/select at 16px so iOS Safari's focus auto-zoom never triggers (it ignores user-scalable=no for that). Deliberately unlayered so it beats the per-component Tailwind sizes; desktop keeps the designed 12-14px fields. New zoom suite (6 checks): viewport meta, gate input, settings key input, notes textarea and every study-feed field at >= 16px on a phone, desktop sizes unchanged. Install sheet 64/64, pwa 16/16, final-ux 12/12, security 8/8, contrast 20/20.
This commit is contained in:
parent
33967f9454
commit
080306f111
3 changed files with 21 additions and 1 deletions
|
|
@ -550,6 +550,18 @@ body {
|
|||
}
|
||||
}
|
||||
|
||||
/* Mobile form fields ----------------------------------------------------- */
|
||||
/* iOS Safari zooms the whole page when a focused field's text is under 16px
|
||||
(it ignores user-scalable=no for that). Deliberately unlayered so it wins
|
||||
over the per-component Tailwind sizes, and only on phone-sized screens. */
|
||||
@media (max-width: 639px) {
|
||||
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
|
||||
textarea,
|
||||
select {
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
/* Reduced motion --------------------------------------------------------- */
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
*,
|
||||
|
|
|
|||
|
|
@ -41,7 +41,11 @@ export const metadata: Metadata = {
|
|||
export const viewport: Viewport = {
|
||||
width: "device-width",
|
||||
initialScale: 1,
|
||||
maximumScale: 5,
|
||||
// Phones: no pinch/double-tap zoom (the app-like feel). The input font-size
|
||||
// rule in globals.css is what actually stops iOS Safari's focus auto-zoom,
|
||||
// which ignores user-scalable=no.
|
||||
maximumScale: 1,
|
||||
userScalable: false,
|
||||
viewportFit: "cover",
|
||||
themeColor: [
|
||||
{ media: "(prefers-color-scheme: light)", color: "#f8fafc" },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue