Font choices affect perceived quality, loading performance, and reading comfort.
Font stack strategy
Always include fallbacks. Example: custom font first, then system-ui and generic family.
font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
Production checklist
- Use
font-display: swapfor web fonts. - Limit loaded weights/styles to what UI actually uses.
- Verify fallback metrics do not cause major layout shift.
Important interview questions and answers
- Q: Why can web fonts hurt performance?
A: Extra requests and render delays if loading strategy is poor. - Q: Why include fallback fonts?
A: Ensures stable rendering if custom font fails or loads slowly. - Q: What is FOIT/FOUT?
A: Invisible text vs unstyled text during font load transitions.
Pitfall: Check cascade order—author stylesheet loses to inline styles and !important surprises.