Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

On desktop the type is sooooo tiny!


You're right: on desktop it would benefit from a narrower column width and somewhat larger text


For articles like this, that are just simple text with nothing fancier than some headers and some lists, would something simple like this be a good way to deal with this?

  body {
    font-size: calc(0.5rem + 2vw);
  }
That sets a font size that gets bigger as you make the viewport wider, so that you keep about the same number of characters per line regardless of viewport size.

I'm just a dabbler with CSS. Is there a better way to say "the font size that gives me about N characters per line of random text"?

(It's 0.5rem + 2vw instead of just some multiple of vw so that if you make the viewport narrow the font doesn't get too small. Better would be something like max(0.5rem, 2.5vw) but max() is experimental and not supported well outside of chrome. I found the calc(fixed + variable) hack on Stack Overflow).


I usually stick in some css like:

    body {
       max-width: 45em;
    }
Viewport size isn't a great clue to the ideal font size: someone can have a large monitor that they're close to, or a small one that they're father from.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: