Skip to content

Instantly share code, notes, and snippets.

@francoisgeorgy
Last active March 22, 2020 09:39
Show Gist options
  • Select an option

  • Save francoisgeorgy/7314cffd2de360bfa7e5db1485950ba2 to your computer and use it in GitHub Desktop.

Select an option

Save francoisgeorgy/7314cffd2de360bfa7e5db1485950ba2 to your computer and use it in GitHub Desktop.
how to set typography units #web #ui #css
html {
font-size: 16px;
@media (min-width: 800px) {
font-size: 18px;
}
@media (min-width: 1200px) {
font-size: 20px;
}
}
h1 { font-size: 3.125em; } // 50px ÷ 16 = 3.125
h2 { font-size: 2.3125em;} // 37px ÷ 16 = 2.3125
h3 { font-size: 1.75em; } // 28px ÷ 16 = 1.75
// ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment