Skip to content

Instantly share code, notes, and snippets.

@jeanlescure
Created March 30, 2020 10:14
Show Gist options
  • Save jeanlescure/387c78271597c5d5c4024070b35024ad to your computer and use it in GitHub Desktop.
Save jeanlescure/387c78271597c5d5c4024070b35024ad 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