Created
November 16, 2018 20:50
-
-
Save NickDeckerDevs/5222e0db32ba4a4afbfb131fb170f64b to your computer and use it in GitHub Desktop.
fluid type mixin
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 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