{"data":{"slug":"github-thedaviddias-front-end-checklist-skills-font-size-b6da721dcad2","title":"Ensure Readable Font Sizes on Mobile","summary":"Audit and fix font-size declarations in CSS to ensure readability on mobile devices, compliance with accessibility standards, and proper scaling with user preferences. Deliverable includes a report of flagged issues and suggested fixes.","url":"https:\/\/skillshunter.net\/skills\/github-thedaviddias-front-end-checklist-skills-font-size-b6da721dcad2","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/github-thedaviddias-front-end-checklist-skills-font-size-b6da721dcad2","markdown_url":"https:\/\/skillshunter.net\/skills\/github-thedaviddias-front-end-checklist-skills-font-size-b6da721dcad2.md","download_url":"https:\/\/skillshunter.net\/skills\/github-thedaviddias-front-end-checklist-skills-font-size-b6da721dcad2\/download","category":{"slug":"software-development","name":"Software & Development"},"editor_note":"Before running the audit, ensure that the CSS files are accessible and that the project is set up to support responsive design. If using `px` units for font sizes, convert them to `rem` or `em` for better scalability. The first deliverable is a list of flagged font-size declarations that violate accessibility and responsiveness guidelines.","instructions":"---\nname: font-size\ndescription: \"Use when applies to all CSS `font-size` declarations, particularly those using `px` units for body text, UI labels, and navigation. Use when auditing mobile responsiveness and accessibility compliance. Check for `font-size` in media queries targeting small screens.\"\nmetadata:\n  category: css\n  priority: medium\n  difficulty: intermediate\n  estimatedTime: \"10\"\n  source: frontendchecklist.io\n  url: https:\/\/frontendchecklist.io\/rules\/css\/font-size\n---\n\n# Use readable font sizes on mobile\n\nApproximately 1 in 3 adults over 65 increases their browser's default font size. Low-vision users who cannot use screen magnifiers rely on browser font size settings as their primary accessibility tool. If font sizes are set in `px` only, browser font size preferences are ignored entirely. Text smaller than 16px on mobile forces all users to zoom in, breaking the page layout and triggering horizontal scroll. iOS Safari's auto-inflation of sub-12px text causes unintended layout shifts.\n\n## Quick Reference\n\n- Body text should be at least 16px (1rem) on mobile \u2014 smaller sizes force users to zoom\n- Avoid `font-size` values below 12px; iOS Safari ignores values below 12px and auto-inflates them\n- Use `rem` or `em` units instead of `px` so text scales with the user's browser font size preference\n- Never set `font-size: 100%` on `<html>` using an override that blocks user scaling \u2014 respect the browser default (16px)\n- WCAG 2.1 SC 1.4.4 (Resize Text, Level AA): text must be resizable up to 200% without loss of content or functionality\n\n## Check\n\nFind all CSS `font-size` declarations. Flag: (1) body text or paragraph text set below 16px (or 1rem); (2) any font-size below 12px; (3) font-sizes set in `px` on `<html>` or `<body>` that override the browser default; (4) font-sizes that do not scale proportionally when the browser zoom is set to 200% (test in Chrome DevTools by setting font-size in browser settings or using zoom). Check that text remains readable and layout does not break at 200% zoom.\n\n## Fix\n\n(1) Convert pixel font sizes to `rem` units: divide the pixel value by 16 (the browser default) \u2014 e.g., `14px` becomes `0.875rem`. (2) Set body text to at least `1rem` (16px equivalent) on mobile. (3) Replace `html { font-size: 10px }` (a common reset trick) with `html { font-size: 62.5% }` or avoid font-size resets entirely \u2014 instead use `rem` values calculated from the actual 16px base. (4) If small text is intentional (captions, footnotes), ensure it is at least `0.75rem` (12px) and use `font-size: 0.75rem` so it scales with user preferences.\n\n## Explain\n\nWCAG 2.1 SC 1.4.4 (Resize Text) requires that text can be resized up to 200% without loss of content or functionality, except for captions and images of text. Using `px` units for font sizes makes text immune to browser font size settings (though not to browser zoom). Using `rem` or `em` units allows text to scale with the root font size, which the user can adjust in browser settings \u2014 this is the preferred approach. iOS Safari also has a built-in heuristic that inflates text smaller than 12px when the page is displayed in mobile view, which can cause layout inconsistencies.\n\n## Code Review\n\nReview stylesheets, component styles, and responsive states related to Use readable font sizes on mobile. Flag exact selectors, declarations, or breakpoints that violate the rule in the rendered UI.\n\n---\n\nFor full implementation details, code examples, and framework-specific guidance,\nsee `references\/rule.md`.\n\nRule page: https:\/\/frontendchecklist.io\/rules\/css\/font-size\n","use_cases":["Auditing mobile responsiveness and accessibility compliance","Fixing font-size declarations in CSS for body text, UI labels, and navigation","Ensuring text scales with user preferences and browser zoom settings"],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/thedaviddias\/Front-End-Checklist\/blob\/e8d14d049010e2ce25afcd5e8609dfcbbe63e47e\/skills\/font-size\/SKILL.md","source_commit":"e8d14d049010e2ce25afcd5e8609dfcbbe63e47e","license":null,"version":null,"listing_approved_at":"2026-11-23","created_at":"2026-11-22T16:14:29.000000Z","updated_at":"2026-11-23T04:55:09.000000Z","seo_title":"Ensure Readable Font Sizes on Mobile","seo_description":"Audit and fix font-size declarations in CSS for mobile responsiveness and accessibility compliance. Check for font-size in media queries targeting small screens.","seo_keywords":["mobile font size accessibility","css font size audit","responsive font size check","accessibility font size rules","mobile text scaling"]}}