Post

daniel petho
daniel petho@nonzeroexitcode·
a well-known iOS Safari quirk is that inputs with a font-size <16px trigger an auto-zoom on focus using 16px is probably the best solution, but it can feel a bit heavy in tight UIs a clever workaround is to keep the font-size at 16px and scale the input down with CSS!
English
28
60
1.6K
148.6K
kieranstartup
kieranstartup@kieranstartup·
@nonzeroexitcode I was working on this last night and discovered you can set the input and placeholder to eg 14px, then add a focus to trigger the scale up to 16px when the user taps on the input. Here's the tailwind class I'm using: text-sm placeholder:text-sm focus:text-base
English
4
1
39
2.9K
kieranstartup
kieranstartup@kieranstartup·
I'm not sure if there's a reason why you shouldn't do this, but it's working pretty well. Maybe something a11y related but I haven't got round to testing that yet.
English
0
0
0
26
Paylaş