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

No, I am proposing you write

line-height: calc(2.5ex + 0.5rem);

instead. The effect is the same, but based on the x-height of the font used, which can be beneficial for the reasons outlined. Adjust the ex to taste, between 2 and 2.5 or so.



Ah, sorry, I missed that.

Hmm, dunno. Interesting idea, but I suspect the uncertainty of actual value might cause me very mild difficulties occasionally. I’d want to play around with it in various fonts. Its failure mode is probably worse than using em, seen in a font with particularly tall ascenders or descenders. But then again, I have a vague feeling such fonts might commonly just extend beyond their box, in which case it’s not actually any worse.

In other news, I really want wide browser support for the lh unit.




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

Search: