badlydrawnrob / print-first-css

0 stars 0 forks source link

Typography stack for system fonts #31

Closed badlydrawnrob closed 7 months ago

badlydrawnrob commented 4 years ago

Using system-ui, --system-mono and --fallback-mono In general, these should use the defaults for each OS. The monospace font seems to have a larger x-height ... So we're using a Goldilocks hack with calc(...) for --font-family-mono.[^1]

I'm going to allow for variety of fonts depending on system-ui:

[^1]: This has some repercussions when using a child theme, as we possibly have to overwrite this hack. If the --font-family and --font-family-mono fonts share the same x-height then we can safely remove it. From (limited) tests, this does not seem to be the case with SF Pro and SF Mono

badlydrawnrob commented 7 months ago

With a default font-size, the monospace font often feels too big:

Default

--font-size-mono is a bit of an in-betweeny font size. calc( var(--font-size-m) + .1rem) seems to balance out, but it might effect the baseline grid:

1: Original --font-size:

Screenshot 2023-11-30 at 18 04 15

2: Somewhere in-between: calc( var(--font-size-m) + .1rem):

Screenshot 2023-11-30 at 18 03 31

3: Using --font-size-m:

Screenshot 2023-11-30 at 18 06 45

Option 2 gives a fractional font-size in Safari however (but with modern devices shouldn't matter — it's in .rem anyway:

Screenshot 2023-11-30 at 18 08 40
badlydrawnrob commented 7 months ago

Closing this for now ...