Skip to content

Instantly share code, notes, and snippets.

@ideafm
Last active September 29, 2018 10:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ideafm/da098533f06827c27777fd68fa393b30 to your computer and use it in GitHub Desktop.
Save ideafm/da098533f06827c27777fd68fa393b30 to your computer and use it in GitHub Desktop.
Stylus Fluid Typography Font-size
ffz($minFz, $maxFz, $minVw = 575px, $maxVw = 1920px)
tmp = unit($maxFz, '') - unit($minFz, '')
tmp1 = unit($maxVw, '') - unit($minVw, '')
font-size: $minFz;
@media screen and (min-width: $minVw)
font-size: 'calc(%s + %s * ((100vw - %s) / %s))' % ($minFz tmp $minVw tmp1)
@media screen and (min-width: $maxVw)
font-size: $maxFz;
/*
body
ffz(12px, 18px)
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment