Remix.run Logo
LoganDark 5 hours ago

> > Let's start with the basics: if you write`font-size: 16px`then `16px` is the size of what? Sadly, the answer is "nothing in particular" -- this is a size of a virtual box around the glyph, but the box isn't tight, and the size of the glyph varies, depending on the font. Luckily, `font-size-adjust` property can fix it, and make `font-size` consistent across fonts.

> All modern browsers default to 16px, but for accessibility and sanity reasons, we shouldn't use pixels.

That's not what that means. font-size specifies the size of the font's em box, but the correlation between the em box and the visual size of the font is not consistent across fonts. font-size-adjust can adjust how a font-face responds to the font-size so that the sizing is consistent with other fonts of that size. For example, capsize is easier to implement that way.

https://seek-oss.github.io/capsize/

(I agree that specifying font size in pixels rather than rem is bad practice.)