Skip to content

Instantly share code, notes, and snippets.

@mCzolko
Created December 14, 2016 11:02
Show Gist options
  • Save mCzolko/97ac655f0127da7b47e6cce1a6bf8808 to your computer and use it in GitHub Desktop.
Save mCzolko/97ac655f0127da7b47e6cce1a6bf8808 to your computer and use it in GitHub Desktop.
responsive font in specific viewport sizes
@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