Skip to content

Instantly share code, notes, and snippets.

@jasonroot
Last active July 8, 2019 16:16
Show Gist options
  • Save jasonroot/925fc8c45533812a4bdf4fd3f8f477ac to your computer and use it in GitHub Desktop.
Save jasonroot/925fc8c45533812a4bdf4fd3f8f477ac to your computer and use it in GitHub Desktop.
font scaling
/// fonts
html,
body {
font-size: 14px !important;
}
h1 {
font-size: 1.602em;
}
h2 {
font-size: 1.424em;
}
h3 {
font-size: 1.266em;
}
h4 {
font-size: 1.125em;
}
h5 {
font-size: 0.889em;
}
h6 {
font-size: 0.79em;
}
/// fonts for medium devices (tablets, 48em and up)
@media (min-width: 48em) {
h1 {
font-size: 2.441em;
}
h2 {
font-size: 1.953em;
}
h3 {
font-size: 1.563em;
}
h4 {
font-size: 1.25em;
}
}
/// fonts for large devices (desktops, 64em and up)
@media (min-width: 64em) {
html,
body {
font-size: 16px !important;
}
}
/// fonts for extra large devices (large desktops, 76.5em and up)
@media (min-width: 76.5em) {
html,
body {
font-size: 18px !important;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment