Skip to content

Instantly share code, notes, and snippets.

@saylestyler
Last active May 17, 2019 19:12
Show Gist options
  • Save saylestyler/9b0bd3a42425caae3a4788636719be97 to your computer and use it in GitHub Desktop.
Save saylestyler/9b0bd3a42425caae3a4788636719be97 to your computer and use it in GitHub Desktop.
add responsive type to (almost) any page
* {
box-sizing: border-box;
}
html {
/* font-family: 'Muli', sans-serif; */
font-family: 'Ubuntu', sans-serif;
background: #EAEAEA;
color: #333;
font-smoothing: antialiased;
text-rendering: optimizeLegibility;
}
body {
padding: 0 1em;
}
pre {
font-size: 12px;
padding: 10px;
background: white;
border: solid 1px #777;
}
table {
border-collapse: collapse;
border-spacing: 0px;
border: 1px solid #666;
}
td, th {
padding: 0.25rem .5rem;
border: 1px solid #666;
}
:root {
font-size: 16px;
}
@media (min-width: 400px) and (max-width: 800px) {
:root {
font-size: calc( 12px + (24 - 12) * ( (100vw - 400px) / ( 800 - 400) ));
}
}
@media (min-width: 800px) {
:root {
font-size: 24px;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment