Skip to content

Instantly share code, notes, and snippets.

@nex3
Created October 23, 2022 21:50
Show Gist options
  • Save nex3/64b4cb1521cbeccf8bbe05ef75cd5b3c to your computer and use it in GitHub Desktop.
Save nex3/64b4cb1521cbeccf8bbe05ef75cd5b3c to your computer and use it in GitHub Desktop.
$supports-first-class-calc: calc(1) == 1;
@function divide-portable($number1, $number2) {
@if $supports-first-class-calc {
@return calc($number1 / $number2);
} @else {
@return $number1 / $number2;
}
}
@brandonmcconnell
Copy link

Thanks so much for this! Works great 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment