Re:PX or REM in CSS? Just Use REM
by stevebmark on Saturday December 03, 2022 @05:47PM
(#33848284)
I don’t get it. I am semi visually impaired and often use command +/- to increase the font size, and on iPhone, use the reader viewer view for websites. Rems are terrible to use in CSS because they stack relative to their parent, making components non-portable and required hacks to undo parent sizing. Is default font size that prevalent that it’s worth the crappy units?
[ Parent
| on HN ]
You're thinking of ems, not rems.
ems have their uses, too! Especially for secondary/tertiary text where you might want it to always be 0.8 em of the parent but not want to write a whole separate set of media queries for it.
If you’re talking about the zoom controls in Safari (and any other modern browser), units are completely irrelevant. For the last 15 years, browsers have been changing the size of 1px rather than changing the root font-size. The whole viewport becomes “smaller” so it appears zoomed in.