Skip to content

Instantly share code, notes, and snippets.

@nternetinspired
Created October 1, 2015 16:47
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nternetinspired/0d5caf60b4cfd167815f to your computer and use it in GitHub Desktop.
Save nternetinspired/0d5caf60b4cfd167815f to your computer and use it in GitHub Desktop.
Setting the root font-size in % ensures device-specific sizing is not overruled.
html {
font-size: 100%;
@include mq($min, $sm) {
font-size: 106.3%; // 17px if the root was 16px
}
@include mq($min, $md) {
font-size: 112.5%; // 18px if the root was 16px
}
@include mq($min, $lg) {
font-size: 125%; // 20px if the root was 16px
}
@include mq($min, $xl) {
font-size: 137.5%; // 22px if the root was 16px
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment