Created
December 14, 2016 11:02
-
-
Save mCzolko/97ac655f0127da7b47e6cce1a6bf8808 to your computer and use it in GitHub Desktop.
responsive font in specific viewport sizes
This file contains hidden or 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
@mixin font-resposive($font-from, $font-to, $media-from, $media-to) { | |
@media screen and (max-width: $media-from) { | |
font-size: $font-from + 0px; | |
&:before { content: $font-from + ''; } | |
} | |
$iteration-count: $font-to - $font-from; | |
$divider: ($media-to - $media-from) / $iteration-count; | |
@for $i from 0 through $iteration-count { | |
@media screen and (min-width: ($media-from + ($divider * $i))) { | |
font-size: $font-from + $i + 0px; | |
&:before { content: $font-from + $i + ''; } | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment