Skip to content

Instantly share code, notes, and snippets.

@engray
Last active May 25, 2021 20:39
Show Gist options
  • Save engray/01ee62aaafe5df72647ef92add5e4f35 to your computer and use it in GitHub Desktop.
Save engray/01ee62aaafe5df72647ef92add5e4f35 to your computer and use it in GitHub Desktop.
css vmax polyfill as sass function IE 10/11
// 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