Hacker News new | ask | show | jobs
by piskerpan 1319 days ago
It's not quite the same. Firefox can change the default font size and Safari can set the minimum font size. If the rest of your layout has sizes set in pixels, then you will have 6 words in that "400px-wide container", whereas a "30em-wide container" would have fit that better.

In reality however no one cares about this anymore, at least since browsers have implemented full-page zoom and especially since responsive design became a thing, meaning that one should be able to zoom into a whole page and have it fit properly anyway.

So for me this is outdated information useful to about 3 users per website. Long gone are the days of 62.5% font size trick.

2 comments

> Long gone are the days of 62.5% font size trick.

Isn't the 62.5% trick about making the code easier to write/understand/maintain? Or are you advocating for not using relative units at all? That might work for some use cases however it breaks if you need any kind of scaling feature within the site/app.

62.5% was specifically to bring the default 16px to 10px, which meant now 1em = 10px, at least at the root. With that, you could easily size your entire layout in EMs and, yes, keep it readable:

    .main {
        width: 80em
    }
    .sidebar {
        width: 20em;
    }
    .content {
        width: 60em;
    }
There's no point in bringing the font down to 10px if you're not going to use EMs
As far as i understand it's about `rem`, not `em` (which is relative to it's parent not the 62.5-normalized root element). And as long as you don't go all-in with absolute units (and loose all control over custom scaling on your site/app), you still need `rem`.
The 62.5 hack has been around for a decade before rem was even thought of. The fact that rem would be a better fit for it is irrelevant to the conversation.

I'm just saying that using em and rem for sizing isn't as useful as it once was.

My rule of thumb is to only use them for things directly related to text, like inline icons, text spacing and whatnot.

Users can still have their own style sheets, including fonts scaling.
Yes, that's 1 of the 3 users I mentioned.

How many people do that in practice? Just a tiny subset of CSS enthusiasts.