Skip to content

Instantly share code, notes, and snippets.

@kumail-raza
Forked from jeanlescure/useful-css.md
Created October 27, 2020 09:31
Show Gist options
  • Save kumail-raza/1e81a14ac3514d70bf4c1070e1aaeeb3 to your computer and use it in GitHub Desktop.
Save kumail-raza/1e81a14ac3514d70bf4c1070e1aaeeb3 to your computer and use it in GitHub Desktop.

Fluid typograghy

body {
  font-size: calc([minimum size] + ([maximum size] - [minimum size]) * ((100vw - [minimum viewport width]) / ([maximum viewport width] - [minimum viewport width])));
}

Example

body {
  font-size: calc(14px + (26 - 14) * ((100vw - 300px) / (1600 - 300)));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment