Skip to content

Instantly share code, notes, and snippets.

@lucasdidthis
Created April 27, 2017 09:09
Show Gist options
  • Select an option

  • Save lucasdidthis/716d6c85ae56e951dde468162d09c074 to your computer and use it in GitHub Desktop.

Select an option

Save lucasdidthis/716d6c85ae56e951dde468162d09c074 to your computer and use it in GitHub Desktop.
formula to calculate responsive font-size
/* formula */
font-size: calc( min-font-size + (max-font-size - min-font-size)*(100vw - min-screen-size)/(max-screen-size - min-screen-size) );
/* example */
font-size: calc( 16px + (24 - 16)*(100vw - 400px)/(800 - 400) );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment