Created
March 25, 2019 00:16
-
-
Save jeremybise/29a1971cfe28e681b5766937cd229b40 to your computer and use it in GitHub Desktop.
Fluid (calc) Font Size
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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