Reminder that `system-ui` is well supported, when you use it on macOS you get San Francisco which is a variable font, which is fun, and the fallbacks are pretty good.

Chris Coyier Chris Coyier on

You can use the value system-ui in your font-family in CSS, you get a font that represents the default user interface font. Meaning you get something kinda Windowsy on Windows, Linuxy on Linux, and Macsy on macOS, etc. It’s well supported across browsers and platforms. I think it’s a good choice for many situations.

html {
  font-family: 100%/1.4 system-ui, sans-serif;
}Code language: CSS (css)

I’ve only got a Mac, so what I see when using it is San Francisco. It’s a pretty fancy font, and with zero download cost, I think that’s great.

It also happens to be a variable font, meaning we can change certain aspects of the font programmatically. In the case of San Francisco, we’ve got a weight ("wght") and width ("wdth") axis that can pretty dramatically change the look of it.

h1 {
  font-variation-settings: 
    "wght" 900,
    "wdth" 700;
}Code language: CSS (css)
Same font, with changed variable font settings

Here’s a basic demo:

That gives us this expanded <h1>, narrowed and thin <h2>, and slightly thinned out <p>. On my Mac:

And some fallbacks:

Chrome on Windows
Firefox on Android (sorry for low quality, that’s just what it looked like in BrowserStack, which rendered on a “real device”)

Not bad, if you ask me (websites don’t need to look the same in all browsers), and actually, it might look extra good to long-time users of those browsers/platforms, as it looks like what the UI looks like, at least somewhat. That’s kind of the point.

Here’s a spectrum of weights and widths:

Here’s some more usage examples:

Wanna be a better web typographer?

Leave a Reply

Your email address will not be published. Required fields are marked *

$966,000

Master.dev donates to open source projects through thanks.dev and Open Collective, as well as donates to non-profits like The Last Mile, Annie Canons, and Vets Who Code.