Google Fonts
The easiest way to add fonts:Implementation
Add the Google Fonts<link> tags in the <head> of your base layout:
Using in Tailwind
Map the fonts to Tailwind font families so you can use utility classes:Popular Font Combinations
Modern & Clean
Professional
Creative
Tech/Startup
Local Fonts
For fonts not on Google Fonts:Add Font Files
Place inpublic/fonts/:
Configure
Declare the font with@font-face in your global stylesheet, pointing at the
files in public/ (served from the site root):
class="font-brand" on your headings or body text.
Font Weights
Common weight names:| Weight | Name |
|---|---|
| 100 | Thin |
| 200 | Extra Light |
| 300 | Light |
| 400 | Regular |
| 500 | Medium |
| 600 | Semi Bold |
| 700 | Bold |
| 800 | Extra Bold |
| 900 | Black |
Loading Specific Weights
Only load what you need for better performance. Request just those weights in your Google Fonts<link> URL:
Font Performance
Optimization Tips
- Load only needed weights - Don’t load all weights
- Limit font families - 2-3 max
- Use font-display: swap - Shows fallback while loading
- Subset fonts - Only latin if that’s all you need
Reduce Layout Shift
To keep fonts fast and avoid layout shift:- Self-host the
.woff2files inpublic/fonts/(no external request) when you want zero third-party calls - Preconnect / preload the font in your base layout’s
<head> - Use
font-display: swapso text shows in a fallback while the font loads - Set a matching fallback font family so the swap is barely noticeable
Typography Scale
Consistent Sizing
Use Tailwind’s typography scale:| Class | Size |
|---|---|
text-xs | 12px |
text-sm | 14px |
text-base | 16px |
text-lg | 18px |
text-xl | 20px |
text-2xl | 24px |
text-3xl | 30px |
text-4xl | 36px |
text-5xl | 48px |
Custom Scale
Line Height & Spacing
Line Height
Letter Spacing
Common Font Tasks
Change All Fonts
Consistent Typography
Brand Font
Font Fallbacks
Always specify fallbacks in your Tailwind theme:Variable Fonts
Modern fonts with adjustable properties. Load the single variable.woff2 and
declare a weight range with @font-face:
- Smaller file size
- All weights in one file
- Smooth weight transitions
Troubleshooting
Font not loading
Font not loading
- Check font name spelling (must match the
@font-face/<link>exactly) - Verify the weight exists for that font
- Check the browser console for errors
- Ensure the
<link>is in the base layout<head>, or the font file exists inpublic/fonts/
Flash of unstyled text
Flash of unstyled text
- Make sure
font-display: swapis set (in the Google Fonts URL or your@font-face) - Preconnect/preload the font in the base layout
<head> - Set a matching fallback font family so the swap is barely noticeable
Font looks different than expected
Font looks different than expected
- Verify you loaded the correct weight
- Check CSS isn’t overriding font settings
- Ensure the Tailwind font family (e.g.
font-heading) is applied to your element
Styling Best Practices
More design tips

