-
-
Save Nikolasgrizli/a8ae0c05cb7f0d73077f2fd36bbf096a to your computer and use it in GitHub Desktop.
Less fx font-size depends on window screen width
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
.font-size-fx(@min-size: 15, @max-size: 25, @min-width: 768, @max-width: 1024){ | |
font-size: @max-size * 1px; | |
font-size: ~"calc(@{min-size}px + (@{max-size} - @{min-size}) * ((100vw - @{min-width}px) / (@{max-width} - @{min-width})))"; | |
@media screen and (max-width: (@min-width + 1px)) { | |
font-size: @min-size * 1px; | |
} | |
@media screen and (min-width: (@max-width + 1px)) { | |
font-size: @max-size * 1px; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment