Created
June 2, 2017 09:56
-
-
Save rodneyrehm/bc8b86db137085c9ccb8b5b64cf50a50 to your computer and use it in GitHub Desktop.
Using system fonts on the web
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
html { | |
// 12px base unit (others usually make this 10px to simplify their calculations) | |
font-size: 75%; | |
} | |
body { | |
// will be 16px default font-size | |
font-size: 1.33rem; | |
line-height: 1.2; | |
// See: https://www.smashingmagazine.com/2015/11/using-system-ui-fonts-practical-guide/ | |
font-family: | |
// macOS system font (San Francisco since macOS 10.9) | |
BlinkMacSystemFont, | |
-apple-system, | |
// Android since 4.3 | |
'Roboto', | |
// Linux KDE | |
'Oxygen', | |
// Linux Ubuntu | |
'Ubuntu', | |
// Linux GNOME | |
'Cantarell', | |
// Firefox OS | |
'Fira Sans', | |
// Android before 4.3 | |
'Droid Sans', | |
// Windows Phone | |
'Segoe UI', | |
// macOS before 10.11 | |
'Helvetica Neue', | |
// fallback on systems who do not provide any of the above fonts | |
'Tahoma', | |
// last resort | |
sans-serif; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment