Input font size
iOS Safari zooms the whole page in when a text field under 16px gets focus, and doesn't zoom back out. Keep fields at 16px on phones.
12345{ "rules": { "systomic/input-font-size": "warn" }}See the difference
className="text-sm"className="text-base md:text-sm"What doesn't work
Oxlint
2 findings12345678export function Search() { return ( <> <input type="search" className="w-full text-sm" /> <textarea style={{ fontSize: 14 }} /> </> );}systomic/input-font-size text-sm makes this input 14px on phones. iOS Safari zooms in below 16px on focus; use 16px on phones (text-base md:text-sm).
systomic/input-font-size fontSize: 14 makes this textarea 14px on phones. iOS Safari zooms in below 16px on focus; use 16px on phones.
Stylelint
1 finding123.search input { font-size: 14px;}systomic/input-font-size font-size: 14px makes text fields 14px on phones. iOS Safari zooms in below 16px on focus; use 16px on phones.
What works
No findingsOxlint
123456789export function Search() { return ( <> <input type="search" className="w-full text-base md:text-sm" /> <textarea style={{ fontSize: 16 }} /> <input type="checkbox" className="text-xs" /> </> );}Stylelint
12345678.search input { font-size: 16px;}@media (min-width: 768px) { .search input { font-size: 14px; }}Details
iOS Safari zooms into a text field whose text is smaller than 16px when it gets focus. The rule reports input (text types), textarea, select, contentEditable elements and field components (componentPattern: Input, Textarea, TextField, …Input) whose text is below 16px on phones.
12<input className="w-full text-sm" />// ^^^^^^^ quick-fix: text-base md:text-smWhat size applies on phones:
- Tailwind: unprefixed and
max-*:classes;max-*:wins. Min-width breakpoints (md:,min-[…]:,@md:) and pseudo-elements (placeholder:) don’t count. States (focus:text-sm) do, since they zoom while they apply. Theme sizes viafontSizes({ "body": 16 }). - Inline styles / StyleX:
fontSizeor thefontshorthand; for StyleX,defaultand@media (max-width …)values. Styles win over classes. - Stylesheets: base declarations of CSS-module / imported classes and
@apply. - Inherited: Tailwind’s preflight sets
font: inheriton fields, so a host field without its own size takes the nearest parent’s size in the same JSX tree (<form className="text-sm">).
Unknown sizes (em, %, var(), clamp()) and fields without any size aren’t reported. Field components without overrides are left to the component.
| Option | Default |
|---|---|
componentPattern |
(^|[a-z])(Input|Textarea|TextArea|TextField)$ |
fontSizes |
{} |
breakpoints |
["sm", "md", "lg", "xl", "2xl"] |
desktopBreakpoint |
"md" (for the quick-fix) |
Stylelint
For .css / .scss files (see Stylelint): font-size, font or @apply text-* below 16px on input, textarea, select or [contenteditable] selectors, outside @media (min-width) / @container. Non-text inputs ([type=checkbox] …) are skipped. Severity warning.
See Styling for how classes, inline styles, StyleX and stylesheets are read.