Stop Guessing Font Sizes: Why I Switched to rem
and Never Looked Back
I used to think font sizing was a matter of taste. 14px felt right here, 18px looked clean there, 22px made a headline pop. But then I tried to scale it all responsively. Suddenly, my “perfect” sizes were breaking layouts, defying media queries, and failing accessibility checks.
That’s when I realized: pixel-based thinking locks you in. rem
-based thinking sets you free.
What rem
Actually Means
rem
stands for “root em”, which means it’s relative to the font size set on the root <html>
element. Most browsers default to 16px
, so:
1rem
= 16px1.5rem
= 24px0.875rem
= 14px
Once you switch to rems, you stop thinking in absolute sizes and start building a type system that flexes with context.
:root {
font-size: 100%; /* 16px base */
--font-body: 1rem;
--font-sm: 0.875rem;
--font-lg: 1.5rem;
--font-xl: 2rem;
}
This lets you scale type across viewports, themes, or accessibility needs without redefining every class or media query.
Why I Abandoned Pixel Font Sizes for Good
Here’s what convinced me:
- 1. Accessibility improves instantly.
Users who zoom in or use OS-level text scaling get a consistent experience — without layout breaks. - 2. Design tokens start to make sense.
Spacing and typography scales can match. No more disjointedpadding: 12px
next tofont-size: 1.25rem
. - 3. You can theme your entire site by adjusting
:root
.
Changefont-size
globally, and every rem-based component updates automatically.
Before rems, I was hardcoding values and chasing inconsistencies. After rems, I built sites that felt coherent across devices and easier to maintain long-term.
Common Objections (And Why They Miss the Point)
“But I know exactly how many pixels I want.”
You still can — rem
doesn’t remove precision. It just lets you define it once and reuse it cleanly.
“I don’t want to do the math.”
You only do it once. After that, 1rem
= 16px becomes second nature — and you’ll love how readable your CSS becomes.
“It won’t look the same on all browsers.”
Unless the user has changed their base size (which they’re allowed to for accessibility reasons), it will. That’s the point — rem adapts when the user needs it most.
Pro Tips for Adopting rem
Smoothly
- Define your font sizes, spacing, and layout tokens in
:root
- Use rems for anything that should scale with type — text, padding, margins, borders
- Use px for things that shouldn’t scale — like images, 1px lines, and breakpoint values
- Test your site at 120% and 150% zoom to catch any edge cases
You’ll be shocked how much better your UI behaves when you stop relying on absolute pixel measurements for text and layout.
Final Thought
Switching to rem
was one of the quietest upgrades I ever made — and one of the most impactful. My designs became more consistent. My code got cleaner. And the people using my sites? They noticed fewer problems, even if they couldn’t name why.
rem
isn’t about being trendy. It’s about being adaptable. And that’s how you future-proof your front end.
Curious how this could work for your site or style system? Contact me here and I’ll help you shift to a rem-first approach — without losing your design intent.