systomic

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.

  • RuleIn recommended.json: breaking it breaks the design-system contract.
  • WarningShows in the editor and in CI output, but doesn't fail the run (unless you pass --deny-warnings).
  • StylelintThe same check runs on .css and .scss files through the Stylelint plugin.
  • Quick-fixYour editor offers a one-click fix. oxlint --fix leaves it to you.

See the difference

Before
Sign inEmailPasswordContinue
className="text-sm"
After
Sign inEmailPasswordContinue
className="text-base md:text-sm"

What doesn't work

Oxlint

2 findings

Stylelint

1 finding

What works

No findings

Oxlint

Stylelint

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.

What 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 via fontSizes ({ "body": 16 }).
  • Inline styles / StyleX: fontSize or the font shorthand; for StyleX, default and @media (max-width …) values. Styles win over classes.
  • Stylesheets: base declarations of CSS-module / imported classes and @apply.
  • Inherited: Tailwind’s preflight sets font: inherit on 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.

Esc