Last active
May 25, 2021 20:39
-
-
Save engray/01ee62aaafe5df72647ef92add5e4f35 to your computer and use it in GitHub Desktop.
css vmax polyfill as sass function IE 10/11
This file contains 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
// vmax polyfill as sass function | |
// should work also in IE 10/11 | |
@function vmaxCalc($vmax) { | |
@return calc(#{$vmax} * (#{1vw} + #{1vh} - #{1vmin})); | |
} | |
// usage: | |
width: vmaxCalc(75); | |
// result: | |
width: calc(75 * (1vw + 1vh - 1vmin)); | |
// which is the same as: | |
width: 75vmax; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment