Remote Software Engineer at Stripe and cellist based out of Ontario. Previously at GitLab. Fascinated with building usable, delightful software.
April 27, 2018 | 1 minute to read
While building the Jekyll template for the latest iteration of my website (the site you’re on now), I discovered a new CSS trick:
font-family: -apple-system, system-ui, BlinkMacSystemFont,
'Segoe UI', Roboto, 'Helvetica Neue',
Ubuntu, Arial, sans-serif;
This snippet (in particular, the system-ui
part) instructs the browser to use whatever font is native to the OS. This is great, for two reasons:
If you have more than one platform available to you (for example a Windows machine, a Mac, or an Android phone), you can see this for yourself by pulling up this site on each and comparing the font styles.
Here’s what this site looks like on a Windows 10 machine (which uses the friendly Segoe UI):
On OS X, with its more serious San Franciso:
Android, and its skinny Roboto:
And Ubuntu, rendered with its quirky self-titled Ubuntu:
Some related links:
system-ui
font: GitHub and WordPress Adminsystem-ui
: https://medium.design/system-shock-6b1dc6d6596fsystem-ui
: https://css-tricks.com/snippets/css/system-font-stack/system-ui
font at Smashing Magazine: https://www.smashingmagazine.com/2015/11/using-system-ui-fonts-practical-guide/system-ui
browser support: https://caniuse.com/#search=system-uiOther posts you may enjoy:
October 14, 2024 | 3 minutes to read
May 31, 2024 | 6 minutes to read
June 26, 2023 | 14 minutes to read
January 25, 2022 | 6 minutes to read
August 26, 2021 | 2 minutes to read