squirrelscan
GitHub

Mobile audit rules: viewport, tap targets and font size

Audit rules for phones: the viewport tag, pinch zoom, font size, tap targets, sideways scrolling, iOS input zoom, interstitials and the web app manifest.

Mobile rules check whether a page works on a phone: the viewport tag that decides how it is laid out, whether zoom is still available, whether text and tap targets are large enough, and whether anything overflows the screen. Most of them read static markup, so they see inline styles and not the stylesheet, and several report a count as context rather than a measurement. Treat them as a list of things to look at in a narrow browser window.

Run only these rules

squirrel audit https://example.com --rule-include mobile

Where to start

These carry the highest severity and weight in the category.

Rules

RuleWhat it flagsSeverityScope
Font size under 12px: text too small to read on a phoneBody text below about 16px is hard to read on a phone without zooming. squirrel checks inline styles for sizes under 12px.warningPer-page
Form fields under 16px: why iOS Safari zooms in when one is focusedOn an iPhone, focusing a text field under 16px zooms the page in. squirrel reads form field sizes from inline styles and style blocks and reports the small ones.warningPer-page
Horizontal scroll on mobile: the usual causesA page a phone can scroll sideways is a page that does not fit. squirrel looks for fixed widths, tables and fixed-width iframes.warningPer-page
Intrusive interstitials: popups that cover mobile contentA popup covering the content a visitor came for is a ranking problem as well as a usability one. squirrel detects popup markup and libraries.warningPer-page
Missing viewport meta tag: what it does and what to setWithout a viewport meta tag a phone renders the page at desktop width and zooms out. squirrel checks the tag and its content properties.errorPer-page
Tap target size: the 44 by 44 pixel guidelineA control smaller than a fingertip is a control people miss. squirrel counts interactive elements and flags small inline dimensions.warningPer-page
user-scalable=no: the viewport setting that blocks zoomDisabling pinch zoom stops readers who need to magnify text. squirrel checks the viewport content for user-scalable and maximum-scale.errorPer-page
Web app manifest: the file that sets the home-screen icon and nameA linked web app manifest that is missing, broken or inconsistent gives a blank home-screen icon and a generic name. squirrel checks the manifest the pages link.errorSite-wide

Key terms

  • Mobile-friendly: A page that works on a phone without zooming or sideways scrolling: viewport set, readable text, tappable controls, no input zoom.
  • Touch target size: The tappable area of a control; WCAG 2.2 sets 24 by 24 CSS pixels as the AA minimum.
  • Viewport meta tag: <meta name="viewport"> that sets the layout width to the device width; disabling zoom in it fails accessibility.

Accessibility checks touch target size and a viewport that blocks zoom from the side of a reader who needs to enlarge text.

Learn more

Disable all Mobile rules

[rules]
disable = ["mobile/*"]

Type to search…

↑↓ navigate↵ openesc close