Skip to content

Instantly share code, notes, and snippets.

@NickTomlin
Created May 8, 2012 23:03
Show Gist options
  • Save NickTomlin/2640236 to your computer and use it in GitHub Desktop.
Save NickTomlin/2640236 to your computer and use it in GitHub Desktop.
Scaling text-size with media queries
html {
font-size:@remSize; /* 16px/100% */
}
/* general proportional styles */
p {
font-size: 2em; // 32px @ max-width /* (text needs to *pop* ;) ) */
line-height: 1.5;
margin:0 0 3em 0;
}
/* mobile and up cascading media queries */
@media only screen and (min-width: 320px) {
html {
font-size:10px;
}
@media only screen and (min-width: 480px) {
html {
font-size: 11px;
}
}
/* etc etc */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment