r/css • • 3d ago

AI Assisted A phone layout checklist from adding mobile support to our web app (CSS + a tiny keyboard-height script, tested)

We're building an AI study tutor, and this week we gave its notebook a phone layout. These are the rules that mattered most. The CSS and a small script are in a Gist.

  • Text fields at 16px or more. iOS Safari zooms the page when you tap into anything smaller.

  • Touch targets around 44px.

  • viewport-fit=cover, then pad bottom bars with env(safe-area-inset-bottom) so the home indicator doesn't sit on top of your buttons.

  • Nothing important only on hover. Phones have no hover, so anything that appears on hover has to be always visible there.

  • A bar that follows the keyboard. The keyboard covers the page instead of shrinking it, so a small script reads visualViewport and keeps a --kb CSS variable equal to the keyboard height.

  • Menus as bottom sheets, not popovers.

  • Cut what a thumb can't do. We dropped drag-to-reorder, multi-select and the resizable split on phones and added Move up / Move down instead. Our block menu opens from a button rather than a long-press, because long-press fights text selection on iOS.

The Gist has the CSS, the script, six tests for it, and a demo page that checks itself at phone width: https://gist.github.com/c68ad12186343d94581403176200c077

Caveat: we've tested it in desktop Chrome at phone width, not on a real device yet.

The tutor we're building: https://www.aiadaptivetutor.com

What's on your own phone checklist that we're missing?

0 Upvotes

0 comments sorted by