Skip to content

Instantly share code, notes, and snippets.

@NickDeckerDevs
Created November 16, 2018 20:50
Show Gist options
  • Select an option

  • Save NickDeckerDevs/5222e0db32ba4a4afbfb131fb170f64b to your computer and use it in GitHub Desktop.

Select an option

Save NickDeckerDevs/5222e0db32ba4a4afbfb131fb170f64b to your computer and use it in GitHub Desktop.
fluid type mixin
@mixin fluid-type($font-style: inherit, $font-name: inherit, $min-font-size: 12px, $max-font-size: 21px, $line-height: 1.5, $lower-range: 500px, $upper-range: 1200px) {
font: $font-style calc(#{$min-font-size} + #{(($max-font-size / ($max-font-size * 0 + 1)) - ($min-font-size / ($min-font-size * 0 + 1)))} * ( (100vw - #{$lower-range}) / #{(($upper-range / ($upper-range * 0 + 1)) - ($lower-range / ($lower-range * 0 + 1)))})) /#{$line-height} $font-name;
@media screen and (max-width: $lower-range) {
// font-fami
font: $font-style #{$min-font-size}/#{$line-height} $font-name;
}
@media screen and (min-width: $upper-range){
font: $font-style #{$max-font-size}/#{$line-height} $font-name;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment