Hacker News new | ask | show | jobs
by elxr 21 hours ago
Yup, using rem for as many things as possible has always been good to me.
1 comments

This is bad advice. You should only use rem for text, e.g. font sizes and paragraph margins.

If the user is on a phone and has a larger default font size due to vision difficulties, making padding scale with the font size takes screen real estate away from the larger text the user needs.

Thanks for the tip. That does make sense, although I do think having your default CSS-defined font sizes (across your whole app, not just the main content) be a reasonable size should be the first priority.

Also, not having ridiculously oversized margins, like so many 2019-2022 websites trying to look "modern" used to use.

old.reddit.com is one example where the paddings still look good when magnification is set to 150-170% (which I have to do because of the tiny default font size). I think doing it that way but with better readability at 100% zoom, would be a decent solution.

This is true. I use increased font size on my phone, and so many websites are borderline unusable because of massive unnecessary padding. But I am also a culprit of using rem for everything. What is the alternative? Pixels?
Thanks for helping me realize my accidental anti-pattern. Can you link some of the sites that do that the worst.

I want to use those as references to fix my UI (on increased font-sizes on small screens) before releasing an app I've spent 4+ months on.