Skip to content

Instantly share code, notes, and snippets.

@jamesmusgrave
Last active August 27, 2018 20:55
Show Gist options
  • Save jamesmusgrave/7378a4875e0b3630b56e387b32316214 to your computer and use it in GitHub Desktop.
Save jamesmusgrave/7378a4875e0b3630b56e387b32316214 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Type Scaling</title>
<style>
html{
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
-webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6{
margin-top: 1.5rem;
margin-bottom: 0;
line-height: 1.5rem;
}
h1{
font-size: 4.242rem;
line-height: 4.5rem;
}
h2{
font-size: 2.828rem;
line-height: 3rem;
}
h3{
font-size: 1.414rem;
}
p{
line-height: 1.5rem;
margin-top: 1.5rem;
margin-bottom: 0;
font-size:1rem;
}
article{
max-width: 45rem;
margin: -1.5rem auto 0 auto;
padding: 3rem;
}
@media (max-width:800px){
html {
font-size:16px;
}
article{
padding: 1.5rem;
}
}
@media (min-width: 800px){
html {
font-size:18px;
}
}
@media (min-width:1024px){
html {
font-size:20px;
}
}
@media (min-width:1440px) and (min-height:700px) {
html {
font-size:22px;
}
}
@media (min-width:1600px) and (min-height:900px) {
html {
font-size:24px;
}
}
</style>
</head>
<body>
<article>
<h1>Header</h1>
<h3>Sub-header</h3>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec viverra metus sed imperdiet rhoncus. Nullam ac convallis ipsum. Pellentesque vitae velit egestas, vehicula lorem nec, tincidunt justo. Vivamus aliquam gravida porttitor. Fusce sit amet eros ac felis cursus sodales. Cras vel nisi pellentesque, efficitur nisl eu, varius mi. Nulla nec orci eu dui hendrerit luctus id et erat. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed sed fermentum sapien, non volutpat tellus. Duis dapibus et purus sit amet facilisis. Sed pharetra justo ac nisl pharetra pellentesque. Nunc finibus non justo sit amet fermentum. Donec faucibus, sapien et imperdiet mattis, eros arcu pulvinar risus, non aliquam sem ligula in ligula.
</p>
<p>
Aliquam sit amet laoreet augue, mollis cursus lorem. Proin tempor tellus eget bibendum facilisis. In nec viverra purus. Maecenas feugiat dignissim metus id varius. Nulla facilisi. Aenean varius turpis eu odio dapibus aliquet. Sed nisl lacus, aliquam vitae ullamcorper in, dictum in justo. Pellentesque eu libero sit amet ligula varius egestas. Nunc tincidunt lectus neque, sit amet luctus nibh laoreet eget. Aenean nec massa at urna fermentum aliquam in quis felis. Vivamus lacinia condimentum quam sit amet pellentesque. Nam at fringilla dui, et facilisis nibh.
</p>
</article>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment