Skip to content

Instantly share code, notes, and snippets.

@jeremybise
Created March 25, 2019 00:16
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 jeremybise/29a1971cfe28e681b5766937cd229b40 to your computer and use it in GitHub Desktop.
Save jeremybise/29a1971cfe28e681b5766937cd229b40 to your computer and use it in GitHub Desktop.
Fluid (calc) Font Size
/*
TuT: https://css-tricks.com/snippets/css/fluid-typography/
Formula: font-size: calc([minimum size] + ([maximum size] - [minimum size]) * ((100vw - [minimum viewport width]) / ([maximum viewport width] - [minimum viewport width])));
*/
body { font-size: calc(14px + (18 - 14) * ((100vw - 320px) / (1920 - 320))); }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment