3 ms·
rem for the stuff you want to scale by base font size. px for everything else. > use ch for setting text paragraph widths I don’t know how much utility there
by lelandfe 4y ago
rem for the stuff you want to scale by base font size. px for everything else.
> use ch for setting text paragraph widths
I don’t know how much utility there is in estimating width with the size of the 0 character, unless you’re using a monospaced font.
- alwillis 4y agoYou usually want a line of text to have 60-80 characters. Given the fact some characters are thinner and some are wider than the ‘0’ character in a proportional font, making a paragraph 70ch wide gets you in the proper range.
- lelandfe 4y ago> making a paragraph 70ch wide gets you in the proper range It really does not. At 16px font size, Merriweather at 70ch renders >100 characters per line. Open Sans renders 88. Other fonts have even greater ranges. Using ch values is worse than using absolute pixel values because it gives a false sense of correlation.
- eurasiantiger 4y agoUser experience regarding content is more important than a pixel-perfect layout, which is a pipe dream anyway nowadays.
- lelandfe 4y agoSure, I understand the desire behind it. In practice, using a "ch" value for width is identical in behavior to just measuring out your intended width with absolute pixel values. Which is to say, neither of them accomplish the goal.
- eurasiantiger 4y agoAnd what would accomplish the goal?
- lelandfe 4y agoCSS doesn't have a unit that does, frankly... Content-oriented things are slowly coming, though. You can see that in properties like `line-clamp`. (I suspect that a unit that actually expresses characters-per-line is difficult at a performance level)