fix(mobile): suppress iOS Safari auto-zoom on every input + contenteditable
iOS Safari auto-zooms (and shifts the viewport right) on focus when the computed font-size is <16px. Single @media (max-width: 767px) block in globals.css covers all four input tiers, every relevant bare <input> type, <textarea>, <select>, and contenteditable surfaces. `!important` is required because Tailwind utilities (text-[15px] on the chat composer, text-sm on form fields) emit after @layer components and would otherwise override the input-tier rules. Replaces ad-hoc per-input `text-base md:text-sm` overrides with a single global truth. New inputs/contenteditables get the fix for free. Spec: docs/systems/design-system.md gains an "iOS Auto-Zoom Suppression" section under Input Tiers.
This commit is contained in:
@@ -96,6 +96,14 @@ All defined in `globals.css`. No resting border — sunken `surface-input` backg
|
||||
|
||||
Override padding/size with utilities: `input-standard w-full py-2.5`
|
||||
|
||||
### iOS Auto-Zoom Suppression
|
||||
|
||||
iOS Safari auto-zooms (and shifts the viewport right) on input focus when the computed `font-size` is below 16px. The `@media (max-width: 767px)` block in `globals.css` bumps every input tier — and bare `<input>`/`<textarea>`/`<select>` plus `[contenteditable]` — to `font-size: 16px !important`.
|
||||
|
||||
`!important` is required because Tailwind utilities like `text-[15px]` (used on the chat composer textarea) and `text-sm` (used on form fields) are emitted in the `@layer utilities` block, which comes after `@layer components` in the cascade and would otherwise override the input-tier rules. There is no legitimate reason to use a `<16px` font-size on a mobile input, so the override is universally correct.
|
||||
|
||||
When introducing a new input or contenteditable surface, no extra work is needed — the global rule covers it.
|
||||
|
||||
---
|
||||
|
||||
## Layout
|
||||
|
||||
Reference in New Issue
Block a user