Created
December 28, 2012 16:53
-
-
Save laurakalbag/4399636 to your computer and use it in GitHub Desktop.
Example of an article with varying widths, font-sizes and line-heights depending on the viewport width, written in Sass.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
article { | |
font-size: 14px; | |
line-height: 25px; | |
h2 { | |
font-size: 18px; | |
padding-bottom: 15px; | |
} | |
@media only screen and (min-width: 300px) { | |
line-height: 20px; | |
width: 90%; | |
h2 { | |
padding-bottom: 10px; | |
} | |
} | |
@media only screen and (min-width: 600px) { | |
line-height: 25px; | |
width: 80%; | |
h2 { | |
padding-bottom: 15px; | |
} | |
} | |
@media only screen and (min-width: 900px) { | |
width: 60%; | |
} | |
@media only screen and (min-width: 1200px) { | |
font-size: 16px; | |
line-height: 30px; | |
width: 50%; | |
h2 { | |
font-size: 21px; | |
line-height: 35px; | |
padding-bottom: 20px; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment