Comment

Comment by bufferoverflow

I'm actually dealing with the massive font differences that break the designs, and I don't know how to solve it. The designer specced the fonts that are available on different OSes. Something like font-family: X, Y, sans-serif;.

The problem is, X and Y have different line heights and different widths. And there's no CSS / media query way to detect which font is available.

So far I'm leaning towards a very ugly solution: rendering a test string into a DIV, measuring it, and then applying the correct class to the parent element.

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton